Address Contract Partially Verified
Address
0x64c6bA14ef4e77AE7d61687382Ec0aA58a73544c
Balance
0.008149 ETH
Nonce
1
Code Size
19294 bytes
Creator
0x701b5B2F...b0DA at tx 0x80fc1c63...0d869d
Indexed Transactions
0
Contract Bytecode
19294 bytes
0x6080604052600436106101a85763ffffffff60e060020a600035041663018a25e8811461034857806306fdde031461036f578063079ce327146103f95780630e07ef81146104195780630f15f4c01461046757806310f01eba1461047c578063180603eb1461049d57806324c33d33146104b25780632660316e1461052057806327d879241461054f5780632ce21999146105a65780632e19ebdc146105e4578063349cdcac146105fc5780633ccfd60b1461061a5780635893d4811461062f578063624ae5c01461064a578063630664341461065f578063747dff421461069557806382bfc7391461071157806382e37b2c1461073857806383197ef0146107505780638f38f3091461076557806395d89b411461077357806398a0871d14610788578063a2bccae91461079f578063a2e7223e146107ba578063a65b37a1146107db578063c519500e146107e9578063c7e284b81461081a578063ce89c80c1461082f578063cf8080001461084a578063d53b267914610862578063de7874f314610877578063e3c08adf146108d1578063ee0b5d8b146108e9578063f32306d214610942575b6101b0614a40565b600e5460009060ff161515600114610214576040805160e560020a62461bcd0281526020600482015260296024820152600080516020614ad38339815191526044820152600080516020614a93833981519152606482015290519081900360840190fd5b33803b801561025b576040805160e560020a62461bcd0281526020600482015260116024820152600080516020614b13833981519152604482015290519081900360640190fd5b34633b9aca008110156102b3576040805160e560020a62461bcd0281526020600482015260216024820152600080516020614ab3833981519152604482015260f860020a607902606482015290519081900360840190fd5b69152d02c7e14af6800000811115610303576040805160e560020a62461bcd02815260206004820152600e6024820152600080516020614af3833981519152604482015290519081900360640190fd5b61030c85610990565b336000908152600560209081526040808320548084526007909252909120600601549196509450610341908590600288610a11565b5050505050005b34801561035457600080fd5b5061035d610bfa565b60408051918252519081900360200190f35b34801561037b57600080fd5b50610384610cbd565b6040805160208082528351818301528351919283929083019185019080838360005b838110156103be5781810151838201526020016103a6565b50505050905090810190601f1680156103eb5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561040557600080fd5b50610417600435602435604435610cf4565b005b6040805160206004803580820135601f81018490048402850184019095528484526104179436949293602493928401919081908401838280828437509497505093359450610efe9350505050565b34801561047357600080fd5b5061041761116f565b34801561048857600080fd5b5061035d600160a060020a03600435166112a4565b3480156104a957600080fd5b5061035d6112b6565b3480156104be57600080fd5b506104ca6004356112bc565b604080519b8c5260208c019a909a528a8a019890985295151560608a0152608089019490945260a088019290925260c087015260e086015261010085015261012084015261014083015251908190036101600190f35b34801561052c57600080fd5b5061053b60043560243561131a565b604080519115158252519081900360200190f35b6040805160206004803580820135601f810184900484028501840190955284845261041794369492936024939284019190819084018382808284375094975050509235600160a060020a0316935061133a92505050565b3480156105b257600080fd5b506105be600435611548565b604080519485526020850193909352838301919091526060830152519081900360800190f35b3480156105f057600080fd5b5061035d60043561156f565b34801561060857600080fd5b50610417600435602435604435611581565b34801561062657600080fd5b50610417611767565b34801561063b57600080fd5b5061035d600435602435611adc565b34801561065657600080fd5b5061035d611af9565b34801561066b57600080fd5b50610677600435611aff565b60408051938452602084019290925282820152519081900360600190f35b3480156106a157600080fd5b506106aa611ca5565b604080519c8d5260208d019b909b528b8b019990995260608b019790975260808a019590955260a0890193909352600160a060020a0390911660c088015260e087015261010086015261012085015261014084015261016083015251908190036101800190f35b34801561071d57600080fd5b50610417600160a060020a0360043516602435604435611d33565b34801561074457600080fd5b5061035d600435611f2f565b34801561075c57600080fd5b50610417611f47565b610417600435602435611fc9565b34801561077f57600080fd5b506103846121b0565b610417600160a060020a03600435166024356121e7565b3480156107ab57600080fd5b506106776004356024356123fe565b3480156107c657600080fd5b5061053b600160a060020a036004351661242a565b610417600435602435612459565b3480156107f557600080fd5b50610801600435612663565b6040805192835260208301919091528051918290030190f35b34801561082657600080fd5b5061035d61267c565b34801561083b57600080fd5b5061035d60043560243561270b565b34801561085657600080fd5b5061035d6004356127b3565b34801561086e57600080fd5b5061053b612863565b34801561088357600080fd5b5061088f60043561286c565b60408051600160a060020a0390981688526020880196909652868601949094526060860192909252608085015260a084015260c0830152519081900360e00190f35b3480156108dd57600080fd5b5061035d6004356128b3565b3480156108f557600080fd5b5061090a600160a060020a03600435166128c8565b604080519788526020880196909652868601949094526060860192909252608085015260a084015260c0830152519081900360e00190f35b6040805160206004803580820135601f8101849004840285018401909552848452610417943694929360249392840191908190840183828082843750949750509335945061299e9350505050565b610998614a40565b336000908152600560205260408120549080821515610a08576109ba33612b8e565b33600081815260056020908152604080832085905584835260079091528120805473ffffffffffffffffffffffffffffffffffffffff19169092179091559093509150819050845160010185525b50929392505050565b600480546002546000828152600a6020526040902090920154909142910181118015610a7f57506000828152600a602052604090206002015481111580610a7f57506000828152600a602052604090206002015481118015610a7f57506000828152600a6020526040902054155b15610a9757610a92828734888888612bf5565b610bf2565b6000828152600a602052604090206002015481118015610ac957506000828152600a602052604090206003015460ff16155b15610bbd576000828152600a60205260409020600301805460ff19166001179055610af383612ee8565b8051670de0b6b3a7640000830201815260208082018051890181526000898152600783526040908190206001015484519251828601516060808801516080808a015160a0808c015160c0808e01518b513381529d8e019a909a52348d8c0152958c019a909a52918a0195909552600160a060020a039093169288019290925286015260e0850152610100840192909252610120830191909152519194507f5905265be09e3f6f7813c1dce4febfad76d4b3a46288aa344d2531532c3519c991908190036101400190a15b600086815260076020526040902060030154610bdf903463ffffffff61328216565b6000878152600760205260409020600301555b505050505050565b600480546002546000828152600a602052604081209093015442910181118015610c6657506000828152600a602052604090206002015481111580610c6657506000828152600a602052604090206002015481118015610c6657506000828152600a6020526040902054155b15610cae576000828152600a6020526040902060050154610ca790670de0b6b3a764000090610c9b908263ffffffff61328216565b9063ffffffff6132e316565b9250610cb8565b6544364c5bb00092505b505090565b60408051808201909152600f81527f536176652074686520706c616e65740000000000000000000000000000000000602082015281565b610cfc614a40565b600e54600090819060ff161515600114610d62576040805160e560020a62461bcd0281526020600482015260296024820152600080516020614ad38339815191526044820152600080516020614a93833981519152606482015290519081900360840190fd5b33803b8015610da9576040805160e560020a62461bcd0281526020600482015260116024820152600080516020614b13833981519152604482015290519081900360640190fd5b85633b9aca00811015610e01576040805160e560020a62461bcd0281526020600482015260216024820152600080516020614ab3833981519152604482015260f860020a607902606482015290519081900360840190fd5b69152d02c7e14af6800000811115610e51576040805160e560020a62461bcd02815260206004820152600e6024820152600080516020614af3833981519152604482015290519081900360640190fd5b336000908152600560205260409020549450881580610e80575060008581526007602052604090206001015489145b15610e9e576000858152600760205260409020600601549350610edb565b600089815260066020818152604080842054898552600790925290922001549094508414610edb5760008581526007602052604090206006018490555b610ee488613310565b9750610ef385858a8a8a613334565b505050505050505050565b600080600080610f0c614a40565b60008033803b8015610f56576040805160e560020a62461bcd0281526020600482015260116024820152600080516020614b13833981519152604482015290519081900360640190fd5b336000908152600560209081526040808320548084526007909252909120600101541580610f82575080155b1515610fd8576040805160e560020a62461bcd02815260206004820152601060248201527f616c726561647920686173206e616d6500000000000000000000000000000000604482015290519081900360640190fd5b610fe18c613504565b600354909a5033995034985088101561106a576040805160e560020a62461bcd02815260206004820152602660248201527f756d6d2e2e2e2e2e2020796f75206861766520746f2070617920746865206e6160448201527f6d65206665650000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b6110738961242a565b965061107e86610990565b955061108933612b8e565b94508a1580159061109a57508a8a14155b156110dc5760008b8152600660208181526040808420548985526007909252909220015490945084146110dc5760008581526007602052604090206006018490555b6110e6858b613d17565b600084815260076020908152604091829020805460019091015483518b15158152928301889052600160a060020a03918216838501526060830152608082018b90524260a083015291518c928c169188917fdd6176433ff5026bbce96b068584b7bbe3514227e72df9c630b749ae87e644429181900360c00190a4505050505050505050505050565b73d775c5063bef4eda77a21646a6880494d9a1156b33146111da576040805160e560020a62461bcd02815260206004820152601b60248201527f6f6e6c79207465616d206a7573742063616e2061637469766174650000000000604482015290519081900360640190fd5b600e5460ff1615611235576040805160e560020a62461bcd02815260206004820152601860248201527f53746172336420616c7265616479206163746976617465640000000000000000604482015290519081900360640190fd5b600e805460ff1916600190811790915560048190556000819052600a602052427fbbc70db1b6c7afd11e79c0fb0051300458f1a3acb8ee9789d9b6b26c61ad9bcb819055905401618ca0017fbbc70db1b6c7afd11e79c0fb0051300458f1a3acb8ee9789d9b6b26c61ad9bc955565b60056020526000908152604090205481565b60035481565b600a60208190526000918252604090912080546001820154600283015460038401546004850154600586015460068701546007880154600889015460098a015499909a015497999698959760ff90951696939592949193909290918b565b600960209081526000928352604080842090915290825290205460ff1681565b600080600080611348614a40565b60008033803b8015611392576040805160e560020a62461bcd0281526020600482015260116024820152600080516020614b13833981519152604482015290519081900360640190fd5b3360009081526005602090815260408083205480845260079092529091206001015415806113be575080155b1515611414576040805160e560020a62461bcd02815260206004820152601060248201527f616c726561647920686173206e616d6500000000000000000000000000000000604482015290519081900360640190fd5b61141d8c613504565b600354909a503399503498508810156114a6576040805160e560020a62461bcd02815260206004820152602660248201527f756d6d2e2e2e2e2e2020796f75206861766520746f2070617920746865206e6160448201527f6d65206665650000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b6114af8961242a565b96506114ba86610990565b95506114c533612b8e565b9450600160a060020a038b16158015906114f1575088600160a060020a03168b600160a060020a031614155b156110dc57600160a060020a038b1660009081526005602090815260408083205488845260079092529091206006015490945084146110dc5760008581526007602052604090206006018490556110e6858b613d17565b600c6020526000908152604090208054600182015460028301546003909301549192909184565b60066020526000908152604090205481565b611589614a40565b600e5460009060ff1615156001146115ed576040805160e560020a62461bcd0281526020600482015260296024820152600080516020614ad38339815191526044820152600080516020614a93833981519152606482015290519081900360840190fd5b33803b8015611634576040805160e560020a62461bcd0281526020600482015260116024820152600080516020614b13833981519152604482015290519081900360640190fd5b84633b9aca0081101561168c576040805160e560020a62461bcd0281526020600482015260216024820152600080516020614ab3833981519152604482015260f860020a607902606482015290519081900360840190fd5b69152d02c7e14af68000008111156116dc576040805160e560020a62461bcd02815260206004820152600e6024820152600080516020614af3833981519152604482015290519081900360640190fd5b3360009081526005602052604090205493508715806116fa57508388145b15611718576000848152600760205260409020600601549750611745565b60008481526007602052604090206006015488146117455760008481526007602052604090206006018890555b61174e87613310565b965061175d8489898989613334565b5050505050505050565b600080600080611775614a40565b600e5460ff1615156001146117d6576040805160e560020a62461bcd0281526020600482015260296024820152600080516020614ad38339815191526044820152600080516020614a93833981519152606482015290519081900360840190fd5b33803b801561181d576040805160e560020a62461bcd0281526020600482015260116024820152600080516020614b13833981519152604482015290519081900360640190fd5b60045433600090815260056020908152604080832054848452600a9092529091206002015491985042975095508611801561186a57506000878152600a602052604090206003015460ff16155b801561188357506000878152600a602052604090205415155b15611a1d576000878152600a60205260409020600301805460ff191660011790556118ad83612ee8565b92506118b885613e6c565b9350600084111561190957600085815260076020526040808220549051600160a060020a039091169186156108fc02918791818181858888f19350505050158015611907573d6000803e3d6000fd5b505b85670de0b6b3a764000002836000015101836000018181525050848360200151018360200181815250507f9e9c9331834267c84342f2dce38f9ba35eb0bfbcc207c64872e1e74f9706f2a33360076000888152602001908152602001600020600101548686600001518760200151886040015189606001518a608001518b60a001518c60c00151604051808b600160a060020a0316600160a060020a031681526020018a6000191660001916815260200189815260200188815260200187815260200186600160a060020a0316600160a060020a0316815260200185600019166000191681526020018481526020018381526020018281526020019a505050505050505050505060405180910390a1611ad3565b611a2685613e6c565b93506000841115611a7757600085815260076020526040808220549051600160a060020a039091169186156108fc02918791818181858888f19350505050158015611a75573d6000803e3d6000fd5b505b6000858152600760209081526040918290206001015482513381529182015280820186905260608101889052905186917f8f36579a548bc439baa172a6521207464154da77f411e2da3db2f53affe6cc3a919081900360800190a25b50505050505050565b600b60209081526000928352604080842090915290825290205481565b60045481565b6004546000818152600a60205260408120600201549091829182919042118015611b3b57506000818152600a602052604090206003015460ff16155b8015611b5457506000818152600a602052604090205415155b15611c75576000818152600a6020526040902054851415611c39576000818152600a6020526040902060070154611bc290606490611b9990603063ffffffff613eff16565b811515611ba257fe5b60008881526007602052604090206002015491900463ffffffff61328216565b6000868152600860209081526040808320858452909152902060020154611c1b90611bfd90611bf18986613f76565b9063ffffffff61404616565b6000888152600760205260409020600301549063ffffffff61328216565b60008781526007602052604090206004015491955093509150611c9d565b600085815260076020908152604080832060029081015460088452828520868652909352922090910154611c1b90611bfd90611bf18986613f76565b60008581526007602052604090206002810154600590910154611c1b90611bfd9088906140a6565b509193909250565b600480546000818152600a602081815260408084206005810154600280830154988301546007808501548554600196870154818c52928952878b208054908801548d8d52600b8b52898d208d8052909a52888c2054978c52888c2054958c52888c205460038d5298909b20549b9d959c9b939a91990290910196600160a060020a0390911695909493909190565b611d3b614a40565b600e54600090819060ff161515600114611da1576040805160e560020a62461bcd0281526020600482015260296024820152600080516020614ad38339815191526044820152600080516020614a93833981519152606482015290519081900360840190fd5b33803b8015611de8576040805160e560020a62461bcd0281526020600482015260116024820152600080516020614b13833981519152604482015290519081900360640190fd5b85633b9aca00811015611e40576040805160e560020a62461bcd0281526020600482015260216024820152600080516020614ab3833981519152604482015260f860020a607902606482015290519081900360840190fd5b69152d02c7e14af6800000811115611e90576040805160e560020a62461bcd02815260206004820152600e6024820152600080516020614af3833981519152604482015290519081900360640190fd5b336000908152600560205260409020549450600160a060020a0389161580611ec05750600160a060020a03891633145b15611ede576000858152600760205260409020600601549350610edb565b600160a060020a0389166000908152600560209081526040808320548884526007909252909120600601549094508414610edb576000858152600760205260409020600601849055610ee488613310565b6000818152600760205260409020600101545b919050565b737ce07aa2fc356fa52f622c1f4df1e8eaad7febf03314611fb2576040805160e560020a62461bcd02815260206004820152601360248201527f736f727279206e6f74207468652061646d696e00000000000000000000000000604482015290519081900360640190fd5b737ce07aa2fc356fa52f622c1f4df1e8eaad7febf0ff5b611fd1614a40565b600e5460009060ff161515600114612035576040805160e560020a62461bcd0281526020600482015260296024820152600080516020614ad38339815191526044820152600080516020614a93833981519152606482015290519081900360840190fd5b33803b801561207c576040805160e560020a62461bcd0281526020600482015260116024820152600080516020614b13833981519152604482015290519081900360640190fd5b34633b9aca008110156120d4576040805160e560020a62461bcd0281526020600482015260216024820152600080516020614ab3833981519152604482015260f860020a607902606482015290519081900360840190fd5b69152d02c7e14af6800000811115612124576040805160e560020a62461bcd02815260206004820152600e6024820152600080516020614af3833981519152604482015290519081900360640190fd5b61212d85610990565b33600090815260056020526040902054909550935086158061214e57508387145b1561216c576000848152600760205260409020600601549650612199565b60008481526007602052604090206006015487146121995760008481526007602052604090206006018790555b6121a286613310565b9550611ad384888888610a11565b60408051808201909152600481527f5374617200000000000000000000000000000000000000000000000000000000602082015281565b6121ef614a40565b600e54600090819060ff161515600114612255576040805160e560020a62461bcd0281526020600482015260296024820152600080516020614ad38339815191526044820152600080516020614a93833981519152606482015290519081900360840190fd5b33803b801561229c576040805160e560020a62461bcd0281526020600482015260116024820152600080516020614b13833981519152604482015290519081900360640190fd5b34633b9aca008110156122f4576040805160e560020a62461bcd0281526020600482015260216024820152600080516020614ab3833981519152604482015260f860020a607902606482015290519081900360840190fd5b69152d02c7e14af6800000811115612344576040805160e560020a62461bcd02815260206004820152600e6024820152600080516020614af3833981519152604482015290519081900360640190fd5b61234d86610990565b33600090815260056020526040902054909650945061236b87613310565b9650600160a060020a038816158061238b5750600160a060020a03881633145b156123a95760008581526007602052604090206006015493506123f2565b600160a060020a03881660009081526005602090815260408083205488845260079092529091206006015490945084146123f25760008581526007602052604090206006018490555b61175d85858989610a11565b600860209081526000928352604080842090915290825290208054600182015460029092015490919083565b600160a060020a038116600090815260056020526040812054151561245157506001611f42565b506000611f42565b612461614a40565b600e54600090819060ff1615156001146124c7576040805160e560020a62461bcd0281526020600482015260296024820152600080516020614ad38339815191526044820152600080516020614a93833981519152606482015290519081900360840190fd5b33803b801561250e576040805160e560020a62461bcd0281526020600482015260116024820152600080516020614b13833981519152604482015290519081900360640190fd5b34633b9aca00811015612566576040805160e560020a62461bcd0281526020600482015260216024820152600080516020614ab3833981519152604482015260f860020a607902606482015290519081900360840190fd5b69152d02c7e14af68000008111156125b6576040805160e560020a62461bcd02815260206004820152600e6024820152600080516020614af3833981519152604482015290519081900360640190fd5b6125bf86610990565b3360009081526005602052604090205490965094508715806125f1575060008581526007602052604090206001015488145b1561260f57600085815260076020526040902060060154935061264c565b60008881526006602081815260408084205489855260079092529092200154909450841461264c5760008581526007602052604090206006018490555b61265587613310565b965061175d85858989610a11565b600d602052600090815260409020805460019091015482565b6004546000818152600a60205260408120600201549091904290811015612702576002546000838152600a6020526040902060040154018111156126dc576000828152600a6020526040902060020154610ca7908263ffffffff61404616565b6002546000838152600a6020526040902060040154610ca791018263ffffffff61404616565b60009250610cb8565b6002546000838152600a602052604081206004015490914291018111801561277557506000848152600a60205260409020600201548111158061277557506000848152600a60205260409020600201548111801561277557506000848152600a6020526040902054155b156127a3576000848152600a602052604090206006015461279c908463ffffffff61410416565b91506127ac565b61279c83614125565b5092915050565b600480546002546000828152600a60205260408120909301544291018111801561281f57506000828152600a60205260409020600201548111158061281f57506000828152600a60205260409020600201548111801561281f57506000828152600a6020526040902054155b15612853576000828152600a602052604090206005015461284c908590610c9b908263ffffffff61328216565b925061285c565b61284c8461419d565b5050919050565b600e5460ff1681565b6007602052600090815260409020805460018201546002830154600384015460048501546005860154600690960154600160a060020a039095169593949293919290919087565b60009081526007602052604090206006015490565b6000806000806000806000806000600454915050600160a060020a0389166000908152600560208181526040808420548085526007808452828620600180820154600887528589208a8a528752948820015496839052935260028301549290930154929384939192909161295f906129419086906140a6565b6000878152600760205260409020600301549063ffffffff61328216565b600095865260076020908152604080882060040154600883528189209989529890915290952054939e929d50909b509950919750919550909350915050565b6000806000806129ac614a40565b60008033803b80156129f6576040805160e560020a62461bcd0281526020600482015260116024820152600080516020614b13833981519152604482015290519081900360640190fd5b336000908152600560209081526040808320548084526007909252909120600101541580612a22575080155b1515612a78576040805160e560020a62461bcd02815260206004820152601060248201527f616c726561647920686173206e616d6500000000000000000000000000000000604482015290519081900360640190fd5b612a818c613504565b9950339850349750612a928961242a565b600354909750341015612b15576040805160e560020a62461bcd02815260206004820152602660248201527f756d6d2e2e2e2e2e2020796f75206861766520746f2070617920746865206e6160448201527f6d65206665650000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b612b1e86610990565b9550612b2933612b8e565b94508a93508315801590612b4e57506000858152600760205260409020600601548414155b8015612b5a5750848414155b15612b785760008581526007602052604090206006018490556110dc565b848414156110dc57600093506110e6858b613d17565b600160a060020a0381166000908152600560205260408120541515612bd6575060008054600101808255600160a060020a038316825260056020526040909120819055611f42565b50600160a060020a038116600090815260056020526040902054611f42565b6000858152600860209081526040808320898452909152812060010154819081901515612c2957612c26888561420a565b93505b6000898152600a602052604090206006015468056bc75e2d63100000118015612c83575060008881526008602090815260408083208c8452909152902054670de0b6b3a764000090612c81908963ffffffff61328216565b115b15612d0a5760008881526008602090815260408083208c8452909152902054612cbb90670de0b6b3a76400009063ffffffff61404616565b9250612ccd878463ffffffff61404616565b600089815260076020526040902060030154909250612cf2908363ffffffff61328216565b60008981526007602052604090206003015591955085915b633b9aca00871115610ef3576000898152600a6020526040902060060154612d38908863ffffffff61410416565b9050670de0b6b3a76400008110612daf57612d53818a61426a565b6000898152600a60205260409020548814612d7a576000898152600a602052604090208890555b6000898152600a60205260409020600101548514612da7576000898152600a602052604090206001018590555b835160640184525b60008881526008602090815260408083208c8452909152902060010154612ddd90829063ffffffff61328216565b60008981526008602090815260408083208d84529091529020600181019190915554612e0a908890613282565b60008981526008602090815260408083208d8452825280832093909355600a90522060050154612e4190829063ffffffff61328216565b60008a8152600a60205260409020600581019190915560060154612e6c90889063ffffffff61328216565b60008a8152600a6020908152604080832060060193909355600b815282822088835290522054612ea390889063ffffffff61328216565b60008a8152600b60209081526040808320898452909152902055612ec988888887614349565b9350612ed98989898885896144ee565b9350610ef388868984886146a4565b612ef0614a40565b6004546000818152600a6020526040812080546001820154600790920154909280808080806064612f2888603063ffffffff613eff16565b811515612f3157fe5b04955060328760008a8152600d60205260409020600101549190049550606490612f6290899063ffffffff613eff16565b811515612f6b57fe5b049350612f8484611bf187818b8b63ffffffff61404616565b60008b8152600a6020526040902060050154909350612fb185670de0b6b3a764000063ffffffff613eff16565b811515612fba57fe5b60008c8152600a6020526040902060050154919004925061300890670de0b6b3a764000090612ff090859063ffffffff613eff16565b811515612ff957fe5b8691900463ffffffff61404616565b9050600081111561303857613023848263ffffffff61404616565b9350613035838263ffffffff61328216565b92505b60008981526007602052604090206002015461305b90879063ffffffff61328216565b60008a8152600760205260408082206002019290925581517fd0e30db000000000000000000000000000000000000000000000000000000000815291517303347abb58cc3071fdbba7f7bd7cca03c8e042299263d0e30db092899260048084019382900301818588803b1580156130d157600080fd5b505af11580156130e5573d6000803e3d6000fd5b50505060008c8152600a602052604090206008015461310d925084915063ffffffff61328216565b600a60008c815260200190815260200160002060080181905550600a60008b815260200190815260200160002060020154620f4240028c60000151018c60000181815250508767016345785d8a000002896a52b7d2dcc80cd2e4000000028d6020015101018c6020018181525050600760008a815260200190815260200160002060000160009054906101000a9004600160a060020a03168c60400190600160a060020a03169081600160a060020a031681525050600760008a8152602001908152602001600020600101548c606001906000191690816000191681525050858c6080018181525050838c60c0018181525050828c60a001818152505060046000815480929190600101919050555089806001019a505042600a60008c815260200190815260200160002060040181905550613254618ca04261328290919063ffffffff16565b60008b8152600a6020526040902060028101919091556007018390558b9a5050505050505050505050919050565b818101828110156132dd576040805160e560020a62461bcd02815260206004820152601360248201527f536166654d61746820616464206661696c656400000000000000000000000000604482015290519081900360640190fd5b92915050565b60006133096133006132fb858563ffffffff61404616565b61419d565b611bf18561419d565b9392505050565b6000808210806133205750600382115b1561332d57506002611f42565b5080611f42565b600480546002546000828152600a60205260409020909201549091429101811180156133a257506000828152600a6020526040902060020154811115806133a257506000828152600a6020526040902060020154811180156133a257506000828152600a6020526040902054155b156133d9576133b484611bf189613e6c565b6000888152600760205260409020600301556133d4828886898988612bf5565b611ad3565b6000828152600a60205260409020600201548111801561340b57506000828152600a602052604090206003015460ff16155b15611ad3576000828152600a60205260409020600301805460ff1916600117905561343583612ee8565b8051670de0b6b3a76400008302018152602080820180518a01815260008a8152600783526040908190206001015484519251828601516060808801516080808a015160a0808c015160c0808e01518b513381529d8e019a909a528c8b019b909b52948b0196909652600160a060020a0390941690890152928701929092529385019390935260e0840192909252610100830191909152519194507f603a740c9291cc914e0c8d16b355cdb091aefd5d9bbdf4f95371ce756f5e8a4091908190036101200190a150505050505050565b805160009082908280806020841180159061351f5750600084115b151561359b576040805160e560020a62461bcd02815260206004820152602a60248201527f737472696e67206d757374206265206265747765656e203120616e642033322060448201527f6368617261637465727300000000000000000000000000000000000000000000606482015290519081900360840190fd5b8460008151811015156135aa57fe5b90602001015160f860020a900460f860020a02600160f860020a031916602060f860020a0214158015613611575084600185038151811015156135e957fe5b90602001015160f860020a900460f860020a02600160f860020a031916602060f860020a0214155b151561368d576040805160e560020a62461bcd02815260206004820152602560248201527f737472696e672063616e6e6f74207374617274206f7220656e6420776974682060448201527f7370616365000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b84600081518110151561369c57fe5b90602001015160f860020a900460f860020a02600160f860020a031916603060f860020a0214156137df578460018151811015156136d657fe5b90602001015160f860020a900460f860020a02600160f860020a031916607860f860020a0214151515613753576040805160e560020a62461bcd02815260206004820152601b60248201527f737472696e672063616e6e6f7420737461727420776974682030780000000000604482015290519081900360640190fd5b84600181518110151561376257fe5b90602001015160f860020a900460f860020a02600160f860020a031916605860f860020a02141515156137df576040805160e560020a62461bcd02815260206004820152601b60248201527f737472696e672063616e6e6f7420737461727420776974682030580000000000604482015290519081900360640190fd5b600091505b83821015613caf5784517f40000000000000000000000000000000000000000000000000000000000000009086908490811061381c57fe5b90602001015160f860020a900460f860020a02600160f860020a031916118015613890575084517f5b000000000000000000000000000000000000000000000000000000000000009086908490811061387157fe5b90602001015160f860020a900460f860020a02600160f860020a031916105b156138fd5784828151811015156138a357fe5b90602001015160f860020a900460f860020a0260f860020a900460200160f860020a0285838151811015156138d457fe5b906020010190600160f860020a031916908160001a9053508215156138f857600192505b613ca4565b848281518110151561390b57fe5b90602001015160f860020a900460f860020a02600160f860020a031916602060f860020a0214806139db575084517f60000000000000000000000000000000000000000000000000000000000000009086908490811061396757fe5b90602001015160f860020a900460f860020a02600160f860020a0319161180156139db575084517f7b00000000000000000000000000000000000000000000000000000000000000908690849081106139bc57fe5b90602001015160f860020a900460f860020a02600160f860020a031916105b80613a85575084517f2f0000000000000000000000000000000000000000000000000000000000000090869084908110613a1157fe5b90602001015160f860020a900460f860020a02600160f860020a031916118015613a85575084517f3a0000000000000000000000000000000000000000000000000000000000000090869084908110613a6657fe5b90602001015160f860020a900460f860020a02600160f860020a031916105b1515613b01576040805160e560020a62461bcd02815260206004820152602260248201527f737472696e6720636f6e7461696e7320696e76616c696420636861726163746560448201527f7273000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b8482815181101515613b0f57fe5b90602001015160f860020a900460f860020a02600160f860020a031916602060f860020a021415613bee578482600101815181101515613b4b57fe5b90602001015160f860020a900460f860020a02600160f860020a031916602060f860020a0214151515613bee576040805160e560020a62461bcd02815260206004820152602860248201527f737472696e672063616e6e6f7420636f6e7461696e20636f6e7365637574697660448201527f6520737061636573000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b82158015613c9a575084517f300000000000000000000000000000000000000000000000000000000000000090869084908110613c2757fe5b90602001015160f860020a900460f860020a02600160f860020a0319161080613c9a575084517f390000000000000000000000000000000000000000000000000000000000000090869084908110613c7b57fe5b90602001015160f860020a900460f860020a02600160f860020a031916115b15613ca457600192505b6001909101906137e4565b600183151514613d09576040805160e560020a62461bcd02815260206004820152601d60248201527f737472696e672063616e6e6f74206265206f6e6c79206e756d62657273000000604482015290519081900360640190fd5b505050506020015192915050565b60008181526006602052604090205415613da157600082815260096020908152604080832084845290915290205460ff161515600114613da1576040805160e560020a62461bcd02815260206004820152601e60248201527f736f7272792074686174206e616d657320616c72656164792074616b656e0000604482015290519081900360640190fd5b6000828152600760209081526040808320600101849055838352600682528083208590558483526009825280832084845290915290205460ff161515613e065760008281526009602090815260408083208484529091529020805460ff191660011790555b7303347abb58cc3071fdbba7f7bd7cca03c8e04229600160a060020a031663d0e30db0346040518263ffffffff1660e060020a0281526004016000604051808303818588803b158015613e5857600080fd5b505af1158015611ad3573d6000803e3d6000fd5b6000818152600760205260408120600501548190613e8b9084906147fb565b600083815260076020526040902060048101546003820154600290920154613ec992613ebd919063ffffffff61328216565b9063ffffffff61328216565b90506000811115613ef55760008381526007602052604081206002810182905560038101829055600401555b8091505b50919050565b6000821515613f10575060006132dd565b50818102818382811515613f2057fe5b04146132dd576040805160e560020a62461bcd02815260206004820152601360248201527f536166654d617468206d756c206661696c656400000000000000000000000000604482015290519081900360640190fd5b60008281526008602090815260408083208484528252808320600190810154600a8085528386206005810154818501548852600d8752948720909301548787529452600790910154670de0b6b3a76400009361403593614029929091614000918791606491613fea9163ffffffff613eff16565b811515613ff357fe5b049063ffffffff613eff16565b81151561400957fe5b6000888152600a602052604090206008015491900463ffffffff61328216565b9063ffffffff613eff16565b81151561403e57fe5b049392505050565b6000828211156140a0576040805160e560020a62461bcd02815260206004820152601360248201527f536166654d61746820737562206661696c656400000000000000000000000000604482015290519081900360640190fd5b50900390565b600082815260086020818152604080842085855282528084206002810154600190910154600a909352908420909201546133099291670de0b6b3a7640000916140ee91613eff565b8115156140f757fe5b049063ffffffff61404616565b600061330961411284614125565b611bf1614125868663ffffffff61328216565b60006309502f9061418d6d03b2a1d15167e7c5699bfde00000611bf16141887a0dac7055469777a6122ee4310dd6c14410500f2904840000000000613ebd6b01027e72f1f12813088000006140298a670de0b6b3a764000063ffffffff613eff16565b614892565b81151561419657fe5b0492915050565b60006141b0670de0b6b3a76400006148e5565b61418d60026141e36141d086670de0b6b3a764000063ffffffff613eff16565b65886c8f6730709063ffffffff613eff16565b8115156141ec57fe5b04613ebd6141f9866148e5565b6304a817c89063ffffffff613eff16565b614212614a40565b60008381526007602052604090206005015415614246576000838152600760205260409020600501546142469084906147fb565b506004546000838152600760205260409020600501558051600a0181528092915050565b6000818152600a60205260408120600201544291908211801561429957506000838152600a6020526040902054155b156142bd576142b682613ebd601e670de0b6b3a764000088613ff3565b90506142ea565b6000838152600a60205260409020600201546142e790613ebd601e670de0b6b3a764000088613ff3565b90505b6142fd620151808363ffffffff61328216565b81101561431d576000838152600a60205260409020600201819055614343565b614330620151808363ffffffff61328216565b6000848152600a60205260409020600201555b50505050565b614351614a40565b600a84046000806064614365886003613eff565b81151561436e57fe5b600088815260076020526040902060060154919004925090508015156143a55761439e838363ffffffff61328216565b9250614417565b8781141580156143c5575060008181526007602052604090206001015415155b15614404576000818152600760205260409020600401546143ed90839063ffffffff61328216565b600082815260076020526040902060040155614417565b614414838363ffffffff61328216565b92505b878614158015614437575060008681526007602052604090206001015415155b156144765760008681526007602052604090206004015461445f90849063ffffffff61328216565b6000878152600760205260409020600401556144e2565b7303347abb58cc3071fdbba7f7bd7cca03c8e04229600160a060020a031663d0e30db0846040518263ffffffff1660e060020a0281526004016000604051808303818588803b1580156144c857600080fd5b505af11580156144dc573d6000803e3d6000fd5b50505050505b50929695505050505050565b6144f6614a40565b6000848152600c6020526040812060010154819081908190606490614522908b9063ffffffff613eff16565b81151561452b57fe5b60008a8152600c60205260409020600201549190049450606490614556908b9063ffffffff613eff16565b81151561455f57fe5b04925061459483611bf1606461457c8d600d63ffffffff613eff16565b81151561458557fe5b8d91900463ffffffff61404616565b98506145a6898563ffffffff61404616565b91506145b48b8b868a6148f1565b905060008111156145d2576145cf848263ffffffff61404616565b93505b7303347abb58cc3071fdbba7f7bd7cca03c8e04229600160a060020a031663d0e30db0846040518263ffffffff1660e060020a0281526004016000604051808303818588803b15801561462457600080fd5b505af1158015614638573d6000803e3d6000fd5b50505060008d8152600a602052604090206007015461466492509050613ebd848463ffffffff61328216565b60008c8152600a602052604090206007015560c086015161468c90859063ffffffff61328216565b60c08701525060e08501525091979650505050505050565b836c01431e0fae6d7217caa00000000242670de0b6b3a76400000282600001510101816000018181525050600454751aba4714957d300d0e549208b31adb100000000000000285826020015101018160200181815250507f9a7c9c87d6b6f6612f5105b409490de2755b5b67db0172ab189b7431e57c7c848160000151826020015160076000898152602001908152602001600020600101543387878760400151886060015189608001518a60a001518b60c001518c60e00151604051808d81526020018c81526020018b600019166000191681526020018a600160a060020a0316600160a060020a0316815260200189815260200188815260200187600160a060020a0316600160a060020a0316815260200186600019166000191681526020018581526020018481526020018381526020018281526020019c5050505050505050505050505060405180910390a15050505050565b600061480783836140a6565b9050600081111561488d5760008381526007602052604090206003015461483590829063ffffffff61328216565b600084815260076020908152604080832060030193909355600881528282208583529052206002015461486f90829063ffffffff61328216565b60008481526008602090815260408083208684529091529020600201555b505050565b60008060026148a2846001613282565b8115156148ab57fe5b0490508291505b81811015613ef95780915060026148d482858115156148cd57fe5b0483613282565b8115156148dd57fe5b0490506148b2565b60006132dd8283613eff565b6000848152600a60205260408120600501548190819061491f86670de0b6b3a764000063ffffffff613eff16565b81151561492857fe5b6000898152600a6020526040902060080154919004925061495090839063ffffffff61328216565b6000888152600a6020526040902060080155670de0b6b3a764000061497b838663ffffffff613eff16565b81151561498457fe5b60008881526008602081815260408084208d8552825280842060020154600a90925290922001549290910492506149d591613ebd908490670de0b6b3a7640000906140ee908a63ffffffff613eff16565b60008781526008602090815260408083208b8452825280832060020193909355600a90522060050154614a3590670de0b6b3a764000090614a1d90859063ffffffff613eff16565b811515614a2657fe5b8791900463ffffffff61404616565b979650505050505050565b6101006040519081016040528060008152602001600081526020016000600160a060020a031681526020016000801916815260200160008152602001600081526020016000815260200160008152509056006e20646973636f72640000000000000000000000000000000000000000000000706f636b6574206c696e743a206e6f7420612076616c69642063757272656e63697473206e6f74207265616479207965742e2020636865636b203f65746120696e6f20766974616c696b2c206e6f000000000000000000000000000000000000736f7272792068756d616e73206f6e6c79000000000000000000000000000000a165627a7a7230582002959279465417865d2e164ce7bec654b50eacbd1c1f473e901d136ab34d76d80029
Verified Source Code Partial Match
Compiler: v0.4.24+commit.e67f0147
EVM: byzantium
Optimization: Yes (200 runs)
Star3Dlong.sol 1919 lines
pragma solidity ^0.4.24;
/**
* @title -FoMo-3D v0.7.1
* ┌┬┐┌─┐┌─┐┌┬┐ ╦╦ ╦╔═╗╔╦╗ ┌─┐┬─┐┌─┐┌─┐┌─┐┌┐┌┌┬┐┌─┐
* │ ├┤ ├─┤│││ ║║ ║╚═╗ ║ ├─┘├┬┘├┤ └─┐├┤ │││ │ └─┐
* ┴ └─┘┴ ┴┴ ┴ ╚╝╚═╝╚═╝ ╩ ┴ ┴└─└─┘└─┘└─┘┘└┘ ┴ └─┘
* _____ _____
* (, / /) /) /) (, / /) /)
* ┌─┐ / _ (/_ // // / _ // _ __ _(/
* ├─┤ ___/___(/_/(__(_/_(/_(/_ ___/__/_)_(/_(_(_/ (_(_(_
* ┴ ┴ / / .-/ _____ (__ /
* (__ / (_/ (, / /)™
* / __ __ __ __ _ __ __ _ _/_ _ _(/
* ┌─┐┬─┐┌─┐┌┬┐┬ ┬┌─┐┌┬┐ /__/ (_(__(_)/ (_/_)_(_)/ (_(_(_(__(/_(_(_
* ├─┘├┬┘│ │ │││ ││ │ (__ / .-/ © Jekyll Island Inc. 2018
* ┴ ┴└─└─┘─┴┘└─┘└─┘ ┴ (_/ .--,-``-.
*========,---,.======================____==========================/ / '.=======,---,====*
* ,' .' | ,' , `. / ../ ; .' .' `\
* ,---.' | ,---. ,-+-,.' _ | ,---. \ ``\ .`- ' ,---.' \
* | | .' ' ,'\ ,-+-. ; , || ' ,'\ ,---,. \___\/ \ : | | .`\ |
* : : : / / | ,--.'|' | || / / | ,' .' | \ : | : : | ' |
* : | |-, . ; ,. : | | ,', | |, . ; ,. : ,---.' | / / / | ' ' ; :
* | : ;/| ' | |: : | | / | |--' ' | |: : | | .' \ \ \ ' | ; . |
* | | .' ' | .; : | : | | , ' | .; : : |.' ___ / : | | | : | '
* ' : ' | : | | : | |/ | : | `---' / /\ / : ' : | / ;
* | | | \ \ / | | |`-' \ \ / / ,,/ ',- . | | '` ,/
* | : \ `----' | ;/ `----' \ ''\ ; ; : .'
*====| | ,'=============='---'==========(long version)===========\ \ .'===| ,.'======*
* `----' `--`-,,-' '---'
* ╔═╗┌─┐┌─┐┬┌─┐┬┌─┐┬ ┌─────────────────────────┐ ╦ ╦┌─┐┌┐ ╔═╗┬┌┬┐┌─┐
* ║ ║├┤ ├┤ ││ │├─┤│ │ https://exitscam.me │ ║║║├┤ ├┴┐╚═╗│ │ ├┤
* ╚═╝└ └ ┴└─┘┴┴ ┴┴─┘ └─┬─────────────────────┬─┘ ╚╩╝└─┘└─┘╚═╝┴ ┴ └─┘
* ┌────────────────────────────────┘ └──────────────────────────────┐
* │╔═╗┌─┐┬ ┬┌┬┐┬┌┬┐┬ ┬ ╔╦╗┌─┐┌─┐┬┌─┐┌┐┌ ╦┌┐┌┌┬┐┌─┐┬─┐┌─┐┌─┐┌─┐┌─┐ ╔═╗┌┬┐┌─┐┌─┐┬┌─│
* │╚═╗│ ││ │ │││ │ └┬┘ ═ ║║├┤ └─┐││ ┬│││ ═ ║│││ │ ├┤ ├┬┘├┤ ├─┤│ ├┤ ═ ╚═╗ │ ├─┤│ ├┴┐│
* │╚═╝└─┘┴─┘┴─┴┘┴ ┴ ┴ ═╩╝└─┘└─┘┴└─┘┘└┘ ╩┘└┘ ┴ └─┘┴└─└ ┴ ┴└─┘└─┘ ╚═╝ ┴ ┴ ┴└─┘┴ ┴│
* │ ┌──────────┐ ┌───────┐ ┌─────────┐ ┌────────┐ │
* └────┤ Inventor ├───────────┤ Justo ├────────────┤ Sumpunk ├──────────────┤ Mantso ├──┘
* └──────────┘ └───────┘ └─────────┘ └────────┘
* ┌─────────────────────────────────────────────────────────┐ ╔╦╗┬ ┬┌─┐┌┐┌┬┌─┌─┐ ╔╦╗┌─┐
* │ Ambius, Aritz Cracker, Cryptoknight, Crypto McPump, │ ║ ├─┤├─┤│││├┴┐└─┐ ║ │ │
* │ Capex, JogFera, The Shocker, Daok, Randazzz, PumpRabbi, │ ╩ ┴ ┴┴ ┴┘└┘┴ ┴└─┘ ╩ └─┘
* │ Kadaz, Incognito Jo, Lil Stronghands, Ninja Turtle, └───────────────────────────┐
* │ Psaints, Satoshi, Vitalik, Nano 2nd, Bogdanoffs Isaac Newton, Nikola Tesla, │
* │ Le Comte De Saint Germain, Albert Einstein, Socrates, & all the volunteer moderator │
* │ & support staff, content, creators, autonomous agents, and indie devs for P3D. │
* │ Without your help, we wouldn't have the time to code this. │
* └─────────────────────────────────────────────────────────────────────────────────────┘
*
* This product is protected under license. Any unauthorized copy, modification, or use without
* express written consent from the creators is prohibited.
*
* WARNING: THIS PRODUCT IS HIGHLY ADDICTIVE. IF YOU HAVE AN ADDICTIVE NATURE. DO NOT PLAY.
*/
//==============================================================================
// _ _ _ _|_ _ .
// (/_\/(/_| | | _\ .
//==============================================================================
contract Star3Devents {
// fired whenever a player registers a name
event onNewName
(
uint256 indexed playerID,
address indexed playerAddress,
bytes32 indexed playerName,
bool isNewPlayer,
uint256 affiliateID,
address affiliateAddress,
bytes32 affiliateName,
uint256 amountPaid,
uint256 timeStamp
);
// fired at end of buy or reload
event onEndTx
(
uint256 compressedData,
uint256 compressedIDs,
bytes32 playerName,
address playerAddress,
uint256 ethIn,
uint256 keysBought,
address winnerAddr,
bytes32 winnerName,
uint256 amountWon,
uint256 newPot,
uint256 genAmount,
uint256 potAmount
);
// fired whenever theres a withdraw
event onWithdraw
(
uint256 indexed playerID,
address playerAddress,
bytes32 playerName,
uint256 ethOut,
uint256 timeStamp
);
// fired whenever a withdraw forces end round to be ran
event onWithdrawAndDistribute
(
address playerAddress,
bytes32 playerName,
uint256 ethOut,
uint256 compressedData,
uint256 compressedIDs,
address winnerAddr,
bytes32 winnerName,
uint256 amountWon,
uint256 newPot,
uint256 genAmount
);
// (fomo3d long only) fired whenever a player tries a buy after round timer
// hit zero, and causes end round to be ran.
event onBuyAndDistribute
(
address playerAddress,
bytes32 playerName,
uint256 ethIn,
uint256 compressedData,
uint256 compressedIDs,
address winnerAddr,
bytes32 winnerName,
uint256 amountWon,
uint256 newPot,
uint256 genAmount
);
// (fomo3d long only) fired whenever a player tries a reload after round timer
// hit zero, and causes end round to be ran.
event onReLoadAndDistribute
(
address playerAddress,
bytes32 playerName,
uint256 compressedData,
uint256 compressedIDs,
address winnerAddr,
bytes32 winnerName,
uint256 amountWon,
uint256 newPot,
uint256 genAmount
);
// fired whenever an affiliate is paid
event onAffiliatePayout
(
uint256 indexed affiliateID,
address affiliateAddress,
bytes32 affiliateName,
uint256 indexed roundID,
uint256 indexed buyerID,
uint256 amount,
uint256 timeStamp
);
// received pot swap deposit
event onPotSwapDeposit
(
uint256 roundID,
uint256 amountAddedToPot
);
}
interface CompanyShareInterface {
function deposit() external payable;
}
//==============================================================================
// _ _ _ _|_ _ _ __|_ _ _ _|_ _ .
// (_(_)| | | | (_|(_ | _\(/_ | |_||_) .
//====================================|=========================================
contract modularLong is Star3Devents {}
contract Star3Dlong is modularLong {
using SafeMath for *;
using NameFilter for string;
using Star3DKeysCalcLong for uint256;
//==============================================================================
// _ _ _ |`. _ _ _ |_ | _ _ .
// (_(_)| |~|~|(_||_|| (_||_)|(/__\ . (game settings)
//=================_|===========================================================
string constant public name = "Save the planet";
string constant public symbol = "Star";
CompanyShareInterface constant private CompanyShare = CompanyShareInterface(0x03347ABb58cc3071FDBBa7F7bD7cca03C8E04229);
uint256 private pID_ = 0; // total number of players
uint256 private rndExtra_ = 0 hours; // length of the very first ICO
uint256 private rndGap_ = 10 seconds; // length of ICO phase, set to 1 year for EOS.
uint256 constant private rndInit_ = 10 hours; // round timer starts at this
uint256 constant private rndInc_ = 30 seconds; // every full key purchased adds this much to the timer
uint256 constant private rndMax_ = 24 hours; // max length a round timer can be
uint256 public registrationFee_ = 10 finney; // price to register a name
//==============================================================================
// _| _ _|_ _ _ _ _|_ _ .
// (_|(_| | (_| _\(/_ | |_||_) . (data used to store game info that changes)
//=============================|================================================
// uint256 public airDropPot_; // person who gets the airdrop wins part of this pot
// uint256 public airDropTracker_ = 0; // incremented each time a "qualified" tx occurs. used to determine winning air drop
uint256 public rID_; // round id number / total rounds that have happened
//****************
// PLAYER DATA
//****************
mapping (address => uint256) public pIDxAddr_; // (addr => pID) returns player id by address
mapping (bytes32 => uint256) public pIDxName_; // (name => pID) returns player id by name
mapping (uint256 => Star3Ddatasets.Player) public plyr_; // (pID => data) player data
mapping (uint256 => mapping (uint256 => Star3Ddatasets.PlayerRounds)) public plyrRnds_; // (pID => rID => data) player round data by player id & round id
mapping (uint256 => mapping (bytes32 => bool)) public plyrNames_; // (pID => name => bool) list of names a player owns. (used so you can change your display name amongst any name you own)
//****************
// ROUND DATA
//****************
mapping (uint256 => Star3Ddatasets.Round) public round_; // (rID => data) round data
mapping (uint256 => mapping(uint256 => uint256)) public rndTmEth_; // (rID => tID => data) eth in per team, by round id and team id
//****************
// TEAM FEE DATA
//****************
mapping (uint256 => Star3Ddatasets.TeamFee) public fees_; // (team => fees) fee distribution by team
mapping (uint256 => Star3Ddatasets.PotSplit) public potSplit_; // (team => fees) pot split distribution by team
//==============================================================================
// _ _ _ __|_ _ __|_ _ _ .
// (_(_)| |_\ | | |_|(_ | (_)| . (initial data setup upon contract deploy)
//==============================================================================
constructor()
public
{
// Team allocation structures
// 0 = whales
// 1 = bears
// 2 = sneks
// 3 = bulls
// Team allocation percentages
// (Star, None) + (Pot , Referrals, Community)
// Referrals / Community rewards are mathematically designed to come from the winner's share of the pot.
fees_[0] = Star3Ddatasets.TeamFee(32, 45, 10, 3); //32%pot 45%gen 10%dev 3%aff 10%dev
fees_[1] = Star3Ddatasets.TeamFee(45, 32, 10, 3); //45%pot 32%gen 10%dev 3%aff 10%dev
fees_[2] = Star3Ddatasets.TeamFee(50, 27, 10, 3); //50%pot 27%gen 10%dev 3%aff 10%dev
fees_[3] = Star3Ddatasets.TeamFee(40, 37, 10, 3); //40%pot 37%gen 10%dev 3%aff 10%dev
// // how to split up the final pot based on which team was picked
// // (Star, None)
potSplit_[0] = Star3Ddatasets.PotSplit(20, 30); //newPot20% gen30% dev2% winer48%
potSplit_[1] = Star3Ddatasets.PotSplit(15, 35);
potSplit_[2] = Star3Ddatasets.PotSplit(25, 25);
potSplit_[3] = Star3Ddatasets.PotSplit(30, 20);
}
//==============================================================================
// _ _ _ _|. |`. _ _ _ .
// | | |(_)(_||~|~|(/_| _\ . (these are safety checks)
//==============================================================================
/**
* @dev used to make sure no one can interact with contract until it has
* been activated.
*/
modifier isActivated() {
require(activated_ == true, "its not ready yet. check ?eta in discord");
_;
}
modifier isRegisteredName()
{
uint256 _pID = pIDxAddr_[msg.sender];
require(plyr_[_pID].name == "" || _pID == 0, "already has name");
_;
}
/**
* @dev prevents contracts from interacting with fomo3d
*/
modifier isHuman() {
address _addr = msg.sender;
uint256 _codeLength;
assembly {_codeLength := extcodesize(_addr)}
require(_codeLength == 0, "sorry humans only");
_;
}
/**
* @dev sets boundaries for incoming tx
*/
modifier isWithinLimits(uint256 _eth) {
require(_eth >= 1000000000, "pocket lint: not a valid currency");
require(_eth <= 100000000000000000000000, "no vitalik, no");
_;
}
//==============================================================================
// _ |_ |. _ |` _ __|_. _ _ _ .
// |_)|_||_)||(_ ~|~|_|| |(_ | |(_)| |_\ . (use these to interact with contract)
//====|=========================================================================
/**
* @dev emergency buy uses last stored affiliate ID and team snek
*/
function()
isActivated()
isHuman()
isWithinLimits(msg.value)
public
payable
{
// set up our tx event data and determine if player is new or not
Star3Ddatasets.EventReturns memory _eventData_ = determinePID(_eventData_);
// fetch player id
uint256 _pID = pIDxAddr_[msg.sender];
// buy core
buyCore(_pID, plyr_[_pID].laff, 2, _eventData_);
}
/**
* @dev converts all incoming ethereum to keys.
* -functionhash- 0x8f38f309 (using ID for affiliate)
* -functionhash- 0x98a0871d (using address for affiliate)
* -functionhash- 0xa65b37a1 (using name for affiliate)
* @param _affCode the ID/address/name of the player who gets the affiliate fee
* @param _team what team is the player playing for?
*/
function buyXid(uint256 _affCode, uint256 _team)
isActivated()
isHuman()
isWithinLimits(msg.value)
public
payable
{
// set up our tx event data and determine if player is new or not
Star3Ddatasets.EventReturns memory _eventData_ = determinePID(_eventData_);
// fetch player id
uint256 _pID = pIDxAddr_[msg.sender];
// manage affiliate residuals
// if no affiliate code was given or player tried to use their own, lolz
if (_affCode == 0 || _affCode == _pID)
{
// use last stored affiliate code
_affCode = plyr_[_pID].laff;
// if affiliate code was given & its not the same as previously stored
} else if (_affCode != plyr_[_pID].laff) {
// update last affiliate
plyr_[_pID].laff = _affCode;
}
// verify a valid team was selected
_team = verifyTeam(_team);
// buy core
buyCore(_pID, _affCode, _team, _eventData_);
}
function buyXaddr(address _affCode, uint256 _team)
isActivated()
isHuman()
isWithinLimits(msg.value)
public
payable
{
// set up our tx event data and determine if player is new or not
Star3Ddatasets.EventReturns memory _eventData_ = determinePID(_eventData_);
// fetch player id
uint256 _pID = pIDxAddr_[msg.sender];
// verify a valid team was selected
_team = verifyTeam(_team);
// manage affiliate residuals
uint256 _affID;
// if no affiliate code was given or player tried to use their own, lolz
if (_affCode == address(0) || _affCode == msg.sender)
{
// use last stored affiliate code
_affID = plyr_[_pID].laff;
// if affiliate code was given
} else {
// get affiliate ID from aff Code
_affID = pIDxAddr_[_affCode];
// if affID is not the same as previously stored
if (_affID != plyr_[_pID].laff)
{
// update last affiliate
plyr_[_pID].laff = _affID;
}
}
// buy core
buyCore(_pID, _affID, _team, _eventData_);
}
function buyXname(bytes32 _affCode, uint256 _team)
isActivated()
isHuman()
isWithinLimits(msg.value)
public
payable
{
// set up our tx event data and determine if player is new or not
Star3Ddatasets.EventReturns memory _eventData_ = determinePID(_eventData_);
// fetch player id
uint256 _pID = pIDxAddr_[msg.sender];
// manage affiliate residuals
uint256 _affID;
// if no affiliate code was given or player tried to use their own, lolz
if (_affCode == '' || _affCode == plyr_[_pID].name)
{
// use last stored affiliate code
_affID = plyr_[_pID].laff;
// if affiliate code was given
} else {
// get affiliate ID from aff Code
_affID = pIDxName_[_affCode];
// if affID is not the same as previously stored
if (_affID != plyr_[_pID].laff)
{
// update last affiliate
plyr_[_pID].laff = _affID;
}
}
// verify a valid team was selected
_team = verifyTeam(_team);
// buy core
buyCore(_pID, _affID, _team, _eventData_);
}
/**
* @dev essentially the same as buy, but instead of you sending ether
* from your wallet, it uses your unwithdrawn earnings.
* -functionhash- 0x349cdcac (using ID for affiliate)
* -functionhash- 0x82bfc739 (using address for affiliate)
* -functionhash- 0x079ce327 (using name for affiliate)
* @param _affCode the ID/address/name of the player who gets the affiliate fee
* @param _team what team is the player playing for?
* @param _eth amount of earnings to use (remainder returned to gen vault)
*/
function reLoadXid(uint256 _affCode, uint256 _team, uint256 _eth)
isActivated()
isHuman()
isWithinLimits(_eth)
public
{
// set up our tx event data
Star3Ddatasets.EventReturns memory _eventData_;
// fetch player ID
uint256 _pID = pIDxAddr_[msg.sender];
// manage affiliate residuals
// if no affiliate code was given or player tried to use their own, lolz
if (_affCode == 0 || _affCode == _pID)
{
// use last stored affiliate code
_affCode = plyr_[_pID].laff;
// if affiliate code was given & its not the same as previously stored
} else if (_affCode != plyr_[_pID].laff) {
// update last affiliate
plyr_[_pID].laff = _affCode;
}
// verify a valid team was selected
_team = verifyTeam(_team);
// reload core
reLoadCore(_pID, _affCode, _team, _eth, _eventData_);
}
function reLoadXaddr(address _affCode, uint256 _team, uint256 _eth)
isActivated()
isHuman()
isWithinLimits(_eth)
public
{
// set up our tx event data
Star3Ddatasets.EventReturns memory _eventData_;
// fetch player ID
uint256 _pID = pIDxAddr_[msg.sender];
// manage affiliate residuals
uint256 _affID;
// if no affiliate code was given or player tried to use their own, lolz
if (_affCode == address(0) || _affCode == msg.sender)
{
// use last stored affiliate code
_affID = plyr_[_pID].laff;
// if affiliate code was given
} else {
// get affiliate ID from aff Code
_affID = pIDxAddr_[_affCode];
// if affID is not the same as previously stored
if (_affID != plyr_[_pID].laff)
{
// update last affiliate
plyr_[_pID].laff = _affID;
}
}
// verify a valid team was selected
_team = verifyTeam(_team);
// reload core
reLoadCore(_pID, _affID, _team, _eth, _eventData_);
}
function reLoadXname(bytes32 _affCode, uint256 _team, uint256 _eth)
isActivated()
isHuman()
isWithinLimits(_eth)
public
{
// set up our tx event data
Star3Ddatasets.EventReturns memory _eventData_;
// fetch player ID
uint256 _pID = pIDxAddr_[msg.sender];
// manage affiliate residuals
uint256 _affID;
// if no affiliate code was given or player tried to use their own, lolz
if (_affCode == '' || _affCode == plyr_[_pID].name)
{
// use last stored affiliate code
_affID = plyr_[_pID].laff;
// if affiliate code was given
} else {
// get affiliate ID from aff Code
_affID = pIDxName_[_affCode];
// if affID is not the same as previously stored
if (_affID != plyr_[_pID].laff)
{
// update last affiliate
plyr_[_pID].laff = _affID;
}
}
// verify a valid team was selected
_team = verifyTeam(_team);
// reload core
reLoadCore(_pID, _affID, _team, _eth, _eventData_);
}
/**
* @dev withdraws all of your earnings.
* -functionhash- 0x3ccfd60b
*/
function withdraw()
isActivated()
isHuman()
public
{
// setup local rID
uint256 _rID = rID_;
// grab time
uint256 _now = now;
// fetch player ID
uint256 _pID = pIDxAddr_[msg.sender];
// setup temp var for player eth
uint256 _eth;
// check to see if round has ended and no one has run round end yet
if (_now > round_[_rID].end && round_[_rID].ended == false && round_[_rID].plyr != 0)
{
// set up our tx event data
Star3Ddatasets.EventReturns memory _eventData_;
// end the round (distributes pot)
round_[_rID].ended = true;
_eventData_ = endRound(_eventData_);
// get their earnings
_eth = withdrawEarnings(_pID);
// gib moni
if (_eth > 0)
plyr_[_pID].addr.transfer(_eth);
// build event data
_eventData_.compressedData = _eventData_.compressedData + (_now * 1000000000000000000);
_eventData_.compressedIDs = _eventData_.compressedIDs + _pID;
// fire withdraw and distribute event
emit Star3Devents.onWithdrawAndDistribute
(
msg.sender,
plyr_[_pID].name,
_eth,
_eventData_.compressedData,
_eventData_.compressedIDs,
_eventData_.winnerAddr,
_eventData_.winnerName,
_eventData_.amountWon,
_eventData_.newPot,
_eventData_.genAmount
);
// in any other situation
} else {
// get their earnings
_eth = withdrawEarnings(_pID);
// gib moni
if (_eth > 0)
plyr_[_pID].addr.transfer(_eth);
// fire withdraw event
emit Star3Devents.onWithdraw(_pID, msg.sender, plyr_[_pID].name, _eth, _now);
}
}
/**
* @dev use these to register names. they are just wrappers that will send the
* registration requests to the PlayerBook contract. So registering here is the
* same as registering there. UI will always display the last name you registered.
* but you will still own all previously registered names to use as affiliate
* links.
* - must pay a registration fee.
* - name must be unique
* - names will be converted to lowercase
* - name cannot start or end with a space
* - cannot have more than 1 space in a row
* - cannot be only numbers
* - cannot start with 0x
* - name must be at least 1 char
* - max length of 32 characters long
* - allowed characters: a-z, 0-9, and space
* -functionhash- 0x921dec21 (using ID for affiliate)
* -functionhash- 0x3ddd4698 (using address for affiliate)
* -functionhash- 0x685ffd83 (using name for affiliate)
* @param _nameString players desired name
* @param _affCode affiliate ID, address, or name of who referred you
* (this might cost a lot of gas)
*/
function registerNameXID(string _nameString, uint256 _affCode)
isHuman()
isRegisteredName()
public
payable
{
bytes32 _name = _nameString.nameFilter();
address _addr = msg.sender;
uint256 _paid = msg.value;
bool _isNewPlayer = isNewPlayer(_addr);
require (msg.value >= registrationFee_, "umm..... you have to pay the name fee");
Star3Ddatasets.EventReturns memory _eventData_ = determinePID(_eventData_);
uint256 _pID = makePlayerID(msg.sender);
uint256 _affID = _affCode;
if (_affID != 0 && _affID != plyr_[_pID].laff && _affID != _pID)
{
// update last affiliate
plyr_[_pID].laff = _affID;
} else if (_affID == _pID) {
_affID = 0;
}
registerNameCore(_pID, _name);
// fire event
emit Star3Devents.onNewName(_pID, _addr, _name, _isNewPlayer, _affID, plyr_[_affID].addr, plyr_[_affID].name, _paid, now);
}
function registerNameXaddr(string _nameString, address _affCode)
isHuman()
isRegisteredName()
public
payable
{
bytes32 _name = _nameString.nameFilter();
address _addr = msg.sender;
uint256 _paid = msg.value;
require (msg.value >= registrationFee_, "umm..... you have to pay the name fee");
bool _isNewPlayer = isNewPlayer(_addr);
Star3Ddatasets.EventReturns memory _eventData_ = determinePID(_eventData_);
uint256 _pID = makePlayerID(msg.sender);
uint256 _affID;
if (_affCode != address(0) && _affCode != _addr)
{
// get affiliate ID from aff Code
_affID = pIDxAddr_[_affCode];
// if affID is not the same as previously stored
if (_affID != plyr_[_pID].laff)
{
// update last affiliate
plyr_[_pID].laff = _affID;
}
}
registerNameCore(_pID, _name);
// fire event
emit Star3Devents.onNewName(_pID, _addr, _name, _isNewPlayer, _affID, plyr_[_affID].addr, plyr_[_affID].name, _paid, now);
}
function registerNameXname(string _nameString, bytes32 _affCode)
isHuman()
isRegisteredName()
public
payable
{
bytes32 _name = _nameString.nameFilter();
address _addr = msg.sender;
uint256 _paid = msg.value;
require (msg.value >= registrationFee_, "umm..... you have to pay the name fee");
bool _isNewPlayer = isNewPlayer(_addr);
Star3Ddatasets.EventReturns memory _eventData_ = determinePID(_eventData_);
uint256 _pID = makePlayerID(msg.sender);
uint256 _affID;
if (_affCode != "" && _affCode != _name)
{
// get affiliate ID from aff Code
_affID = pIDxName_[_affCode];
// if affID is not the same as previously stored
if (_affID != plyr_[_pID].laff)
{
// update last affiliate
plyr_[_pID].laff = _affID;
}
}
registerNameCore(_pID, _name);
// fire event
emit Star3Devents.onNewName(_pID, _addr, _name, _isNewPlayer, _affID, plyr_[_affID].addr, plyr_[_affID].name, _paid, now);
}
function registerNameCore(uint256 _pID, bytes32 _name)
private
{
// if names already has been used, require that current msg sender owns the name
if (pIDxName_[_name] != 0)
require(plyrNames_[_pID][_name] == true, "sorry that names already taken");
// add name to player profile, registry, and name book
plyr_[_pID].name = _name;
pIDxName_[_name] = _pID;
if (plyrNames_[_pID][_name] == false)
{
plyrNames_[_pID][_name] = true;
}
// registration fee goes directly to community rewards
CompanyShare.deposit.value(msg.value)();
}
function isNewPlayer(address _addr)
public
view
returns (bool)
{
if (pIDxAddr_[_addr] == 0)
{
// set the new player bool to true
return (true);
} else {
return (false);
}
}
//==============================================================================
// _ _ _|__|_ _ _ _ .
// (_|(/_ | | (/_| _\ . (for UI & viewing things on etherscan)
//=====_|=======================================================================
/**
* @dev return the price buyer will pay for next 1 individual key.
* -functionhash- 0x018a25e8
* @return price for next key bought (in wei format)
*/
function getBuyPrice()
public
view
returns(uint256)
{
// setup local rID
uint256 _rID = rID_;
// grab time
uint256 _now = now;
// are we in a round?
if (_now > round_[_rID].strt + rndGap_ && (_now <= round_[_rID].end || (_now > round_[_rID].end && round_[_rID].plyr == 0)))
return ( (round_[_rID].keys.add(1000000000000000000)).ethRec(1000000000000000000) );
else // rounds over. need price for new round
return ( 75000000000000 ); // init
}
/**
* @dev returns time left. dont spam this, you'll ddos yourself from your node
* provider
* -functionhash- 0xc7e284b8
* @return time left in seconds
*/
function getTimeLeft()
public
view
returns(uint256)
{
// setup local rID
uint256 _rID = rID_;
// grab time
uint256 _now = now;
if (_now < round_[_rID].end)
if (_now > round_[_rID].strt + rndGap_)
return( (round_[_rID].end).sub(_now) );
else
return( (round_[_rID].strt + rndGap_).sub(_now) );
else
return(0);
}
/**
* @dev returns player earnings per vaults
* -functionhash- 0x63066434
* @return winnings vault
* @return general vault
* @return affiliate vault
*/
function getPlayerVaults(uint256 _pID)
public
view
returns(uint256 ,uint256, uint256)
{
// setup local rID
uint256 _rID = rID_;
// if round has ended. but round end has not been run (so contract has not distributed winnings)
if (now > round_[_rID].end && round_[_rID].ended == false && round_[_rID].plyr != 0)
{
// if player is winner
if (round_[_rID].plyr == _pID)
{
return
(
(plyr_[_pID].win).add( ((round_[_rID].pot).mul(48)) / 100 ),
(plyr_[_pID].gen).add( getPlayerVaultsHelper(_pID, _rID).sub(plyrRnds_[_pID][_rID].mask) ),
plyr_[_pID].aff
);
// if player is not the winner
} else {
return
(
plyr_[_pID].win,
(plyr_[_pID].gen).add( getPlayerVaultsHelper(_pID, _rID).sub(plyrRnds_[_pID][_rID].mask) ),
plyr_[_pID].aff
);
}
// if round is still going on, or round has ended and round end has been ran
} else {
return
(
plyr_[_pID].win,
(plyr_[_pID].gen).add(calcUnMaskedEarnings(_pID, plyr_[_pID].lrnd)),
plyr_[_pID].aff
);
}
}
/**
* solidity hates stack limits. this lets us avoid that hate
*/
function getPlayerVaultsHelper(uint256 _pID, uint256 _rID)
private
view
returns(uint256)
{
return( ((((round_[_rID].mask).add(((((round_[_rID].pot).mul(potSplit_[round_[_rID].team].endGen)) / 100).mul(1000000000000000000)) / (round_[_rID].keys))).mul(plyrRnds_[_pID][_rID].keys)) / 1000000000000000000) );
}
/**
* @dev returns all current round info needed for front end
* -functionhash- 0x747dff42
* @return eth invested during ICO phase
* @return round id
* @return total keys for round
* @return time round ends
* @return time round started
* @return current pot
* @return current team ID & player ID in lead
* @return current player in leads address
* @return current player in leads name
* @return whales eth in for round
* @return bears eth in for round
* @return sneks eth in for round
* @return bulls eth in for round
* @return airdrop tracker # & airdrop pot
*/
function getCurrentRoundInfo()
public
view
returns(uint256, uint256, uint256, uint256, uint256, uint256, address, bytes32, uint256, uint256, uint256, uint256)
{
// setup local rID
uint256 _rID = rID_;
return
(
_rID, //0
round_[_rID].keys, //1
round_[_rID].end, //2
round_[_rID].strt, //3
round_[_rID].pot, //4
(round_[_rID].team + (round_[_rID].plyr * 10)), //5
plyr_[round_[_rID].plyr].addr, //6
plyr_[round_[_rID].plyr].name, //7
rndTmEth_[_rID][0], //8
rndTmEth_[_rID][1], //9
rndTmEth_[_rID][2], //10
rndTmEth_[_rID][3] //11
);
}
/**
* @dev returns player info based on address. if no address is given, it will
* use msg.sender
* -functionhash- 0xee0b5d8b
* @param _addr address of the player you want to lookup
* @return player ID
* @return player name
* @return keys owned (current round)
* @return winnings vault
* @return general vault
* @return affiliate vault
* @return player round eth
*/
function getPlayerInfoByAddress(address _addr)
public
view
returns(uint256, bytes32, uint256, uint256, uint256, uint256, uint256)
{
// setup local rID
uint256 _rID = rID_;
if (_addr == address(0))
{
_addr == msg.sender;
}
uint256 _pID = pIDxAddr_[_addr];
return
(
_pID, //0
plyr_[_pID].name, //1
plyrRnds_[_pID][_rID].keys, //2
plyr_[_pID].win, //3
(plyr_[_pID].gen).add(calcUnMaskedEarnings(_pID, plyr_[_pID].lrnd)), //4
plyr_[_pID].aff, //5
plyrRnds_[_pID][_rID].eth //6
);
}
//==============================================================================
// _ _ _ _ | _ _ . _ .
// (_(_)| (/_ |(_)(_||(_ . (this + tools + calcs + modules = our softwares engine)
//=====================_|=======================================================
/**
* @dev logic runs whenever a buy order is executed. determines how to handle
* incoming eth depending on if we are in an active round or not
*/
function buyCore(uint256 _pID, uint256 _affID, uint256 _team, Star3Ddatasets.EventReturns memory _eventData_)
private
{
// setup local rID
uint256 _rID = rID_;
// grab time
uint256 _now = now;
// if round is active
if (_now > round_[_rID].strt + rndGap_ && (_now <= round_[_rID].end || (_now > round_[_rID].end && round_[_rID].plyr == 0)))
{
// call core
core(_rID, _pID, msg.value, _affID, _team, _eventData_);
// if round is not active
} else {
// check to see if end round needs to be ran
if (_now > round_[_rID].end && round_[_rID].ended == false)
{
// end the round (distributes pot) & start new round
round_[_rID].ended = true;
_eventData_ = endRound(_eventData_);
// build event data
_eventData_.compressedData = _eventData_.compressedData + (_now * 1000000000000000000);
_eventData_.compressedIDs = _eventData_.compressedIDs + _pID;
// fire buy and distribute event
emit Star3Devents.onBuyAndDistribute
(
msg.sender,
plyr_[_pID].name,
msg.value,
_eventData_.compressedData,
_eventData_.compressedIDs,
_eventData_.winnerAddr,
_eventData_.winnerName,
_eventData_.amountWon,
_eventData_.newPot,
_eventData_.genAmount
);
}
// put eth in players vault
plyr_[_pID].gen = plyr_[_pID].gen.add(msg.value);
}
}
/**
* @dev logic runs whenever a reload order is executed. determines how to handle
* incoming eth depending on if we are in an active round or not
*/
function reLoadCore(uint256 _pID, uint256 _affID, uint256 _team, uint256 _eth, Star3Ddatasets.EventReturns memory _eventData_)
private
{
// setup local rID
uint256 _rID = rID_;
// grab time
uint256 _now = now;
// if round is active
if (_now > round_[_rID].strt + rndGap_ && (_now <= round_[_rID].end || (_now > round_[_rID].end && round_[_rID].plyr == 0)))
{
// get earnings from all vaults and return unused to gen vault
// because we use a custom safemath library. this will throw if player
// tried to spend more eth than they have.
plyr_[_pID].gen = withdrawEarnings(_pID).sub(_eth);
// call core
core(_rID, _pID, _eth, _affID, _team, _eventData_);
// if round is not active and end round needs to be ran
} else if (_now > round_[_rID].end && round_[_rID].ended == false) {
// end the round (distributes pot) & start new round
round_[_rID].ended = true;
_eventData_ = endRound(_eventData_);
// build event data
_eventData_.compressedData = _eventData_.compressedData + (_now * 1000000000000000000);
_eventData_.compressedIDs = _eventData_.compressedIDs + _pID;
// fire buy and distribute event
emit Star3Devents.onReLoadAndDistribute
(
msg.sender,
plyr_[_pID].name,
_eventData_.compressedData,
_eventData_.compressedIDs,
_eventData_.winnerAddr,
_eventData_.winnerName,
_eventData_.amountWon,
_eventData_.newPot,
_eventData_.genAmount
);
}
}
/**
* @dev this is the core logic for any buy/reload that happens while a round
* is live.
*/
function core(uint256 _rID, uint256 _pID, uint256 _eth, uint256 _affID, uint256 _team, Star3Ddatasets.EventReturns memory _eventData_)
private
{
// if player is new to round
if (plyrRnds_[_pID][_rID].keys == 0)
_eventData_ = managePlayer(_pID, _eventData_);
// early round eth limiter
if (round_[_rID].eth < 100000000000000000000 && plyrRnds_[_pID][_rID].eth.add(_eth) > 1000000000000000000)
{
uint256 _availableLimit = (1000000000000000000).sub(plyrRnds_[_pID][_rID].eth);
uint256 _refund = _eth.sub(_availableLimit);
plyr_[_pID].gen = plyr_[_pID].gen.add(_refund);
_eth = _availableLimit;
}
// if eth left is greater than min eth allowed (sorry no pocket lint)
if (_eth > 1000000000)
{
// mint the new keys
uint256 _keys = (round_[_rID].eth).keysRec(_eth);
// if they bought at least 1 whole key
if (_keys >= 1000000000000000000)
{
updateTimer(_keys, _rID);
// set new leaders
if (round_[_rID].plyr != _pID)
round_[_rID].plyr = _pID;
if (round_[_rID].team != _team)
round_[_rID].team = _team;
// set the new leader bool to true
_eventData_.compressedData = _eventData_.compressedData + 100;
}
// store the air drop tracker number (number of buys since last airdrop)
_eventData_.compressedData = _eventData_.compressedData;
// update player
plyrRnds_[_pID][_rID].keys = _keys.add(plyrRnds_[_pID][_rID].keys);
plyrRnds_[_pID][_rID].eth = _eth.add(plyrRnds_[_pID][_rID].eth);
// update round
round_[_rID].keys = _keys.add(round_[_rID].keys);
round_[_rID].eth = _eth.add(round_[_rID].eth);
rndTmEth_[_rID][_team] = _eth.add(rndTmEth_[_rID][_team]);
// distribute eth
_eventData_ = distributeExternal(_pID, _eth, _affID, _eventData_);
_eventData_ = distributeInternal(_rID, _pID, _eth, _team, _keys, _eventData_);
// call end tx function to fire end tx event.
endTx(_pID, _team, _eth, _keys, _eventData_);
}
}
//==============================================================================
// _ _ | _ | _ _|_ _ _ _ .
// (_(_||(_|_||(_| | (_)| _\ .
//==============================================================================
/**
* @dev calculates unmasked earnings (just calculates, does not update mask)
* @return earnings in wei format
*/
function calcUnMaskedEarnings(uint256 _pID, uint256 _rIDlast)
private
view
returns(uint256)
{
return( (((round_[_rIDlast].mask).mul(plyrRnds_[_pID][_rIDlast].keys)) / (1000000000000000000)).sub(plyrRnds_[_pID][_rIDlast].mask) );
}
/**
* @dev returns the amount of keys you would get given an amount of eth.
* -functionhash- 0xce89c80c
* @param _rID round ID you want price for
* @param _eth amount of eth sent in
* @return keys received
*/
function calcKeysReceived(uint256 _rID, uint256 _eth)
public
view
returns(uint256)
{
// grab time
uint256 _now = now;
// are we in a round?
if (_now > round_[_rID].strt + rndGap_ && (_now <= round_[_rID].end || (_now > round_[_rID].end && round_[_rID].plyr == 0)))
return ( (round_[_rID].eth).keysRec(_eth) );
else // rounds over. need keys for new round
return ( (_eth).keys() );
}
/**
* @dev returns current eth price for X keys.
* -functionhash- 0xcf808000
* @param _keys number of keys desired (in 18 decimal format)
* @return amount of eth needed to send
*/
function iWantXKeys(uint256 _keys)
public
view
returns(uint256)
{
// setup local rID
uint256 _rID = rID_;
// grab time
uint256 _now = now;
// are we in a round?
if (_now > round_[_rID].strt + rndGap_ && (_now <= round_[_rID].end || (_now > round_[_rID].end && round_[_rID].plyr == 0)))
return ( (round_[_rID].keys.add(_keys)).ethRec(_keys) );
else // rounds over. need price for new round
return ( (_keys).eth() );
}
function makePlayerID(address _addr)
private
returns (uint256)
{
if (pIDxAddr_[_addr] == 0)
{
pID_++;
pIDxAddr_[_addr] = pID_;
// set the new player bool to true
return (pID_);
} else {
return (pIDxAddr_[_addr]);
}
}
function getPlayerName(uint256 _pID)
external
view
returns (bytes32)
{
return (plyr_[_pID].name);
}
function getPlayerLAff(uint256 _pID)
external
view
returns (uint256)
{
return (plyr_[_pID].laff);
}
/**
* @dev gets existing or registers new pID. use this when a player may be new
* @return pID
*/
function determinePID(Star3Ddatasets.EventReturns memory _eventData_)
private
returns (Star3Ddatasets.EventReturns)
{
uint256 _pID = pIDxAddr_[msg.sender];
// if player is new to this version of fomo3d
if (_pID == 0)
{
// grab their player ID, name and last aff ID, from player names contract
_pID = makePlayerID(msg.sender);
bytes32 _name = "";
uint256 _laff = 0;
// set up player account
pIDxAddr_[msg.sender] = _pID;
plyr_[_pID].addr = msg.sender;
if (_name != "")
{
pIDxName_[_name] = _pID;
plyr_[_pID].name = _name;
plyrNames_[_pID][_name] = true;
}
if (_laff != 0 && _laff != _pID)
plyr_[_pID].laff = _laff;
// set the new player bool to true
_eventData_.compressedData = _eventData_.compressedData + 1;
}
return (_eventData_);
}
/**
* @dev checks to make sure user picked a valid team. if not sets team
* to default (sneks)
*/
function verifyTeam(uint256 _team)
private
pure
returns (uint256)
{
if (_team < 0 || _team > 3)
return(2);
else
return(_team);
}
/**
* @dev decides if round end needs to be run & new round started. and if
* player u...
// [truncated — 71070 bytes total]
Read Contract
activated_ 0xd53b2679 → bool
calcKeysReceived 0xce89c80c → uint256
fees_ 0x2ce21999 → uint256, uint256, uint256, uint256
getBuyPrice 0x018a25e8 → uint256
getCurrentRoundInfo 0x747dff42 → uint256, uint256, uint256, uint256, uint256, uint256, address, bytes32, uint256, uint256, uint256, uint256
getPlayerInfoByAddress 0xee0b5d8b → uint256, bytes32, uint256, uint256, uint256, uint256, uint256
getPlayerLAff 0xe3c08adf → uint256
getPlayerName 0x82e37b2c → bytes32
getPlayerVaults 0x63066434 → uint256, uint256, uint256
getTimeLeft 0xc7e284b8 → uint256
iWantXKeys 0xcf808000 → uint256
isNewPlayer 0xa2e7223e → bool
name 0x06fdde03 → string
pIDxAddr_ 0x10f01eba → uint256
pIDxName_ 0x2e19ebdc → uint256
plyrNames_ 0x2660316e → bool
plyrRnds_ 0xa2bccae9 → uint256, uint256, uint256
plyr_ 0xde7874f3 → address, bytes32, uint256, uint256, uint256, uint256, uint256
potSplit_ 0xc519500e → uint256, uint256
rID_ 0x624ae5c0 → uint256
registrationFee_ 0x180603eb → uint256
rndTmEth_ 0x5893d481 → uint256
round_ 0x24c33d33 → uint256, uint256, uint256, bool, uint256, uint256, uint256, uint256, uint256, uint256, uint256
symbol 0x95d89b41 → string
Write Contract 12 functions
These functions modify contract state and require a wallet transaction to execute.
activate 0x0f15f4c0
No parameters
buyXaddr 0x98a0871d
address _affCode
uint256 _team
buyXid 0x8f38f309
uint256 _affCode
uint256 _team
buyXname 0xa65b37a1
bytes32 _affCode
uint256 _team
destroy 0x83197ef0
No parameters
reLoadXaddr 0x82bfc739
address _affCode
uint256 _team
uint256 _eth
reLoadXid 0x349cdcac
uint256 _affCode
uint256 _team
uint256 _eth
reLoadXname 0x079ce327
bytes32 _affCode
uint256 _team
uint256 _eth
registerNameXID 0xf32306d2
string _nameString
uint256 _affCode
registerNameXaddr 0x27d87924
string _nameString
address _affCode
registerNameXname 0x0e07ef81
string _nameString
bytes32 _affCode
withdraw 0x3ccfd60b
No parameters
Recent Transactions
No transactions found for this address