Address Contract Partially Verified
Address
0x9A5a3ECBdD96AB76A98c592F8b3de4e26C81900e
Balance
0 ETH
Nonce
1
Code Size
21544 bytes
Creator
0x6cD3522E...F3dd at tx 0x604a4553...c4d98e
Indexed Transactions
0 (1 on-chain, 1.2% indexed)
Contract Bytecode
21544 bytes
0x6080604052600436106103125763ffffffff60e060020a6000350416625e319c81146103b0578063024c7ec7146103e35780630337e3fb146103fd5780630a55fb3d1461042e5780630c7d5cd8146104575780630e53aae914610485578063119b90cd146104da57806312c2aca41461050757806316912f961461051c57806319b64015146105315780631cfab290146105495780631e1401f81461056a57806321e6b53d146105ad57806322f3e2d4146105ce5780632630c12f146105e35780632bd3c107146105f85780632bf0c985146106195780632fe8a6ad1461063a57806338a5e0161461064f578063395900d4146106645780633e8ff43f1461068e57806346749468146106ba57806349d10b64146106d55780634af80f0e146106ea57806354fd4d501461070b57806355776b77146107205780635768adcf1461073a578063579cd3ca1461075b5780635e35359e1461077057806361cd756e1461079a57806367b6d57c146107af57806369067d95146107d0578063690d8320146107f457806369d1354a146108155780636a49d2c41461082d57806371f52bf31461085757806379ba50971461086c5780637b103999146108815780638da5cb5b1461089657806394c275ad146108ab57806398a71dcb146108c05780639b99a8e2146108e1578063a32bff44146108f6578063af94b8d81461090b578063b4a176d314610935578063bf7545581461094a578063bf7da6ba1461095f578063c3321fb014610983578063c45d3d9214610998578063cdc91c69146109ad578063d031370b146109c2578063d260529c146109da578063d3fb73b4146109ef578063d4ee1d9014610a04578063d55ec69714610a19578063d64c5a1a14610a2e578063d66bd52414610a59578063d895951214610a7a578063db2830a414610a9b578063dc75eb9a14610ab0578063dc8de37914610ac5578063e38192e314610ae6578063e8104af914610b0d578063e8dc12ff14610b22578063ec2240f514610b4c578063ecbca55d14610b61578063f2fde38b14610b7f578063f9cddde214610ba0578063fc0c546a14610bb5575b60008051602061537d83398151915260005260076020527fb2084a3e4595ccf007fb44245853374aaf0de960074375e8e0fb334712e94d0f546601000000000000900460ff1615156103ae576040805160e560020a62461bcd02815260206004820152601360248201527f4552525f494e56414c49445f5245534552564500000000000000000000000000604482015290519081900360640190fd5b005b3480156103bc57600080fd5b506103d1600160a060020a0360043516610bca565b60408051918252519081900360200190f35b3480156103ef57600080fd5b506103ae6004351515610bf3565b34801561040957600080fd5b50610412610c3b565b60408051600160a060020a039092168252519081900360200190f35b34801561043a57600080fd5b50610443610c4a565b604080519115158252519081900360200190f35b34801561046357600080fd5b5061046c610c53565b6040805163ffffffff9092168252519081900360200190f35b34801561049157600080fd5b506104a6600160a060020a0360043516610c5f565b6040805195865263ffffffff9094166020860152911515848401521515606084015215156080830152519081900360a00190f35b3480156104e657600080fd5b506103ae600160a060020a0360043581169060243581169060443516610cfa565b34801561051357600080fd5b50610443611465565b34801561052857600080fd5b506103ae6114ae565b34801561053d57600080fd5b506104126004356114c2565b34801561055557600080fd5b5061046c600160a060020a03600435166114ee565b34801561057657600080fd5b50610594600160a060020a0360043581169060243516604435611520565b6040805192835260208301919091528051918290030190f35b3480156105b957600080fd5b506103ae600160a060020a036004351661153a565b3480156105da57600080fd5b5061044361154e565b3480156105ef57600080fd5b50610412611583565b34801561060457600080fd5b506103d1600160a060020a03600435166115a2565b34801561062557600080fd5b506103d1600160a060020a03600435166115f7565b34801561064657600080fd5b506104436116da565b34801561065b57600080fd5b506103ae6116fb565b34801561067057600080fd5b506103ae600160a060020a036004358116906024351660443561170d565b34801561069a57600080fd5b506106a36117ac565b6040805161ffff9092168252519081900360200190f35b3480156106c657600080fd5b506103ae6004356024356117b1565b3480156106e157600080fd5b506103ae611835565b3480156106f657600080fd5b506103ae600160a060020a0360043516611a95565b34801561071757600080fd5b506106a3611aca565b6103d1600160a060020a0360043516602435604435611acf565b34801561074657600080fd5b50610412600160a060020a0360043516612058565b34801561076757600080fd5b5061046c612076565b34801561077c57600080fd5b506103ae600160a060020a036004358116906024351660443561208e565b3480156107a657600080fd5b506104126121be565b3480156107bb57600080fd5b506103ae600160a060020a03600435166121cd565b3480156107dc57600080fd5b50610594600160a060020a0360043516602435612274565b34801561080057600080fd5b506103ae600160a060020a03600435166123cf565b34801561082157600080fd5b506103ae6004356124f0565b34801561083957600080fd5b506103ae600160a060020a036004351663ffffffff60243516612595565b34801561086357600080fd5b506106a36125f4565b34801561087857600080fd5b506103ae6125fe565b34801561088d57600080fd5b506104126126b2565b3480156108a257600080fd5b506104126126c1565b3480156108b757600080fd5b5061046c6126d0565b3480156108cc57600080fd5b506103d1600160a060020a03600435166126e4565b3480156108ed57600080fd5b506106a36126f6565b34801561090257600080fd5b506105946126fc565b34801561091757600080fd5b50610594600160a060020a0360043581169060243516604435612705565b34801561094157600080fd5b506103ae6128a9565b34801561095657600080fd5b506104436128d5565b34801561096b57600080fd5b506103ae600160a060020a03600435166024356128da565b34801561098f57600080fd5b506103d1612922565b3480156109a457600080fd5b50610412612928565b3480156109b957600080fd5b506103ae612937565b3480156109ce57600080fd5b50610412600435612990565b3480156109e657600080fd5b506104436129b8565b3480156109fb57600080fd5b506104126129bd565b348015610a1057600080fd5b506104126129cc565b348015610a2557600080fd5b506103ae6129db565b348015610a3a57600080fd5b50610a43612ad0565b6040805160ff9092168252519081900360200190f35b348015610a6557600080fd5b506104a6600160a060020a0360043516612ad5565b348015610a8657600080fd5b506103d1600160a060020a0360043516612b1b565b348015610aa757600080fd5b50610594612b2c565b348015610abc57600080fd5b50610412612b51565b348015610ad157600080fd5b506103d1600160a060020a0360043516612b60565b348015610af257600080fd5b506103d1600160a060020a0360043516602435604435612b89565b348015610b1957600080fd5b506103d1612f0a565b6103d1600160a060020a036004358116906024358116906044359060643581169060843516612f10565b348015610b5857600080fd5b5061059461317f565b348015610b6d57600080fd5b506103ae63ffffffff600435166131ff565b348015610b8b57600080fd5b506103ae600160a060020a03600435166132f4565b348015610bac57600080fd5b50610594613384565b348015610bc157600080fd5b5061041261338d565b600081610bd68161339c565b5050600160a060020a03166000908152600b602052604090205490565b610bfb61341b565b60038054911515740100000000000000000000000000000000000000000274ff000000000000000000000000000000000000000019909216919091179055565b600954600160a060020a031681565b60145460ff1681565b60085463ffffffff1681565b6000806000806000610c6f615318565b50505050600160a060020a03929092166000908152600760209081526040808320815160a081018352815480825260019092015463ffffffff811694820185905260ff64010000000082048116151594830194909452650100000000008104841615156060830152660100000000000090049092161515608090920182905295919450919250829190565b6000806000806000610d0a61346b565b610d1261341b565b87610d1c8161339c565b87610d26816134c8565b87610d30816134c8565b89610d3a81613529565b89610d4481613529565b60048054604080517f8da5cb5b00000000000000000000000000000000000000000000000000000000815290513093600160a060020a0390931692638da5cb5b928082019260209290918290030181600087803b158015610da457600080fd5b505af1158015610db8573d6000803e3d6000fd5b505050506040513d6020811015610dce57600080fd5b5051600160a060020a031614610e2e576040805160e560020a62461bcd02815260206004820152601460248201527f4552525f414e43484f525f4e4f545f4f574e4544000000000000000000000000604482015290519081900360640190fd5b610e577f436861696e6c696e6b4f7261636c6557686974656c6973740000000000000000613589565b995089600160a060020a0316633af32abf8d6040518263ffffffff1660e060020a0281526004018082600160a060020a0316600160a060020a03168152602001915050602060405180830381600087803b158015610eb457600080fd5b505af1158015610ec8573d6000803e3d6000fd5b505050506040513d6020811015610ede57600080fd5b50511515610f36576040805160e560020a62461bcd02815260206004820152601260248201527f4552525f494e56414c49445f4f5241434c450000000000000000000000000000604482015290519081900360640190fd5b89600160a060020a0316633af32abf8c6040518263ffffffff1660e060020a0281526004018082600160a060020a0316600160a060020a03168152602001915050602060405180830381600087803b158015610f9157600080fd5b505af1158015610fa5573d6000803e3d6000fd5b505050506040513d6020811015610fbb57600080fd5b50511515611013576040805160e560020a62461bcd02815260206004820152601260248201527f4552525f494e56414c49445f4f5241434c450000000000000000000000000000604482015290519081900360640190fd5b61101b613621565b60098054600160a060020a031916600160a060020a038f1617905560068054600090811061104557fe5b600091825260209091200154600160a060020a038e8116911614156110a35760068054600190811061107357fe5b600091825260209091200154600a8054600160a060020a031916600160a060020a039092169190911790556110de565b6006805460009081106110b257fe5b600091825260209091200154600a8054600160a060020a031916600160a060020a039092169190911790555b6111077f436f6e766572746572466163746f727900000000000000000000000000000000613589565b600160a060020a031663c977aed261111d6117ac565b6040518263ffffffff1660e060020a028152600401808261ffff1661ffff168152602001915050602060405180830381600087803b15801561115e57600080fd5b505af1158015611172573d6000803e3d6000fd5b505050506040513d602081101561118857600080fd5b8101908080519060200190929190505050985088600160a060020a0316631b27444e8e600a60009054906101000a9004600160a060020a03168f8f6040518563ffffffff1660e060020a0281526004018085600160a060020a0316600160a060020a0316815260200184600160a060020a0316600160a060020a0316815260200183600160a060020a0316600160a060020a0316815260200182600160a060020a0316600160a060020a03168152602001945050505050602060405180830381600087803b15801561125957600080fd5b505af115801561126d573d6000803e3d6000fd5b505050506040513d602081101561128357600080fd5b5051600880546bffffffffffffffffffffffff166c01000000000000000000000000600160a060020a0393841681029190911791829055600954600a54604080517fae818004000000000000000000000000000000000000000000000000000000008152928616600484015290851660248301528051929093049093169263ae8180049260448083019391928290030181600087803b15801561132557600080fd5b505af1158015611339573d6000803e3d6000fd5b505050506040513d604081101561134f57600080fd5b508051602090910151600f819055600e82905560119190915560125561137361385d565b60105560095461138b90600160a060020a0316610bca565b6009549098506113a390600160a060020a0316612b60565b600a549097506113bb90600160a060020a0316612b60565b9550868814156113e65760008811806113d45750600086115b156113e1576113e1613861565b61140f565b6000881180156113f65750600087115b80156114025750600086115b1561140f5761140f613861565b600454600190600160a060020a03166114266117ac565b61ffff167f6b08c2e2c9969e55a647a764db9b554d64dc42f1a704da11a6d5b129ad163f2c60405160405180910390a450505050505050505050505050565b60008051602061537d83398151915260005260076020527fb2084a3e4595ccf007fb44245853374aaf0de960074375e8e0fb334712e94d0f546601000000000000900460ff1690565b6114b661341b565b6014805460ff19169055565b60006006828154811015156114d357fe5b600091825260209091200154600160a060020a031692915050565b6000816114fa8161339c565b5050600160a060020a031660009081526007602052604090206001015463ffffffff1690565b60008061152e858585612705565b91509150935093915050565b61154261341b565b61154b816121cd565b50565b60006115586138d9565b801561157e57506008546c010000000000000000000000009004600160a060020a031615155b905090565b6008546c010000000000000000000000009004600160a060020a031681565b6000816115ae8161339c565b6115f06115ba84612b60565b600160a060020a0385166000908152600b60205260409020546115e490601363ffffffff61397216565b9063ffffffff6139f616565b9392505050565b600080600080600085600160a060020a03166318160ddd6040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561163d57600080fd5b505af1158015611651573d6000803e3d6000fd5b505050506040513d602081101561166757600080fd5b5051600160a060020a038088166000908152600d602052604090205491955016925061169283612b60565b600160a060020a0384166000908152600b602052604090205490925090506116d0816116c4848763ffffffff61397216565b9063ffffffff613a5316565b9695505050505050565b60035474010000000000000000000000000000000000000000900460ff1681565b61170361341b565b61170b612937565b565b61171561341b565b60048054604080517f5e35359e000000000000000000000000000000000000000000000000000000008152600160a060020a038781169482019490945285841660248201526044810185905290519290911691635e35359e9160648082019260009290919082900301818387803b15801561178f57600080fd5b505af11580156117a3573d6000803e3d6000fd5b50505050505050565b600290565b6117b961341b565b8160136000600660008154811015156117ce57fe5b6000918252602080832090910154600160a060020a031683528201929092526040018120919091556006805483926013929091600190811061180c57fe5b6000918252602080832090910154600160a060020a031683528201929092526040019020555050565b60008054600160a060020a031633148061186a575060035474010000000000000000000000000000000000000000900460ff16155b15156118ae576040805160e560020a62461bcd02815260206004820152601160248201526000805160206153bd833981519152604482015290519081900360640190fd5b6118d77f436f6e7472616374526567697374727900000000000000000000000000000000613589565b600254909150600160a060020a038083169116148015906119005750600160a060020a03811615155b1515611956576040805160e560020a62461bcd02815260206004820152601460248201527f4552525f494e56414c49445f5245474953545259000000000000000000000000604482015290519081900360640190fd5b604080517fbb34534c0000000000000000000000000000000000000000000000000000000081527f436f6e747261637452656769737472790000000000000000000000000000000060048201529051600091600160a060020a0384169163bb34534c9160248082019260209290919082900301818787803b1580156119da57600080fd5b505af11580156119ee573d6000803e3d6000fd5b505050506040513d6020811015611a0457600080fd5b5051600160a060020a03161415611a65576040805160e560020a62461bcd02815260206004820152601460248201527f4552525f494e56414c49445f5245474953545259000000000000000000000000604482015290519081900360640190fd5b6002805460038054600160a060020a03808416600160a060020a0319928316179092559091169216919091179055565b611a9d61341b565b80611aa7816134c8565b5060058054600160a060020a031916600160a060020a0392909216919091179055565b602081565b6000806000806000611adf613ac1565b6003805460a860020a60ff02191660a860020a179055611afd613b23565b87611b078161339c565b87611b1181613b81565b87611b1b81613b81565b600160a060020a038b1660008051602061537d83398151915214611b40573415611b44565b8934145b1515611b9a576040805160e560020a62461bcd02815260206004820152601760248201527f4552525f4554485f414d4f554e545f4d49534d41544348000000000000000000604482015290519081900360640190fd5b611ba2613bd9565b600160a060020a038b1660008051602061537d8339815191521415611c445760008051602061537d83398151915260005260076020527fb2084a3e4595ccf007fb44245853374aaf0de960074375e8e0fb334712e94d0e54611c0a903463ffffffff613c1b16565b60008051602061537d83398151915260005260076020527fb2084a3e4595ccf007fb44245853374aaf0de960074375e8e0fb334712e94d0e555b600160a060020a038b166000908152600b602052604090205460145490975060ff1615611d0d57600160a060020a038b166000908152601360205260409020541580611cb75750600160a060020a038b16600090815260136020526040902054611cb4888c63ffffffff6139f616565b11155b1515611d0d576040805160e560020a62461bcd02815260206004820152601e60248201527f4552525f4d41585f5354414b45445f42414c414e43455f524541434845440000604482015290519081900360640190fd5b600160a060020a03808c166000908152600c602090815260408083205481517f18160ddd00000000000000000000000000000000000000000000000000000000815291519416995089936318160ddd93600480840194938390030190829087803b158015611d7a57600080fd5b505af1158015611d8e573d6000803e3d6000fd5b505050506040513d6020811015611da457600080fd5b50519450600160a060020a038b1660008051602061537d83398151915214611dd257611dd28b33308d613c7b565b600160a060020a038b16600090815260076020526040902054611dfb908b63ffffffff6139f616565b600160a060020a038c16600090815260076020526040902055611e24878b63ffffffff6139f616565b600160a060020a038c166000908152600b60205260408120919091559350861580611e4d575084155b15611e5a57899350611e71565b611e6e876116c48c8863ffffffff61397216565b93505b88841015611ec9576040805160e560020a62461bcd02815260206004820152601260248201527f4552525f52455455524e5f544f4f5f4c4f570000000000000000000000000000604482015290519081900360640190fd5b60048054604080517fc6c3bbe6000000000000000000000000000000000000000000000000000000008152600160a060020a038a811694820194909452336024820152604481018890529051929091169163c6c3bbe69160648082019260009290919082900301818387803b158015611f4157600080fd5b505af1158015611f55573d6000803e3d6000fd5b50505050611f61613861565b600160a060020a038b16337f4a1a2a6176e9646d9e3157f7c2ab3c499f18337c0b0828cfb28e0a61de4a11f78c611f9e8b8263ffffffff6139f616565b611fae8a8a63ffffffff6139f616565b60408051938452602084019290925282820152519081900360600190a3611fe586611fdf878763ffffffff6139f616565b8d613d63565b61203a60066000815481101515611ff857fe5b60009182526020909120015460068054600160a060020a0390921691600190811061201f57fe5b6000918252602082200154600160a060020a03169080613dc3565b50506003805460a860020a60ff021916905550979650505050505050565b600160a060020a039081166000908152600c60205260409020541690565b60085468010000000000000000900463ffffffff1681565b6000612098613ac1565b6003805460a860020a60ff02191660a860020a1790556120b661341b565b6120cd60008051602061539d833981519152613589565b600160a060020a0385166000908152600760205260409020600101549091506601000000000000900460ff16158061210a575061210861154e565b155b806121225750600054600160a060020a038281169116145b1515612166576040805160e560020a62461bcd02815260206004820152601160248201526000805160206153bd833981519152604482015290519081900360640190fd5b612171848484613e2f565b600160a060020a0384166000908152600760205260409020600101546601000000000000900460ff16156121a8576121a884613e60565b50506003805460a860020a60ff02191690555050565b600354600160a060020a031681565b6121d561341b565b60008051602061539d8339815191526121ed81613f54565b60048054604080517ff2fde38b000000000000000000000000000000000000000000000000000000008152600160a060020a03868116948201949094529051929091169163f2fde38b9160248082019260009290919082900301818387803b15801561225857600080fd5b505af115801561226c573d6000803e3d6000fd5b505050505050565b6000806000806000806000806000808b600160a060020a03166318160ddd6040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156122c157600080fd5b505af11580156122d5573d6000803e3d6000fd5b505050506040513d60208110156122eb57600080fd5b5051600160a060020a03808e166000908152600d60209081526040808320549093168252600b905220549098509650878b10156123b657600954600160a060020a03166000908152600b602052604090205461234e90601463ffffffff61397216565b60095490965061236690600160a060020a03166115a2565b9450848610612376578486612379565b85855b9094509250612392886116c48d8a63ffffffff61397216565b91506123a8836116c4848763ffffffff61397216565b9950508881039750886123c0565b9598506000975088955b50505050505050509250929050565b60006123d9613ac1565b6003805460a860020a60ff02191660a860020a1790556123f761341b565b60008051602061537d83398151915261240f8161339c565b61242660008051602061539d833981519152613589565b915061243061154e565b15806124495750600054600160a060020a038381169116145b151561248d576040805160e560020a62461bcd02815260206004820152601160248201526000805160206153bd833981519152604482015290519081900360640190fd5b604051600160a060020a03841690303180156108fc02916000818181858888f193505050501580156124c3573d6000803e3d6000fd5b506124db60008051602061537d833981519152613e60565b50506003805460a860020a60ff021916905550565b6124f861341b565b620186a0811115612553576040805160e560020a62461bcd02815260206004820152601e60248201527f4552525f494e56414c49445f44594e414d49435f4645455f464143544f520000604482015290519081900360640190fd5b601554604080519182526020820183905280517f382fd3516344712a511dcd464ff8e6ab54139d6a28f64087a3253353ee7a56799281900390910190a1601555565b600261259f6126f6565b61ffff16106125e6576040805160e560020a62461bcd02815260206004820152601960248201526000805160206153dd833981519152604482015290519081900360640190fd5b6125f08282613faa565b5050565b600061157e6126f6565b600154600160a060020a0316331461264e576040805160e560020a62461bcd02815260206004820152601160248201526000805160206153bd833981519152604482015290519081900360640190fd5b60015460008054604051600160a060020a0393841693909116917f343765429aea5a34b3ff6a3785a98a5abb2597aca87bfbb58632c173d585373a91a36001805460008054600160a060020a0319908116600160a060020a03841617909155169055565b600254600160a060020a031681565b600054600160a060020a031681565b600854640100000000900463ffffffff1681565b60136020526000908152604090205481565b60065490565b600e54600f5482565b600080600080612713615346565b600080600080612721613b23565b61272a8c61339c565b6127338b61339c565b600160a060020a038c8116908c161415612797576040805160e560020a62461bcd02815260206004820152601660248201527f4552525f53414d455f534f555243455f54415247455400000000000000000000604482015290519081900360640190fd5b61279f61385d565b601054141561284657600e604080519081016040529081600082015481526020016001820154815250509450600760008d600160a060020a0316600160a060020a0316815260200190815260200160002060010160009054906101000a900463ffffffff169650600760008c600160a060020a0316600160a060020a0316815260200190815260200160002060010160009054906101000a900463ffffffff169550612886565b61284e6141dc565b945061285985614420565b6009549195509350600160a060020a038d81169116141561287f57839650829550612886565b8296508395505b6128948c8c8989898f61454a565b919e919d50909b505050505050505050505050565b6128b161341b565b60035460028054600160a060020a031916600160a060020a03909216919091179055565b600181565b6128e261341b565b60008051602061539d8339815191526128fa81613f54565b826129048161339c565b5050600160a060020a039091166000908152600b6020526040902055565b60105481565b600554600160a060020a031681565b60016129416126f6565b61ffff1611612988576040805160e560020a62461bcd02815260206004820152601960248201526000805160206153dd833981519152604482015290519081900360640190fd5b61170b6146e6565b600680548290811061299e57fe5b600091825260209091200154600160a060020a0316905081565b600190565b600454600160a060020a031681565b600154600160a060020a031681565b60006129e561341b565b6129fc60008051602061539d833981519152613589565b600454909150600090600160a060020a0316612a166117ac565b61ffff167f6b08c2e2c9969e55a647a764db9b554d64dc42f1a704da11a6d5b129ad163f2c60405160405180910390a4612a4f816132f4565b604080517f90f58c96000000000000000000000000000000000000000000000000000000008152602060048201529051600160a060020a038316916390f58c9691602480830192600092919082900301818387803b158015612ab057600080fd5b505af1158015612ac4573d6000803e3d6000fd5b5050505061154b6125fe565b601490565b6007602052600090815260409020805460019091015463ffffffff81169060ff640100000000820481169165010000000000810482169166010000000000009091041685565b6000612b2682612b60565b92915050565b600080612b37615346565b612b3f6141dc565b80516020909101519094909350915050565b600a54600160a060020a031681565b600081612b6c8161339c565b5050600160a060020a031660009081526007602052604090205490565b600080600080600080612b9a613ac1565b6003805460a860020a60ff02191660a860020a179055612bb8613b23565b88612bc2816147bb565b88612bcc81613b81565b88612bd681613b81565b612bde613bd9565b8b600160a060020a03166318160ddd6040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015612c1c57600080fd5b505af1158015612c30573d6000803e3d6000fd5b505050506040513d6020811015612c4657600080fd5b50519750612c548c8c612274565b50965089871015612caf576040805160e560020a62461bcd02815260206004820152601260248201527f4552525f52455455524e5f544f4f5f4c4f570000000000000000000000000000604482015290519081900360640190fd5b600d60008d600160a060020a0316600160a060020a0316815260200190815260200160002060009054906101000a9004600160a060020a03169550600460009054906101000a9004600160a060020a0316600160a060020a031663f6b911bc8d338e6040518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183600160a060020a0316600160a060020a031681526020018281526020019350505050600060405180830381600087803b158015612d7c57600080fd5b505af1158015612d90573d6000803e3d6000fd5b505050600160a060020a038716600090815260076020526040902054612dbd91508863ffffffff613c1b16565b600160a060020a038716600090815260076020908152604080832093909355600b90522054612df2908863ffffffff613c1b16565b600160a060020a0387166000818152600b6020526040902082905590955060008051602061537d8339815191521415612e5857604051339088156108fc029089906000818181858888f19350505050158015612e52573d6000803e3d6000fd5b50612e63565b612e6386338961482c565b612e6b613861565b612e7b888c63ffffffff613c1b16565b60408051898152602081018890528082018390529051919550600160a060020a0388169133917fbc7d19d505c7ec4db83f3b51f19fb98c4c8a99922e7839d1ee608dfbee29501b919081900360600190a3612ed78c8588613d63565b612eea60066000815481101515611ff857fe5b50506003805460a860020a60ff0219169055509298975050505050505050565b60155481565b6000612f1a613ac1565b6003805460a860020a60ff02191660a860020a1790557f42616e636f724e6574776f726b00000000000000000000000000000000000000612f5a81613f54565b600160a060020a038781169087161415612fbe576040805160e560020a62461bcd02815260206004820152601660248201527f4552525f53414d455f534f555243455f54415247455400000000000000000000604482015290519081900360640190fd5b600554600160a060020a031615806131015750600554604080517f3af32abf000000000000000000000000000000000000000000000000000000008152600160a060020a03878116600483015291519190921691633af32abf9160248083019260209291908290030181600087803b15801561303957600080fd5b505af115801561304d573d6000803e3d6000fd5b505050506040513d602081101561306357600080fd5b505180156131015750600554604080517f3af32abf000000000000000000000000000000000000000000000000000000008152600160a060020a03868116600483015291519190921691633af32abf9160248083019260209291908290030181600087803b1580156130d457600080fd5b505af11580156130e8573d6000803e3d6000fd5b505050506040513d60208110156130fe57600080fd5b50515b1515613157576040805160e560020a62461bcd02815260206004820152601360248201527f4552525f4e4f545f57484954454c495354454400000000000000000000000000604482015290519081900360640190fd5b61316487878787876148e3565b6003805460a860020a60ff0219169055979650505050505050565b60008061318a615346565b6000806131956141dc565b92506131a083614420565b91509150600660008154811015156131b457fe5b600091825260209091200154600954600160a060020a03908116911614156131e95763ffffffff8083169550811693506131f8565b63ffffffff8082169550821693505b5050509091565b61320761341b565b60085463ffffffff64010000000090910481169082161115613273576040805160e560020a62461bcd02815260206004820152601a60248201527f4552525f494e56414c49445f434f4e56455253494f4e5f464545000000000000604482015290519081900360640190fd5b6008546040805163ffffffff6801000000000000000090930483168152918316602083015280517f81cd2ffb37dd237c0e4e2a3de5265fcf9deb43d3e7801e80db9f1ccfba7ee6009281900390910190a16008805463ffffffff90921668010000000000000000026bffffffff000000000000000019909216919091179055565b6132fc61341b565b600054600160a060020a0382811691161415613362576040805160e560020a62461bcd02815260206004820152600e60248201527f4552525f53414d455f4f574e4552000000000000000000000000000000000000604482015290519081900360640190fd5b60018054600160a060020a031916600160a060020a0392909216919091179055565b60115460125482565b600454600160a060020a031690565b600160a060020a0381166000908152600760205260409020600101546601000000000000900460ff16151561154b576040805160e560020a62461bcd02815260206004820152601360248201527f4552525f494e56414c49445f5245534552564500000000000000000000000000604482015290519081900360640190fd5b600054600160a060020a0316331461170b576040805160e560020a62461bcd02815260206004820152601160248201526000805160206153bd833981519152604482015290519081900360640190fd5b61347361154e565b1561170b576040805160e560020a62461bcd02815260206004820152600a60248201527f4552525f41435449564500000000000000000000000000000000000000000000604482015290519081900360640190fd5b600160a060020a03811630141561154b576040805160e560020a62461bcd02815260206004820152601360248201527f4552525f414444524553535f49535f53454c4600000000000000000000000000604482015290519081900360640190fd5b600160a060020a038116151561154b576040805160e560020a62461bcd02815260206004820152601360248201527f4552525f494e56414c49445f4144445245535300000000000000000000000000604482015290519081900360640190fd5b600254604080517fbb34534c000000000000000000000000000000000000000000000000000000008152600481018490529051600092600160a060020a03169163bb34534c91602480830192602092919082900301818787803b1580156135ef57600080fd5b505af1158015613603573d6000803e3d6000fd5b505050506040513d602081101561361957600080fd5b505192915050565b60006060600080600080600460009054906101000a9004600160a060020a0316955085600160a060020a0316636d3e313e6040518163ffffffff1660e060020a028152600401600060405180830381600087803b15801561368157600080fd5b505af1158015613695573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405260208110156136be57600080fd5b8101908080516401000000008111156136d657600080fd5b820160208101848111156136e957600080fd5b815185602082028301116401000000008211171561370657600080fd5b505080516006549199501597509550600094505050505b8282101561226c57831561379c5785600160a060020a0316639cbf9e366040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561376957600080fd5b505af115801561377d573d6000803e3d6000fd5b505050506040513d602081101561379357600080fd5b505190506137b7565b84828151811015156137aa57fe5b9060200190602002015190505b80600c60006006858154811015156137cb57fe5b600091825260208083209190910154600160a060020a03908116845290830193909352604090910190208054600160a060020a03191692909116919091179055600680548390811061381957fe5b6000918252602080832090910154600160a060020a038481168452600d90925260409092208054600160a060020a031916919092161790556001919091019061371d565b4290565b60408051808201909152600e548152600f546020820152600090819061388690614420565b600954600160a060020a039081166000908152600760205260408082206001908101805463ffffffff97881663ffffffff1991821617909155600a54909416835291200180549290931691161790555050565b60048054604080517f8da5cb5b00000000000000000000000000000000000000000000000000000000815290516000933093600160a060020a031692638da5cb5b928183019260209282900301818887803b15801561393757600080fd5b505af115801561394b573d6000803e3d6000fd5b505050506040513d602081101561396157600080fd5b5051600160a060020a031614905090565b60008083151561398557600091506139ef565b5082820282848281151561399557fe5b04146139eb576040805160e560020a62461bcd02815260206004820152600c60248201527f4552525f4f564552464c4f570000000000000000000000000000000000000000604482015290519081900360640190fd5b8091505b5092915050565b6000828201838110156139eb576040805160e560020a62461bcd02815260206004820152600c60248201527f4552525f4f564552464c4f570000000000000000000000000000000000000000604482015290519081900360640190fd5b600080808311613aad576040805160e560020a62461bcd02815260206004820152601260248201527f4552525f4449564944455f42595f5a45524f0000000000000000000000000000604482015290519081900360640190fd5b8284811515613ab857fe5b04949350505050565b60035460a860020a900460ff161561170b576040805160e560020a62461bcd02815260206004820152600e60248201527f4552525f5245454e5452414e4359000000000000000000000000000000000000604482015290519081900360640190fd5b613b2b61154e565b151561170b576040805160e560020a62461bcd02815260206004820152600c60248201527f4552525f494e4143544956450000000000000000000000000000000000000000604482015290519081900360640190fd5b6000811161154b576040805160e560020a62461bcd02815260206004820152600e60248201527f4552525f5a45524f5f56414c5545000000000000000000000000000000000000604482015290519081900360640190fd5b60065460005b818110156125f057613c13600682815481101515613bf957fe5b600091825260209091200154600160a060020a0316613e60565b600101613bdf565b600081831015613c75576040805160e560020a62461bcd02815260206004820152600d60248201527f4552525f554e444552464c4f5700000000000000000000000000000000000000604482015290519081900360640190fd5b50900390565b604080517f7472616e7366657246726f6d28616464726573732c616464726573732c75696e81527f74323536290000000000000000000000000000000000000000000000000000006020808301919091528251918290036025018220600160a060020a038088166024850152861660448401526064808401869052845180850390910181526084909301909352810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1990931692909217909152613d5d9085906149d6565b50505050565b600160a060020a038082166000818152600b6020908152604091829020548251908152908101869052815192938716927f77f29993cf2c084e726f7e802da0719d6a0ade3e204badc7a3ffd57ecb768c24929181900390910190a3505050565b613dcb615346565b613dd785858585614a64565b805160208083015160408051938452918301528051929350600160a060020a0380881693908916927f77f29993cf2c084e726f7e802da0719d6a0ade3e204badc7a3ffd57ecb768c2492908290030190a35050505050565b613e3761341b565b82613e4181613529565b82613e4b81613529565b83613e55816134c8565b61226c86868661482c565b80613e6a8161339c565b600160a060020a03821660008051602061537d8339815191521415613eaa57600160a060020a0382166000908152600760205260409020303190556125f0565b604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600160a060020a038416916370a082319160248083019260209291908290030181600087803b158015613f0b57600080fd5b505af1158015613f1f573d6000803e3d6000fd5b505050506040513d6020811015613f3557600080fd5b5051600160a060020a0383166000908152600760205260409020555050565b613f5d81613589565b600160a060020a0316331461154b576040805160e560020a62461bcd02815260206004820152601160248201526000805160206153bd833981519152604482015290519081900360640190fd5b6000613fb461341b565b613fbc61346b565b82613fc681613529565b83613fd0816134c8565b83613fda81614b2c565b600454600160a060020a0387811691161480159061401e5750600160a060020a0386166000908152600760205260409020600101546601000000000000900460ff16155b1515614074576040805160e560020a62461bcd02815260206004820152601360248201527f4552525f494e56414c49445f5245534552564500000000000000000000000000604482015290519081900360640190fd5b60085463ffffffff908116620f424003811690861611156140df576040805160e560020a62461bcd02815260206004820152601a60248201527f4552525f494e56414c49445f524553455256455f574549474854000000000000604482015290519081900360640190fd5b61ffff6140ea6126f6565b61ffff1610614131576040805160e560020a62461bcd02815260206004820152601960248201526000805160206153dd833981519152604482015290519081900360640190fd5b505050600160a060020a0390921660008181526007602052604081208181556001908101805466ff0000000000001963ffffffff80881663ffffffff1993841617919091166601000000000000179092556006805493840181559093527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f9091018054600160a060020a03191690931790925560088054808416909401909216921691909117905550565b6141e4615346565b6000806000806141f2615346565b6141fa615346565b600854600954600a54604080517fb1772d7a000000000000000000000000000000000000000000000000000000008152600160a060020a0393841660048201529183166024830152516000938493849384936c010000000000000000000000009093049091169163b1772d7a9160448082019260609290919082900301818787803b15801561428857600080fd5b505af115801561429c573d6000803e3d6000fd5b505050506040513d60608110156142b257600080fd5b5080516020820151604090920151601054919c50919a509098508811156142ef5760408051908101604052808b81526020018a8152509a50614413565b6010546142fa61385d565b0396508615156143225760408051808201909152600e548152600f5460208201529a50614413565b61025887106143495760408051808201909152601154815260125460208201529a50614413565b604080518082018252600e548152600f54602080830191825283518085019094526011548085526012549185019190915290519198509196506143919163ffffffff61397216565b602086015187519195506143ab919063ffffffff61397216565b92506143d56143c0858963ffffffff61397216565b6115e4856102588b900363ffffffff61397216565b91506144046102586143f88760200151896020015161397290919063ffffffff16565b9063ffffffff61397216565b90506144108282614ba1565b9a505b5050505050505050505090565b600954600160a060020a03166000818152600b602052604081205490918291908290819061444d906115a2565b600a5490925061446590600160a060020a03166115a2565b90506144907f42616e636f72466f726d756c6100000000000000000000000000000000000000613589565b600160a060020a031663a11aa1b46144af85601463ffffffff61397216565b885160208a01516040805160e060020a63ffffffff87160281526004810194909452602484018890526044840187905260648401929092526084830152805160a4808401938290030181600087803b15801561450a57600080fd5b505af115801561451e573d6000803e3d6000fd5b505050506040513d604081101561453457600080fd5b5080516020909101519095509350505050915091565b60008080808063ffffffff8916151561458257600160a060020a038b1660009081526007602052604090206001015463ffffffff1698505b63ffffffff881615156145b457600160a060020a038a1660009081526007602052604090206001015463ffffffff1697505b6145bd8b6115a2565b91506145c88a6115a2565b90506145f37f42616e636f72466f726d756c6100000000000000000000000000000000000000613589565b604080517f94491fab0000000000000000000000000000000000000000000000000000000081526004810185905263ffffffff808d166024830152604482018590528b166064820152608481018990529051600160a060020a0392909216916394491fab9160a4808201926020929091908290030181600087803b15801561467a57600080fd5b505af115801561468e573d6000803e3d6000fd5b505050506040513d60208110156146a457600080fd5b505194506146b185614bf6565b93506146c4846115e48c8c8c8c8b614c26565b92506146d6858463ffffffff613c1b16565b9450505096509650969350505050565b6146ee61341b565b60006146f86126f6565b61ffff161161473f576040805160e560020a62461bcd02815260206004820152601960248201526000805160206153dd833981519152604482015290519081900360640190fd5b60048054604080517f79ba50970000000000000000000000000000000000000000000000000000000081529051600160a060020a03909216926379ba509792828201926000929082900301818387803b15801561479b57600080fd5b505af11580156147af573d6000803e3d6000fd5b5050505061170b613bd9565b600160a060020a038181166000908152600d602052604090205416151561154b576040805160e560020a62461bcd02815260206004820152601660248201527f4552525f494e56414c49445f504f4f4c5f544f4b454e00000000000000000000604482015290519081900360640190fd5b604080517f7472616e7366657228616464726573732c75696e74323536290000000000000081528151908190036019018120600160a060020a038516602483015260448083018590528351808403909101815260649092019092526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19909316929092179091526148de9084906149d6565b505050565b60008060006148f0613b23565b876148fa8161339c565b876149048161339c565b61490f8a8a8a614cff565b9094509250600160a060020a03891660008051602061537d833981519152141561496f57604051600160a060020a0387169085156108fc029086906000818181858888f19350505050158015614969573d6000803e3d6000fd5b5061497a565b61497a89878661482c565b6149888a8a898b8888615014565b600160a060020a03808b16600090815260076020526040808220600190810154938d168352912001546149c8918c918c9163ffffffff9081169116615099565b509198975050505050505050565b6149de61535d565b602060405190810160405280600181525090506020818351602085016000875af1801515614a0b57600080fd5b50805115156148de576040805160e560020a62461bcd02815260206004820152601360248201527f4552525f5452414e534645525f4641494c454400000000000000000000000000604482015290519081900360640190fd5b614a6c615346565b600080614a78876115a2565b9150614a83866115a2565b905063ffffffff85161515614ab757600160a060020a03871660009081526007602052604090206001015463ffffffff1694505b63ffffffff84161515614ae957600160a060020a03861660009081526007602052604090206001015463ffffffff1693505b6040805180820190915280614b078363ffffffff808a169061397216565b8152602001614b1f8463ffffffff8089169061397216565b9052979650505050505050565b60008163ffffffff16118015614b4b5750620f424063ffffffff821611155b151561154b576040805160e560020a62461bcd02815260206004820152601a60248201527f4552525f494e56414c49445f524553455256455f574549474854000000000000604482015290519081900360640190fd5b614ba9615346565b614bb1615346565b828410614bc957614bc2848461512a565b91506139ef565b614bd3838561512a565b604080518082019091526020808301518252825190820152925090505092915050565b600854600090612b2690620f4240906116c490859068010000000000000000900463ffffffff9081169061397216565b600a546000908190600160a060020a0388811691161415614c9457600954600160a060020a039081166000908152600b6020908152604080832054600a54909416835290912054865191870151601554614c8d949363ffffffff808d1693908c16926151e7565b9050614ce3565b600954600160a060020a039081166000908152600b6020908152604080832054600a54909416835290912054865191870151601554614ce0949363ffffffff808c1693908d16926151e7565b90505b614cf4620f42406116c48584613972565b979650505050505050565b6000806000614d0c615346565b600080600080614d1a615253565b95509550614d2d8b8b600080898e61454a565b91955093509150831515614d8b576040805160e560020a62461bcd02815260206004820152601660248201527f4552525f5a45524f5f5441524745545f414d4f554e5400000000000000000000604482015290519081900360640190fd5b614d948a612b60565b9050808410614ded576040805160e560020a62461bcd02815260206004820152601a60248201527f4552525f5441524745545f414d4f554e545f544f4f5f48494748000000000000604482015290519081900360640190fd5b600160a060020a038b1660008051602061537d8339815191521415614e6857348914614e63576040805160e560020a62461bcd02815260206004820152601760248201527f4552525f4554485f414d4f554e545f4d49534d41544348000000000000000000604482015290519081900360640190fd5b614f6a565b34158015614f14575088614f11614e7e8d612b60565b8d600160a060020a03166370a08231306040518263ffffffff1660e060020a0281526004018082600160a060020a0316600160a060020a03168152602001915050602060405180830381600087803b158015614ed957600080fd5b505af1158015614eed573d6000803e3d6000fd5b505050506040513d6020811015614f0357600080fd5b50519063ffffffff613c1b16565b10155b1515614f6a576040805160e560020a62461bcd02815260206004820152601260248201527f4552525f494e56414c49445f414d4f554e540000000000000000000000000000604482015290519081900360640190fd5b614f738b613e60565b614f83818563ffffffff613c1b16565b600160a060020a038b16600090815260076020908152604080832093909355600b90522054614fb8908463ffffffff6139f616565b600160a060020a038b166000908152600b6020526040902055851561500357600954600a54614ff691600160a060020a039081169116600080614a64565b8051601155602001516012555b509199919850909650505050505050565b7f8000000000000000000000000000000000000000000000000000000000000000811061503d57fe5b60408051848152602081018490528082018390529051600160a060020a038087169288821692918a16917f276856b36cbc45526a0ba64f44611557a2a8b68662c5388e9fe6d72e86e1c8cb9181900360600190a4505050505050565b6000806150a886868686613dc3565b6150b185612058565b915081600160a060020a03166318160ddd6040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156150f157600080fd5b505af1158015615105573d6000803e3d6000fd5b505050506040513d602081101561511b57600080fd5b5051905061226c828287613d63565b615132615346565b7314484bfeebc29f863424b06f3529a051a31be59982111561518457604080518082019091526c0c9f2c9cd04674edea40000000808252602082019085048481151561517a57fe5b0490529050612b26565b6c0c9f2c9cd04674edea400000008311156151d15760408051908101604052806c0c9f2c9cd04674edea400000008152602001846c0c9f2c9cd04674edea40000000850281151561517a57fe5b5060408051808201909152918252602082015290565b600080806151ff876143f88c8963ffffffff61397216565b9150615215886143f88b8863ffffffff61397216565b9050818111156152415761523a816116c460146143f88684038963ffffffff61397216565b9250615246565b600092505b5050979650505050505050565b600061525d615346565b6000615267615346565b61526f615346565b61527761385d565b92508260105414156152a55760408051808201909152600e548152600f5460208201526000955093506131f8565b6152ad6141dc565b60408051808201909152600e54808252600f54602083015282519294509092501480156152e1575080602001518260200151145b156152f257600082945094506131f8565b8151600e556020820151600f55601083905561530c613861565b50600194909350915050565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915290565b604080518082019091526000808252602082015290565b60206040519081016040528060019060208202803883395091929150505600000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee42616e636f72436f6e76657274657255706772616465720000000000000000004552525f4143434553535f44454e4945440000000000000000000000000000004552525f494e56414c49445f524553455256455f434f554e5400000000000000a165627a7a72305820cd028822e85720014bd54bb8a0a251799c06e384b59fc14a193a9cce159697090029
Verified Source Code Partial Match
Compiler: v0.4.26+commit.4563c3fc
EVM: byzantium
Optimization: Yes (200 runs)
LiquidityPoolV2Converter.sol 3059 lines
// File: solidity/contracts/utility/interfaces/IOwned.sol
pragma solidity 0.4.26;
/*
Owned contract interface
*/
contract IOwned {
// this function isn't abstract since the compiler emits automatically generated getter functions as external
function owner() public view returns (address) {this;}
function transferOwnership(address _newOwner) public;
function acceptOwnership() public;
}
// File: solidity/contracts/token/interfaces/IERC20Token.sol
pragma solidity 0.4.26;
/*
ERC20 Standard Token interface
*/
contract IERC20Token {
// these functions aren't abstract since the compiler emits automatically generated getter functions as external
function name() public view returns (string) {this;}
function symbol() public view returns (string) {this;}
function decimals() public view returns (uint8) {this;}
function totalSupply() public view returns (uint256) {this;}
function balanceOf(address _owner) public view returns (uint256) {_owner; this;}
function allowance(address _owner, address _spender) public view returns (uint256) {_owner; _spender; this;}
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);
}
// File: solidity/contracts/utility/interfaces/ITokenHolder.sol
pragma solidity 0.4.26;
/*
Token Holder interface
*/
contract ITokenHolder is IOwned {
function withdrawTokens(IERC20Token _token, address _to, uint256 _amount) public;
}
// File: solidity/contracts/converter/interfaces/IConverterAnchor.sol
pragma solidity 0.4.26;
/*
Converter Anchor interface
*/
contract IConverterAnchor is IOwned, ITokenHolder {
}
// File: solidity/contracts/token/interfaces/ISmartToken.sol
pragma solidity 0.4.26;
/*
Smart Token interface
*/
contract ISmartToken is IConverterAnchor, IERC20Token {
function disableTransfers(bool _disable) public;
function issue(address _to, uint256 _amount) public;
function destroy(address _from, uint256 _amount) public;
}
// File: solidity/contracts/converter/types/liquidity-pool-v2/interfaces/IPoolTokensContainer.sol
pragma solidity 0.4.26;
/*
Pool Tokens Container interface
*/
contract IPoolTokensContainer is IConverterAnchor {
function poolTokens() public view returns (ISmartToken[]);
function createToken() public returns (ISmartToken);
function mint(ISmartToken _token, address _to, uint256 _amount) public;
function burn(ISmartToken _token, address _from, uint256 _amount) public;
}
// File: solidity/contracts/utility/Owned.sol
pragma solidity 0.4.26;
/**
* @dev Provides support and utilities for contract ownership
*/
contract Owned is IOwned {
address public owner;
address public newOwner;
/**
* @dev triggered when the owner is updated
*
* @param _prevOwner previous owner
* @param _newOwner new owner
*/
event OwnerUpdate(address indexed _prevOwner, address indexed _newOwner);
/**
* @dev initializes a new Owned instance
*/
constructor() public {
owner = msg.sender;
}
// allows execution by the owner only
modifier ownerOnly {
_ownerOnly();
_;
}
// error message binary size optimization
function _ownerOnly() internal view {
require(msg.sender == owner, "ERR_ACCESS_DENIED");
}
/**
* @dev allows transferring the contract ownership
* the new owner still needs to accept the transfer
* can only be called by the contract owner
*
* @param _newOwner new contract owner
*/
function transferOwnership(address _newOwner) public ownerOnly {
require(_newOwner != owner, "ERR_SAME_OWNER");
newOwner = _newOwner;
}
/**
* @dev used by a new owner to accept an ownership transfer
*/
function acceptOwnership() public {
require(msg.sender == newOwner, "ERR_ACCESS_DENIED");
emit OwnerUpdate(owner, newOwner);
owner = newOwner;
newOwner = address(0);
}
}
// File: solidity/contracts/utility/Utils.sol
pragma solidity 0.4.26;
/**
* @dev Utilities & Common Modifiers
*/
contract Utils {
// verifies that a value is greater than zero
modifier greaterThanZero(uint256 _value) {
_greaterThanZero(_value);
_;
}
// error message binary size optimization
function _greaterThanZero(uint256 _value) internal pure {
require(_value > 0, "ERR_ZERO_VALUE");
}
// validates an address - currently only checks that it isn't null
modifier validAddress(address _address) {
_validAddress(_address);
_;
}
// error message binary size optimization
function _validAddress(address _address) internal pure {
require(_address != address(0), "ERR_INVALID_ADDRESS");
}
// verifies that the address is different than this contract address
modifier notThis(address _address) {
_notThis(_address);
_;
}
// error message binary size optimization
function _notThis(address _address) internal view {
require(_address != address(this), "ERR_ADDRESS_IS_SELF");
}
}
// File: solidity/contracts/utility/TokenHandler.sol
pragma solidity 0.4.26;
contract TokenHandler {
bytes4 private constant APPROVE_FUNC_SELECTOR = bytes4(keccak256("approve(address,uint256)"));
bytes4 private constant TRANSFER_FUNC_SELECTOR = bytes4(keccak256("transfer(address,uint256)"));
bytes4 private constant TRANSFER_FROM_FUNC_SELECTOR = bytes4(keccak256("transferFrom(address,address,uint256)"));
/**
* @dev executes the ERC20 token's `approve` function and reverts upon failure
* the main purpose of this function is to prevent a non standard ERC20 token
* from failing silently
*
* @param _token ERC20 token address
* @param _spender approved address
* @param _value allowance amount
*/
function safeApprove(IERC20Token _token, address _spender, uint256 _value) internal {
execute(_token, abi.encodeWithSelector(APPROVE_FUNC_SELECTOR, _spender, _value));
}
/**
* @dev executes the ERC20 token's `transfer` function and reverts upon failure
* the main purpose of this function is to prevent a non standard ERC20 token
* from failing silently
*
* @param _token ERC20 token address
* @param _to target address
* @param _value transfer amount
*/
function safeTransfer(IERC20Token _token, address _to, uint256 _value) internal {
execute(_token, abi.encodeWithSelector(TRANSFER_FUNC_SELECTOR, _to, _value));
}
/**
* @dev executes the ERC20 token's `transferFrom` function and reverts upon failure
* the main purpose of this function is to prevent a non standard ERC20 token
* from failing silently
*
* @param _token ERC20 token address
* @param _from source address
* @param _to target address
* @param _value transfer amount
*/
function safeTransferFrom(IERC20Token _token, address _from, address _to, uint256 _value) internal {
execute(_token, abi.encodeWithSelector(TRANSFER_FROM_FUNC_SELECTOR, _from, _to, _value));
}
/**
* @dev executes a function on the ERC20 token and reverts upon failure
* the main purpose of this function is to prevent a non standard ERC20 token
* from failing silently
*
* @param _token ERC20 token address
* @param _data data to pass in to the token's contract for execution
*/
function execute(IERC20Token _token, bytes memory _data) private {
uint256[1] memory ret = [uint256(1)];
assembly {
let success := call(
gas, // gas remaining
_token, // destination address
0, // no ether
add(_data, 32), // input buffer (starts after the first 32 bytes in the `data` array)
mload(_data), // input length (loaded from the first 32 bytes in the `data` array)
ret, // output buffer
32 // output length
)
if iszero(success) {
revert(0, 0)
}
}
require(ret[0] != 0, "ERR_TRANSFER_FAILED");
}
}
// File: solidity/contracts/utility/TokenHolder.sol
pragma solidity 0.4.26;
/**
* @dev We consider every contract to be a 'token holder' since it's currently not possible
* for a contract to deny receiving tokens.
*
* The TokenHolder's contract sole purpose is to provide a safety mechanism that allows
* the owner to send tokens that were sent to the contract by mistake back to their sender.
*
* Note that we use the non standard ERC-20 interface which has no return value for transfer
* in order to support both non standard as well as standard token contracts.
* see https://github.com/ethereum/solidity/issues/4116
*/
contract TokenHolder is ITokenHolder, TokenHandler, Owned, Utils {
/**
* @dev withdraws tokens held by the contract and sends them to an account
* can only be called by the owner
*
* @param _token ERC20 token contract address
* @param _to account to receive the new amount
* @param _amount amount to withdraw
*/
function withdrawTokens(IERC20Token _token, address _to, uint256 _amount)
public
ownerOnly
validAddress(_token)
validAddress(_to)
notThis(_to)
{
safeTransfer(_token, _to, _amount);
}
}
// File: solidity/contracts/utility/SafeMath.sol
pragma solidity 0.4.26;
/**
* @dev Library for basic math operations with overflow/underflow protection
*/
library SafeMath {
/**
* @dev returns the sum of _x and _y, reverts if the calculation overflows
*
* @param _x value 1
* @param _y value 2
*
* @return sum
*/
function add(uint256 _x, uint256 _y) internal pure returns (uint256) {
uint256 z = _x + _y;
require(z >= _x, "ERR_OVERFLOW");
return z;
}
/**
* @dev returns the difference of _x minus _y, reverts if the calculation underflows
*
* @param _x minuend
* @param _y subtrahend
*
* @return difference
*/
function sub(uint256 _x, uint256 _y) internal pure returns (uint256) {
require(_x >= _y, "ERR_UNDERFLOW");
return _x - _y;
}
/**
* @dev returns the product of multiplying _x by _y, reverts if the calculation overflows
*
* @param _x factor 1
* @param _y factor 2
*
* @return product
*/
function mul(uint256 _x, uint256 _y) internal pure returns (uint256) {
// gas optimization
if (_x == 0)
return 0;
uint256 z = _x * _y;
require(z / _x == _y, "ERR_OVERFLOW");
return z;
}
/**
* @dev Integer division of two numbers truncating the quotient, reverts on division by zero.
*
* @param _x dividend
* @param _y divisor
*
* @return quotient
*/
function div(uint256 _x, uint256 _y) internal pure returns (uint256) {
require(_y > 0, "ERR_DIVIDE_BY_ZERO");
uint256 c = _x / _y;
return c;
}
}
// File: solidity/contracts/token/ERC20Token.sol
pragma solidity 0.4.26;
/**
* @dev ERC20 Standard Token implementation
*/
contract ERC20Token is IERC20Token, Utils {
using SafeMath for uint256;
string public name;
string public symbol;
uint8 public decimals;
uint256 public totalSupply;
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
/**
* @dev triggered when tokens are transferred between wallets
*
* @param _from source address
* @param _to target address
* @param _value transfer amount
*/
event Transfer(address indexed _from, address indexed _to, uint256 _value);
/**
* @dev triggered when a wallet allows another wallet to transfer tokens from on its behalf
*
* @param _owner wallet that approves the allowance
* @param _spender wallet that receives the allowance
* @param _value allowance amount
*/
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
/**
* @dev initializes a new ERC20Token instance
*
* @param _name token name
* @param _symbol token symbol
* @param _decimals decimal points, for display purposes
* @param _totalSupply total supply of token units
*/
constructor(string _name, string _symbol, uint8 _decimals, uint256 _totalSupply) public {
// validate input
require(bytes(_name).length > 0, "ERR_INVALID_NAME");
require(bytes(_symbol).length > 0, "ERR_INVALID_SYMBOL");
name = _name;
symbol = _symbol;
decimals = _decimals;
totalSupply = _totalSupply;
balanceOf[msg.sender] = _totalSupply;
}
/**
* @dev transfers tokens to a given address
* throws on any error rather then return a false flag to minimize user errors
*
* @param _to target address
* @param _value transfer amount
*
* @return true if the transfer was successful, false if it wasn't
*/
function transfer(address _to, uint256 _value)
public
validAddress(_to)
returns (bool success)
{
balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value);
balanceOf[_to] = balanceOf[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev transfers tokens to a given address on behalf of another address
* throws on any error rather then return a false flag to minimize user errors
*
* @param _from source address
* @param _to target address
* @param _value transfer amount
*
* @return true if the transfer was successful, false if it wasn't
*/
function transferFrom(address _from, address _to, uint256 _value)
public
validAddress(_from)
validAddress(_to)
returns (bool success)
{
allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value);
balanceOf[_from] = balanceOf[_from].sub(_value);
balanceOf[_to] = balanceOf[_to].add(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev allows another account/contract to transfers tokens on behalf of the caller
* throws on any error rather then return a false flag to minimize user errors
*
* also, to minimize the risk of the approve/transferFrom attack vector
* (see https://docs.google.com/document/d/1YLPtQxZu1UAvO9cZ1O2RPXBbT0mooh4DYKjA_jp-RLM/), approve has to be called twice
* in 2 separate transactions - once to change the allowance to 0 and secondly to change it to the new allowance value
*
* @param _spender approved address
* @param _value allowance amount
*
* @return true if the approval was successful, false if it wasn't
*/
function approve(address _spender, uint256 _value)
public
validAddress(_spender)
returns (bool success)
{
// if the allowance isn't 0, it can only be updated to 0 to prevent an allowance change immediately after withdrawal
require(_value == 0 || allowance[msg.sender][_spender] == 0, "ERR_INVALID_AMOUNT");
allowance[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
}
// File: solidity/contracts/token/SmartToken.sol
pragma solidity 0.4.26;
/**
* @dev Smart Token
*
* 'Owned' is specified here for readability reasons
*/
contract SmartToken is ISmartToken, Owned, ERC20Token, TokenHolder {
using SafeMath for uint256;
uint16 public constant version = 4;
bool public transfersEnabled = true; // true if transfer/transferFrom are enabled, false otherwise
/**
* @dev triggered when the total supply is increased
*
* @param _amount amount that gets added to the supply
*/
event Issuance(uint256 _amount);
/**
* @dev triggered when the total supply is decreased
*
* @param _amount amount that gets removed from the supply
*/
event Destruction(uint256 _amount);
/**
* @dev initializes a new SmartToken instance
*
* @param _name token name
* @param _symbol token short symbol, minimum 1 character
* @param _decimals for display purposes only
*/
constructor(string _name, string _symbol, uint8 _decimals)
public
ERC20Token(_name, _symbol, _decimals, 0)
{
}
// allows execution only when transfers are enabled
modifier transfersAllowed {
_transfersAllowed();
_;
}
// error message binary size optimization
function _transfersAllowed() internal view {
require(transfersEnabled, "ERR_TRANSFERS_DISABLED");
}
/**
* @dev disables/enables transfers
* can only be called by the contract owner
*
* @param _disable true to disable transfers, false to enable them
*/
function disableTransfers(bool _disable) public ownerOnly {
transfersEnabled = !_disable;
}
/**
* @dev increases the token supply and sends the new tokens to the given account
* can only be called by the contract owner
*
* @param _to account to receive the new amount
* @param _amount amount to increase the supply by
*/
function issue(address _to, uint256 _amount)
public
ownerOnly
validAddress(_to)
notThis(_to)
{
totalSupply = totalSupply.add(_amount);
balanceOf[_to] = balanceOf[_to].add(_amount);
emit Issuance(_amount);
emit Transfer(address(0), _to, _amount);
}
/**
* @dev removes tokens from the given account and decreases the token supply
* can only be called by the contract owner
*
* @param _from account to remove the amount from
* @param _amount amount to decrease the supply by
*/
function destroy(address _from, uint256 _amount) public ownerOnly {
balanceOf[_from] = balanceOf[_from].sub(_amount);
totalSupply = totalSupply.sub(_amount);
emit Transfer(_from, address(0), _amount);
emit Destruction(_amount);
}
// ERC20 standard method overrides with some extra functionality
/**
* @dev send coins
* throws on any error rather then return a false flag to minimize user errors
* in addition to the standard checks, the function throws if transfers are disabled
*
* @param _to target address
* @param _value transfer amount
*
* @return true if the transfer was successful, false if it wasn't
*/
function transfer(address _to, uint256 _value) public transfersAllowed returns (bool success) {
assert(super.transfer(_to, _value));
return true;
}
/**
* @dev an account/contract attempts to get the coins
* throws on any error rather then return a false flag to minimize user errors
* in addition to the standard checks, the function throws if transfers are disabled
*
* @param _from source address
* @param _to target address
* @param _value transfer amount
*
* @return true if the transfer was successful, false if it wasn't
*/
function transferFrom(address _from, address _to, uint256 _value) public transfersAllowed returns (bool success) {
assert(super.transferFrom(_from, _to, _value));
return true;
}
}
// File: solidity/contracts/converter/types/liquidity-pool-v2/PoolTokensContainer.sol
pragma solidity 0.4.26;
/**
* @dev The PoolTokensContainer contract serves as a container for multiple pool tokens.
* It is used by specific liquidity pool types that require more than a single pool token,
* while still maintaining the single converter / anchor relationship.
*
* It maintains and provides a list of the underlying pool tokens.
*/
contract PoolTokensContainer is IPoolTokensContainer, Owned, TokenHolder {
uint8 internal constant MAX_POOL_TOKENS = 5; // maximum pool tokens in the container
string public name; // pool name
string public symbol; // pool symbol
uint8 public decimals; // underlying pool tokens decimals
ISmartToken[] private _poolTokens; // underlying pool tokens
/**
* @dev initializes a new PoolTokensContainer instance
*
* @param _name pool name, also used as a prefix for the underlying pool token names
* @param _symbol pool symbol, also used as a prefix for the underlying pool token symbols
* @param _decimals used for the underlying pool token decimals
*/
constructor(string _name, string _symbol, uint8 _decimals) public {
// validate input
require(bytes(_name).length > 0, "ERR_INVALID_NAME");
require(bytes(_symbol).length > 0, "ERR_INVALID_SYMBOL");
name = _name;
symbol = _symbol;
decimals = _decimals;
}
/**
* @dev returns the list of pool tokens
*
* @return list of pool tokens
*/
function poolTokens() public view returns (ISmartToken[] memory) {
return _poolTokens;
}
/**
* @dev creates a new pool token and adds it to the list
*
* @return new pool token address
*/
function createToken() public ownerOnly returns (ISmartToken) {
// verify that the max limit wasn't reached
require(_poolTokens.length < MAX_POOL_TOKENS, "ERR_MAX_LIMIT_REACHED");
string memory poolName = concatStrDigit(name, uint8(_poolTokens.length + 1));
string memory poolSymbol = concatStrDigit(symbol, uint8(_poolTokens.length + 1));
SmartToken token = new SmartToken(poolName, poolSymbol, decimals);
_poolTokens.push(token);
return token;
}
/**
* @dev increases the pool token supply and sends the new tokens to the given account
* can only be called by the contract owner
*
* @param _token pool token address
* @param _to account to receive the newly minted tokens
* @param _amount amount to mint
*/
function mint(ISmartToken _token, address _to, uint256 _amount) public ownerOnly {
_token.issue(_to, _amount);
}
/**
* @dev removes tokens from the given account and decreases the pool token supply
* can only be called by the contract owner
*
* @param _token pool token address
* @param _from account to remove the tokens from
* @param _amount amount to burn
*/
function burn(ISmartToken _token, address _from, uint256 _amount) public ownerOnly {
_token.destroy(_from, _amount);
}
/**
* @dev concatenates a string and a digit (single only) and returns the result string
*
* @param _str string
* @param _digit digit
* @return concatenated string
*/
function concatStrDigit(string _str, uint8 _digit) private pure returns (string) {
return string(abi.encodePacked(_str, uint8(bytes1('0')) + _digit));
}
}
// File: solidity/contracts/converter/interfaces/ITypedConverterCustomFactory.sol
pragma solidity 0.4.26;
/*
Typed Converter Custom Factory interface
*/
contract ITypedConverterCustomFactory {
function converterType() public pure returns (uint16);
}
// File: solidity/contracts/utility/interfaces/IChainlinkPriceOracle.sol
pragma solidity 0.4.26;
/*
Chainlink Price Oracle interface
*/
interface IChainlinkPriceOracle {
function latestAnswer() external view returns (int256);
function latestTimestamp() external view returns (uint256);
}
// File: solidity/contracts/utility/interfaces/IPriceOracle.sol
pragma solidity 0.4.26;
/*
Price Oracle interface
*/
contract IPriceOracle {
function latestRate(IERC20Token _tokenA, IERC20Token _tokenB) public view returns (uint256, uint256);
function lastUpdateTime() public view returns (uint256);
function latestRateAndUpdateTime(IERC20Token _tokenA, IERC20Token _tokenB) public view returns (uint256, uint256, uint256);
function tokenAOracle() public view returns (IChainlinkPriceOracle) {this;}
function tokenBOracle() public view returns (IChainlinkPriceOracle) {this;}
}
// File: solidity/contracts/utility/PriceOracle.sol
pragma solidity 0.4.26;
/**
* @dev Provides the off-chain rate between two tokens
*
* The price oracle uses chainlink oracles internally to get the rates of the two tokens
* with respect to a common denominator, and then returns the rate between them, which
* is equivalent to the rate of TokenA / TokenB
*/
contract PriceOracle is IPriceOracle, Utils {
using SafeMath for uint256;
address private constant ETH_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
uint8 private constant ETH_DECIMALS = 18;
IERC20Token public tokenA; // token A the oracle supports
IERC20Token public tokenB; // token B the oracle supports
mapping (address => uint8) public tokenDecimals; // token -> token decimals
IChainlinkPriceOracle public tokenAOracle; // token A chainlink price oracle
IChainlinkPriceOracle public tokenBOracle; // token B chainlink price oracle
mapping (address => IChainlinkPriceOracle) public tokensToOracles; // token -> price oracle for easier access
/**
* @dev initializes a new PriceOracle instance
* note that the oracles must have the same common denominator (USD, ETH etc.)
*
* @param _tokenA first token to support
* @param _tokenB second token to support
* @param _tokenAOracle first token price oracle
* @param _tokenBOracle second token price oracle
*/
constructor(IERC20Token _tokenA, IERC20Token _tokenB, IChainlinkPriceOracle _tokenAOracle, IChainlinkPriceOracle _tokenBOracle)
public
validUniqueAddresses(_tokenA, _tokenB)
validUniqueAddresses(_tokenAOracle, _tokenBOracle)
{
tokenA = _tokenA;
tokenB = _tokenB;
tokenDecimals[_tokenA] = decimals(_tokenA);
tokenDecimals[_tokenB] = decimals(_tokenB);
tokenAOracle = _tokenAOracle;
tokenBOracle = _tokenBOracle;
tokensToOracles[_tokenA] = _tokenAOracle;
tokensToOracles[_tokenB] = _tokenBOracle;
}
// ensures that the provided addresses are unique valid
modifier validUniqueAddresses(address _address1, address _address2) {
_validUniqueAddresses(_address1, _address2);
_;
}
// error message binary size optimization
function _validUniqueAddresses(address _address1, address _address2) internal pure {
_validAddress(_address1);
_validAddress(_address2);
require(_address1 != _address2, "ERR_SAME_ADDRESS");
}
// ensures that the provides tokens are supported by the oracle
modifier supportedTokens(IERC20Token _tokenA, IERC20Token _tokenB) {
_supportedTokens(_tokenA, _tokenB);
_;
}
// error message binary size optimization
function _supportedTokens(IERC20Token _tokenA, IERC20Token _tokenB) internal view {
_validUniqueAddresses(_tokenA, _tokenB);
require(tokensToOracles[_tokenA] != address(0) && tokensToOracles[_tokenB] != address(0), "ERR_UNSUPPORTED_TOKEN");
}
/**
* @dev returns the latest known rate between the two given tokens
* for a given pair of tokens A and B, returns the rate of A / B
* (the number of B units equivalent to a single A unit)
* the rate is returned as a fraction (numerator / denominator) for accuracy
*
* @param _tokenA token to get the rate of 1 unit of
* @param _tokenB token to get the rate of 1 `_tokenA` against
*
* @return numerator
* @return denominator
*/
function latestRate(IERC20Token _tokenA, IERC20Token _tokenB)
public
view
supportedTokens(_tokenA, _tokenB)
returns (uint256, uint256)
{
uint256 rateTokenA = uint256(tokensToOracles[_tokenA].latestAnswer());
uint256 rateTokenB = uint256(tokensToOracles[_tokenB].latestAnswer());
uint8 decimalsTokenA = tokenDecimals[_tokenA];
uint8 decimalsTokenB = tokenDecimals[_tokenB];
// the normalization works as follows:
// - token A with decimals of dA and price of rateA per one token (e.g., for 10^dA weiA)
// - token B with decimals of dB < dA and price of rateB per one token (e.g., for 10^dB weiB)
// then the normalized rate, representing the rate between 1 weiA and 1 weiB is rateA / (rateB * 10^(dA - dB)).
//
// for example:
// - token A with decimals of 5 and price of $10 per one token (e.g., for 100,000 weiA)
// - token B with decimals of 2 and price of $2 per one token (e.g., for 100 weiB)
// then the normalized rate would be: 5 / (2 * 10^3) = 0.0025, which is the correct rate since
// 1 weiA costs $0.00005, 1 weiB costs $0.02, and weiA / weiB is 0.0025.
if (decimalsTokenA > decimalsTokenB) {
rateTokenB = rateTokenB.mul(uint256(10) ** (decimalsTokenA - decimalsTokenB));
}
else if (decimalsTokenA < decimalsTokenB) {
rateTokenA = rateTokenA.mul(uint256(10) ** (decimalsTokenB - decimalsTokenA));
}
return (rateTokenA, rateTokenB);
}
/**
* @dev returns the timestamp of the last price update the rates are returned as numerator (token1) and denominator
* (token2) for accuracy
*
* @return timestamp
*/
function lastUpdateTime()
public
view
returns (uint256) {
// returns the oldest timestamp between the two
uint256 timestampA = tokenAOracle.latestTimestamp();
uint256 timestampB = tokenBOracle.latestTimestamp();
return timestampA < timestampB ? timestampA : timestampB;
}
/**
* @dev returns both the rate and the timestamp of the last update in a single call (gas optimization)
*
* @param _tokenA token to get the rate of 1 unit of
* @param _tokenB token to get the rate of 1 `_tokenA` against
*
* @return numerator
* @return denominator
* @return timestamp of the last update
*/
function latestRateAndUpdateTime(IERC20Token _tokenA, IERC20Token _tokenB)
public
view
returns (uint256, uint256, uint256)
{
(uint256 numerator, uint256 denominator) = latestRate(_tokenA, _tokenB);
return (numerator, denominator, lastUpdateTime());
}
/** @dev returns the decimals of a given token */
function decimals(IERC20Token _token) private view returns (uint8) {
if (_token == ETH_ADDRESS) {
return ETH_DECIMALS;
}
return _token.decimals();
}
}
// File: solidity/contracts/converter/types/liquidity-pool-v2/LiquidityPoolV2ConverterCustomFactory.sol
pragma solidity 0.4.26;
/*
LiquidityPoolV2ConverterCustomFactory Factory
*/
contract LiquidityPoolV2ConverterCustomFactory is ITypedConverterCustomFactory {
/**
* @dev returns the converter type the factory is associated with
*
* @return converter type
*/
function converterType() public pure returns (uint16) {
return 2;
}
/**
* @dev creates a new price oracle
* note that the oracles must have the same common denominator (USD, ETH etc.)
*
* @param _primaryReserveToken primary reserve token address
* @param _secondaryReserveToken secondary reserve token address
* @param _primaryReserveOracle primary reserve oracle address
* @param _secondaryReserveOracle secondary reserve oracle address
*/
function createPriceOracle(
IERC20Token _primaryReserveToken,
IERC20Token _secondaryReserveToken,
IChainlinkPriceOracle _primaryReserveOracle,
IChainlinkPriceOracle _secondaryReserveOracle)
public
returns (IPriceOracle)
{
return new PriceOracle(_primaryReserveToken, _secondaryReserveToken, _primaryReserveOracle, _secondaryReserveOracle);
}
}
// File: solidity/contracts/utility/interfaces/IWhitelist.sol
pragma solidity 0.4.26;
/*
Whitelist interface
*/
contract IWhitelist {
function isWhitelisted(address _address) public view returns (bool);
}
// File: solidity/contracts/converter/interfaces/IConverter.sol
pragma solidity 0.4.26;
/*
Converter interface
*/
contract IConverter is IOwned {
function converterType() public pure returns (uint16);
function anchor() public view returns (IConverterAnchor) {this;}
function isActive() public view returns (bool);
function targetAmountAndFee(IERC20Token _sourceToken, IERC20Token _targetToken, uint256 _amount) public view returns (uint256, uint256);
function convert(IERC20Token _sourceToken,
IERC20Token _targetToken,
uint256 _amount,
address _trader,
address _beneficiary) public payable returns (uint256);
function conversionWhitelist() public view returns (IWhitelist) {this;}
function conversionFee() public view returns (uint32) {this;}
function maxConversionFee() public view returns (uint32) {this;}
function reserveBalance(IERC20Token _reserveToken) public view returns (uint256);
function() external payable;
function transferAnchorOwnership(address _newOwner) public;
function acceptAnchorOwnership() public;
function setConversionFee(uint32 _conversionFee) public;
function setConversionWhitelist(IWhitelist _whitelist) public;
function withdrawTokens(IERC20Token _token, address _to, uint256 _amount) public;
function withdrawETH(address _to) public;
function addReserve(IERC20Token _token, uint32 _ratio) public;
// deprecated, backward compatibility
function token() public view returns (IConverterAnchor);
function transferTokenOwnership(address _newOwner) public;
function acceptTokenOwnership() public;
function connectors(address _address) public view returns (uint256, uint32, bool, bool, bool);
function getConnectorBalance(IERC20Token _connectorToken) public view returns (uint256);
function connectorTokens(uint256 _index) public view returns (IERC20Token);
function connectorTokenCount() public view returns (uint16);
}
// File: solidity/contracts/converter/interfaces/IConverterUpgrader.sol
pragma solidity 0.4.26;
/*
Converter Upgrader interface
*/
contract IConverterUpgrader {
function upgrade(bytes32 _version) public;
function upgrade(uint16 _version) public;
}
// File: solidity/contracts/converter/interfaces/IBancorFormula.sol
pragma solidity 0.4.26;
/*
Bancor Formula interface
*/
contract IBancorFormula {
function purchaseTargetAmount(uint256 _supply,
uint256 _reserveBalance,
uint32 _reserveWeight,
uint256 _amount)
public view returns (uint256);
function saleTargetAmount(uint256 _supply,
uint256 _reserveBalance,
uint32 _reserveWeight,
uint256 _amount)
public view returns (uint256);
function crossReserveTargetAmount(uint256 _sourceReserveBalance,
uint32 _sourceReserveWeight,
uint256 _targetReserveBalance,
uint32 _targetReserveWeight,
uint256 _amount)
public view returns (uint256);
function fundCost(uint256 _supply,
uint256 _reserveBalance,
uint32 _reserveRatio,
uint256 _amount)
public view returns (uint256);
function fundSupplyAmount(uint256 _supply,
uint256 _reserveBalance,
uint32 _reserveRatio,
uint256 _amount)
public view returns (uint256);
function liquidateReserveAmount(uint256 _supply,
uint256 _reserveBalance,
uint32 _reserveRatio,
uint256 _amount)
public view returns (uint256);
function balancedWeights(uint256 _primaryReserveStakedBalance,
uint256 _primaryReserveBalance,
uint256 _secondaryReserveBalance,
uint256 _reserveRateNumerator,
uint256 _reserveRateDenominator)
public view returns (uint32, uint32);
}
// File: solidity/contracts/IBancorNetwork.sol
pragma solidity 0.4.26;
/*
Bancor Network interface
*/
contract IBancorNetwork {
function convert2(
IERC20Token[] _path,
uint256 _amount,
uint256 _minReturn,
address _affiliateAccount,
uint256 _affiliateFee
) public payable returns (uint256);
function claimAndConvert2(
IERC20Token[] _path,
uint256 _amount,
uint256 _minReturn,
address _affiliateAccount,
uint256 _affiliateFee
) public returns (uint256);
function convertFor2(
IERC20Token[] _path,
uint256 _amount,
uint256 _minReturn,
address _for,
address _affiliateAccount,
uint256 _affiliateFee
) public payable returns (uint256);
function claimAndConvertFor2(
IERC20Token[] _path,
uint256 _amount,
uint256 _minReturn,
address _for,
address _affiliateAccount,
uint256 _affiliateFee
) public returns (uint256);
// deprecated, backward compatibility
function convert(
IERC20Token[] _path,
uint256 _amount,
uint256 _minReturn
) public payable returns (uint256);
// deprecated, backward compatibility
function claimAndConvert(
IERC20Token[] _path,
uint256 _amount,
uint256 _minReturn
) public returns (uint256);
// deprecated, backward compatibility
function convertFor(
IERC20Token[] _path,
uint256 _amount,
uint256 _minReturn,
address _for
) public payable returns (uint256);
// deprecated, backward compatibility
function claimAndConvertFor(
IERC20Token[] _path,
uint256 _amount,
uint256 _minReturn,
address _for
) public returns (uint256);
}
// File: solidity/contracts/utility/interfaces/IContractRegistry.sol
pragma solidity 0.4.26;
/*
Contract Registry interface
*/
contract IContractRegistry {
function addressOf(bytes32 _contractName) public view returns (address);
// deprecated, backward compatibility
function getAddress(bytes32 _contractName) public view returns (address);
}
// File: solidity/contracts/utility/ContractRegistryClient.sol
pragma solidity 0.4.26;
/**
* @dev Base contract for ContractRegistry clients
*/
contract ContractRegistryClient is Owned, Utils {
bytes32 internal constant CONTRACT_REGISTRY = "ContractRegistry";
bytes32 internal constant BANCOR_NETWORK = "BancorNetwork";
bytes32 internal constant BANCOR_FORMULA = "BancorFormula";
bytes32 internal constant CONVERTER_FACTORY = "ConverterFactory";
bytes32 internal constant CONVERSION_PATH_FINDER = "ConversionPathFinder";
bytes32 internal constant CONVERTER_UPGRADER = "BancorConverterUpgrader";
bytes32 internal constant CONVERTER_REGISTRY = "BancorConverterRegistry";
bytes32 internal constant CONVERTER_REGISTRY_DATA = "BancorConverterRegistryData";
bytes32 internal constant BNT_TOKEN = "BNTToken";
bytes32 internal constant BANCOR_X = "BancorX";
bytes32 internal constant BANCOR_X_UPGRADER = "BancorXUpgrader";
bytes32 internal constant CHAINLINK_ORACLE_WHITELIST = "ChainlinkOracleWhitelist";
IContractRegistry public registry; // address of the current contract-registry
IContractRegistry public prevRegistry; // address of the previous contract-registry
bool public onlyOwnerCanUpdateRegistry; // only an owner can update the contract-registry
/**
* @dev verifies that the caller is mapped to the given contract name
*
* @param _contractName contract name
*/
modifier only(bytes32 _contractName) {
_only(_contractName);
_;
}
// error message binary size optimization
function _only(bytes32 _contractName) internal view {
require(msg.sender == addressOf(_contractName), "ERR_ACCESS_DENIED");
}
/**
* @dev initializes a new ContractRegistryClient instance
*
* @param _registry address of a contract-registry contract
*/
constructor(IContractRegistry _registry) internal validAddress(_registry) {
registry = IContractRegistry(_registry);
prevRegistry = IContractRegistry(_registry);
}
/**
* @dev updates to the new contract-registry
*/
function updateRegistry() public {
// verify that this function is permitted
require(msg.sender == owner || !onlyOwnerCanUpdateRegistry, "ERR_ACCESS_DENIED");
// get the new contract-registry
IContractRegistry newRegistry = IContractRegistry(addressOf(CONTRACT_REGISTRY));
// verify that the new contract-registry is different and not zero
require(newRegistry != address(registry) && newRegistry != address(0), "ERR_INVALID_REGISTRY");
// verify that the new contract-registry is pointing to a non-zero contract-registry
require(newRegistry.addressOf(CONTRACT_REGISTRY) != address(0), "ERR_INVALID_REGISTRY");
// save a backup of the current contract-registry before replacing it
prevRegistry = registry;
// replace the current contract-registry with the new contract-registry
registry = newRegistry;
}
/**
* @dev restores the previous contract-registry
*/
function restoreRegistry() public ownerOnly {
// restore the previous contract-registry
registry = prevRegistry;
}
/**
* @dev restricts the permission to update the contract-registry
*
* @param _onlyOwnerCanUpdateRegistry indicates whether or not permission is restricted to owner only
*/
function restrictRegistryUpdate(bool _onlyOwnerCanUpdateRegistry) public ownerOnly {
// change the permission to update the contract-registry
onlyOwnerCanUpdateRegistry = _onlyOwnerCanUpdateRegistry;
}
/**
* @dev returns the address associated with the given contract name
*
* @param _contractName contract name
*
* @return contract address
*/
function addressOf(bytes32 _contractName) internal view returns (address) {
return registry.addressOf(_contractName);
}
}
// File: solidity/contracts/utility/ReentrancyGuard.sol
pragma solidity 0.4.26;
/**
* @dev ReentrancyGuard
*
* The contract provides protection against re-entrancy - calling a function (directly or
* indirectly) from within itself.
*/
contract ReentrancyGuard {
// true while protected code is being executed, false otherwise
bool private locked = false;
/**
* @dev ensures instantiation only by sub-contracts
*/
constructor() internal {}
// protects a function against reentrancy attacks
modifier protected() {
_protected();
locked = true;
_;
locked = false;
}
// error message binary size optimization
function _protected() internal view {
require(!locked, "ERR_REENTRANCY");
}
}
// File: solidity/contracts/token/interfaces/IEtherToken.sol
pragma solidity 0.4.26;
/*
Ether Token interface
*/
contract IEtherToken is IERC20Token {
function deposit() public payable;
function withdraw(uint256 _amount) public;
function depositTo(address _to) public payable;
function withdrawTo(address _to, uint256 _amount) public;
}
// File: solidity/contracts/bancorx/interfaces/IBancorX.sol
pragma solidity 0.4.26;
contract IBancorX {
function token() public view returns (IERC20Token) {this;}
function xTransfer(bytes32 _toBlockchain, bytes32 _to, uint256 _amount, uint256 _id) public;
function getXTransferAmount(uint256 _xTransferId, address _for) public view returns (uint256);
}
// File: solidity/contracts/converter/ConverterBase.sol
pragma solidity 0.4.26;
/**
* @dev ConverterBase
*
* The converter contains the main logic for conversions between different ERC20 tokens.
*
* It is also the upgradable part of the mechanism (note that upgrades are opt-in).
*
* The anchor must be set on construction and cannot be changed afterwards.
* Wrappers are provided for some of the anchor's functions, for easier access.
*
* Once the converter accepts ownership of the anchor, it becomes the anchor's sole controller
* and can execute any of its functions.
*
* To upgrade the converter, anchor ownership must be transferred to a new converter, along with
* any relevant data.
*
* Note that the converter can transfer anchor ownership to a new converter that
* doesn't allow upgrades anymore, for finalizing the relationship between the converter
* and the anchor.
*
* Converter types (defined as uint16 type) -
* 0 = liquid token converter
* 1 = liquidity pool v1 converter
* 2 = liquidity pool v2 converter
*
* Note that converters don't currently support tokens with transfer fees.
*/
contract ConverterBase is IConverter, TokenHandler, TokenHolder, ContractRegistryClient, ReentrancyGuard {
using SafeMath for uint256;
uint32 internal constant WEIGHT_RESOLUTION = 1000000;
uint32 internal constant CONVERSION_FEE_RESOLUTION = 1000000;
address internal constant ETH_RESERVE_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
struct Reserve {
uint256 balance; // reserve balance
uint32 weight; // reserve weight, represented in ppm, 1-1000000
bool deprecated1; // deprecated
bool deprecated2; // deprecated
bool isSet; // true if the reserve is valid, false otherwise
}
/**
* @dev version number
*/
uint16 public constant version = 32;
IConverterAnchor public anchor; // converter anchor contract
IWhitelist public conversionWhitelist; // whitelist contract with list of addresses that are allowed to use the converter
IERC20Token[] public reserveTokens; // ERC20 standard token addresses (prior version 17, use 'connectorTokens' instead)
mapping (address => Reserve) public reserves; // reserve token addresses -> reserve data (prior version 17, use 'connectors' instead)
uint32 public reserveRatio = 0; // ratio between the reserves and the market cap, equal to the total reserve weights
uint32 public maxConversionFee = 0; // maximum conversion fee for the lifetime of the contract,
// represented in ppm, 0...1000000 (0 = no fee, 100 = 0.01%, 1000000 = 100%)
uint32 public conversionFee = 0; // current conversion fee, represented in ppm, 0...maxConversionFee
bool public constant conversionsEnabled = true; // deprecated, backward compatibility
/**
* @dev triggered when the converter is activated
*
* @param _type converter type
* @param _anchor converter anchor
* @param _activated true if the converter was activated, false if it was deactivated
*/
event Activation(uint16 indexed _type, IConverterAnchor indexed _anchor, bool indexed _activated);
/**
* @dev triggered when a conversion between two tokens occurs
*
* @param _fromToken source ERC20 token
* @param _toToken target ERC20 token
* @param _trader wallet that initiated the trade
* @param _amount amount converted, ...
// [truncated — 114992 bytes total]
Read Contract
amplificationFactor 0xd64c5a1a → uint8
anchor 0xd3fb73b4 → address
connectorTokenCount 0x71f52bf3 → uint16
connectorTokens 0x19b64015 → address
connectors 0x0e53aae9 → uint256, uint32, bool, bool, bool
conversionFee 0x579cd3ca → uint32
conversionWhitelist 0xc45d3d92 → address
conversionsEnabled 0xbf754558 → bool
converterType 0x3e8ff43f → uint16
dynamicFeeFactor 0xe8104af9 → uint256
effectiveReserveWeights 0xec2240f5 → uint256, uint256
effectiveTokensRate 0xdb2830a4 → uint256, uint256
getConnectorBalance 0xd8959512 → uint256
getReturn 0x1e1401f8 → uint256, uint256
hasETHReserve 0x12c2aca4 → bool
isActive 0x22f3e2d4 → bool
isV28OrHigher 0xd260529c → bool
lastConversionRate 0xf9cddde2 → uint256, uint256
liquidationLimit 0x2bf0c985 → uint256
maxConversionFee 0x94c275ad → uint32
maxStakedBalanceEnabled 0x0a55fb3d → bool
maxStakedBalances 0x98a71dcb → uint256
newOwner 0xd4ee1d90 → address
onlyOwnerCanUpdateRegistry 0x2fe8a6ad → bool
owner 0x8da5cb5b → address
poolToken 0x5768adcf → address
prevRegistry 0x61cd756e → address
priceOracle 0x2630c12f → address
primaryReserveToken 0x0337e3fb → address
referenceRate 0xa32bff44 → uint256, uint256
referenceRateUpdateTime 0xc3321fb0 → uint256
registry 0x7b103999 → address
removeLiquidityReturnAndFee 0x69067d95 → uint256, uint256
reserveAmplifiedBalance 0x2bd3c107 → uint256
reserveBalance 0xdc8de379 → uint256
reserveRatio 0x0c7d5cd8 → uint32
reserveStakedBalance 0x005e319c → uint256
reserveTokenCount 0x9b99a8e2 → uint16
reserveTokens 0xd031370b → address
reserveWeight 0x1cfab290 → uint32
reserves 0xd66bd524 → uint256, uint32, bool, bool, bool
secondaryReserveToken 0xdc75eb9a → address
targetAmountAndFee 0xaf94b8d8 → uint256, uint256
token 0xfc0c546a → address
version 0x54fd4d50 → uint16
Write Contract 24 functions
These functions modify contract state and require a wallet transaction to execute.
acceptAnchorOwnership 0xcdc91c69
No parameters
acceptOwnership 0x79ba5097
No parameters
acceptTokenOwnership 0x38a5e016
No parameters
activate 0x119b90cd
address _primaryReserveToken
address _primaryReserveOracle
address _secondaryReserveOracle
addLiquidity 0x55776b77
address _reserveToken
uint256 _amount
uint256 _minReturn
returns: uint256
addReserve 0x6a49d2c4
address _token
uint32 _weight
convert 0xe8dc12ff
address _sourceToken
address _targetToken
uint256 _amount
address _trader
address _beneficiary
returns: uint256
disableMaxStakedBalances 0x16912f96
No parameters
removeLiquidity 0xe38192e3
address _poolToken
uint256 _amount
uint256 _minReturn
returns: uint256
restoreRegistry 0xb4a176d3
No parameters
restrictRegistryUpdate 0x024c7ec7
bool _onlyOwnerCanUpdateRegistry
setConversionFee 0xecbca55d
uint32 _conversionFee
setConversionWhitelist 0x4af80f0e
address _whitelist
setDynamicFeeFactor 0x69d1354a
uint256 _dynamicFeeFactor
setMaxStakedBalances 0x46749468
uint256 _reserve1MaxStakedBalance
uint256 _reserve2MaxStakedBalance
setReserveStakedBalance 0xbf7da6ba
address _reserveToken
uint256 _balance
transferAnchorOwnership 0x67b6d57c
address _newOwner
transferOwnership 0xf2fde38b
address _newOwner
transferTokenOwnership 0x21e6b53d
address _newOwner
updateRegistry 0x49d10b64
No parameters
upgrade 0xd55ec697
No parameters
withdrawETH 0x690d8320
address _to
withdrawFromAnchor 0x395900d4
address _token
address _to
uint256 _amount
withdrawTokens 0x5e35359e
address _token
address _to
uint256 _amount
Token Balances (1) $1,540.00
View Transfers →| Token | Balance | Price | Value |
|---|---|---|---|
| UNI | 400.0001 | $3.85 | $1,540.00 |
Recent Transactions
This address has 1 on-chain transactions, but only 1.2% of the chain is indexed. Transactions will appear as indexing progresses. View on Etherscan →