diff --git a/contracts/bin/DelayedRecoveryModule.bin b/contracts/bin/DelayedRecoveryModule.bin index 7e4894e..ece40d1 100644 --- a/contracts/bin/DelayedRecoveryModule.bin +++ b/contracts/bin/DelayedRecoveryModule.bin @@ -1 +1 @@ -0x608060405234801561001057600080fd5b50611954806100206000396000f3fe6080604052600436106100fb5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166307218f4381146101005780631db61b54146101275780631de52d4e1461013c578063363893ae146101515780633811b1091461019b578063481c6a75146101e557806365ae42ae14610216578063698eb6681461025b5780637525c346146102a05780637ded0af7146102f95780638583c7c01461030e5780638931417414610323578063a3f4df7e1461037c578063bde4459014610406578063cbe406221461041b578063f48da4751461045e578063f698da2514610473578063ffa1ad7414610488575b600080fd5b34801561010c57600080fd5b5061011561049d565b60408051918252519081900360200190f35b34801561013357600080fd5b5061011561051d565b34801561014857600080fd5b50610115610578565b34801561015d57600080fd5b506101666105f8565b60408051600160a060020a03958616815293851660208501529190931682820152606082019290925290519081900360800190f35b3480156101a757600080fd5b506101e3600480360360808110156101be57600080fd5b508035600160a060020a0316906020810135906040810135906060013560ff1661061b565b005b3480156101f157600080fd5b506101fa61079f565b60408051600160a060020a039092168252519081900360200190f35b34801561022257600080fd5b506101e36004803603606081101561023957600080fd5b50600160a060020a0381358116916020810135821691604090910135166107ae565b34801561026757600080fd5b506101e36004803603606081101561027e57600080fd5b50600160a060020a0381358116916020810135821691604090910135166109ba565b3480156102ac57600080fd5b506101e3600480360360c08110156102c357600080fd5b508035600160a060020a039081169160208101358216916040820135169060608101359060808101359060a0013560ff16610e2f565b34801561030557600080fd5b50610115611075565b34801561031a57600080fd5b506101fa6110f5565b34801561032f57600080fd5b506101e3600480360360c081101561034657600080fd5b508035600160a060020a039081169160208101358216916040820135169060608101359060808101359060a0013560ff16611104565b34801561038857600080fd5b50610391611312565b6040805160208082528351818301528351919283929083019185019080838360005b838110156103cb5781810151838201526020016103b3565b50505050905090810190601f1680156103f85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561041257600080fd5b50610115611349565b34801561042757600080fd5b506101e36004803603606081101561043e57600080fd5b50600160a060020a0381358116916020810135909116906040013561134f565b34801561046a57600080fd5b506101fa6115fc565b34801561047f57600080fd5b5061011561160b565b34801561049457600080fd5b50610391611611565b604080517f496e6974696174655265636f766572795374727563742861646472657373207081527f7265764f776e65722c61646472657373206f6c644f776e65722c61646472657360208201527f73206e65774f776e65722900000000000000000000000000000000000000000081830152905190819003604b01902081565b604080517f454950373132446f6d61696e28616464726573732064656c617965645265636f81527f766572794d6f64756c65290000000000000000000000000000000000000000006020820152905190819003602b01902081565b604080517f52657365745265636f766572794f776e6572537472756374286164647265737381527f206f6c645265636f766572794f776e65722c61646472657373206e657752656360208201527f6f766572794f776e65722900000000000000000000000000000000000000000081830152905190819003604b01902081565b600654600754600854600954600160a060020a0393841693928316929091169084565b600354600160a060020a0316331461067f576040805160e560020a62461bcd02815260206004820152602c60248201526000805160206118e98339815191526044820152600080516020611909833981519152606482015290519081900360840190fd5b600160a060020a0384161515610705576040805160e560020a62461bcd02815260206004820152602560248201527f4e6577207265636f76657279206f776e6572277320616464726573732069732060448201527f6e756c6c2e000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b60045460009061071e90600160a060020a031686611648565b905061072c81858585611712565b60048054600160a060020a0387811673ffffffffffffffffffffffffffffffffffffffff19831617928390556040805192821680845293909116602083015280517f694d34d730078c03a64a5c5937027a85a71f3631085fb14efebcefba0f1200ad9281900390910190a1505050505050565b600154600160a060020a031681565b600354600160a060020a03163314610812576040805160e560020a62461bcd02815260206004820152602c60248201526000805160206118e98339815191526044820152600080516020611909833981519152606482015290519081900360840190fd5b60095460001061086c576040805160e560020a62461bcd02815260206004820152601c60248201527f5468657265206973206e6f20616374697665207265636f766572792e00000000604482015290519081900360640190fd5b600654839083908390600160a060020a03808516911614801561089c5750600754600160a060020a038381169116145b80156108b55750600854600160a060020a038281169116145b1515610931576040805160e560020a62461bcd02815260206004820152602481018290527f54686520657865637574696f6e20726571756573742773206461746120646f6560448201527f73206e6f74206d6174636820776974682074686520616374697665206f6e652e606482015290519081900360840190fd5b6006805473ffffffffffffffffffffffffffffffffffffffff199081169091556007805482169055600880549091169055600060095560408051600160a060020a038881168252878116602083015286168183015290517f7789739c172389f440865a4d26a746e433bc23a4058077237b7c8cf47a9a18bb9181900360600190a1505050505050565b600354600160a060020a03163314610a1e576040805160e560020a62461bcd02815260206004820152602c60248201526000805160206118e98339815191526044820152600080516020611909833981519152606482015290519081900360840190fd5b600954600010610a78576040805160e560020a62461bcd02815260206004820152601c60248201527f5468657265206973206e6f20616374697665207265636f766572792e00000000604482015290519081900360640190fd5b600654839083908390600160a060020a038085169116148015610aa85750600754600160a060020a038381169116145b8015610ac15750600854600160a060020a038281169116145b1515610b3d576040805160e560020a62461bcd02815260206004820152602481018290527f54686520657865637574696f6e20726571756573742773206461746120646f6560448201527f73206e6f74206d6174636820776974682074686520616374697665206f6e652e606482015290519081900360840190fd5b6009544311610bbc576040805160e560020a62461bcd02815260206004820152603860248201527f5265717569726564206e756d626572206f6620626c6f636b7320746f2072656360448201527f6f76657220776173206e6f742070726f677265737365642e0000000000000000606482015290519081900360840190fd5b60408051600160a060020a03808916602480840191909152818916604480850191909152828916606480860191909152855180860382018152608490950186526020850180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fe318b52b0000000000000000000000000000000000000000000000000000000017905260015495517f468721a7000000000000000000000000000000000000000000000000000000008152959093166004860181815260009387018490529495909463468721a794869493889385939291810191018360ff168152602001828103825284818151815260200191508051906020019080838360005b83811015610cd4578181015183820152602001610cbc565b50505050905090810190601f168015610d015780820380516001836020036101000a031916815260200191505b5095505050505050602060405180830381600087803b158015610d2357600080fd5b505af1158015610d37573d6000803e3d6000fd5b505050506040513d6020811015610d4d57600080fd5b50511515610da5576040805160e560020a62461bcd02815260206004820152601a60248201527f5265636f7665727920657865637574696f6e206661696c65642e000000000000604482015290519081900360640190fd5b6006805473ffffffffffffffffffffffffffffffffffffffff199081169091556007805482169055600880549091169055600060095560408051600160a060020a038981168252888116602083015287168183015290517f39a93e422776c9b292c4617cb75d1f0bb8e528c2c06ea7cbc10cd233793a4f859181900360600190a150505050505050565b600954600010610e89576040805160e560020a62461bcd02815260206004820152601c60248201527f5468657265206973206e6f20616374697665207265636f766572792e00000000604482015290519081900360640190fd5b600654869086908690600160a060020a038085169116148015610eb95750600754600160a060020a038381169116145b8015610ed25750600854600160a060020a038281169116145b1515610f4e576040805160e560020a62461bcd02815260206004820152602481018290527f54686520657865637574696f6e20726571756573742773206461746120646f6560448201527f73206e6f74206d6174636820776974682074686520616374697665206f6e652e606482015290519081900360840190fd5b604080517f41626f72745265636f766572795374727563742861646472657373207072657681527f4f776e65722c61646472657373206f6c644f776e65722c61646472657373206e60208201527f65774f776e657229000000000000000000000000000000000000000000000000818301529051908190036048019020600090610fda908b8b8b61180e565b9050610fe881888888611712565b6006805473ffffffffffffffffffffffffffffffffffffffff199081169091556007805482169055600880549091169055600060095560408051600160a060020a038c811682528b811660208301528a168183015290517f7789739c172389f440865a4d26a746e433bc23a4058077237b7c8cf47a9a18bb9181900360600190a150505050505050505050565b604080517f41626f72745265636f766572795374727563742861646472657373207072657681527f4f776e65722c61646472657373206f6c644f776e65722c61646472657373206e60208201527f65774f776e65722900000000000000000000000000000000000000000000000081830152905190819003604801902081565b600454600160a060020a031681565b600354600160a060020a03163314611168576040805160e560020a62461bcd02815260206004820152602c60248201526000805160206118e98339815191526044820152600080516020611909833981519152606482015290519081900360840190fd5b600954156111c0576040805160e560020a62461bcd02815260206004820152601c60248201527f546865726520697320616e20616374697665207265636f766572792e00000000604482015290519081900360640190fd5b604080517f496e6974696174655265636f766572795374727563742861646472657373207081527f7265764f776e65722c61646472657373206f6c644f776e65722c61646472657360208201527f73206e65774f776e65722900000000000000000000000000000000000000000081830152905190819003604b01902060009061124c9088888861180e565b905061125a81858585611712565b60408051608081018252600160a060020a03808a168083528982166020808501829052928a16848601819052600554430160609586018190526006805473ffffffffffffffffffffffffffffffffffffffff1990811686179091556007805482168517905560088054909116831790556009558551928352928201528084019190915291517f984ae6bb7fc6ec202143bd903c70af8408ed9b154ef3e4cfe78e47a90ebbe2e49281900390910190a150505050505050565b60408051808201909152601781527f44656c61796564205265636f76657279204d6f64756c65000000000000000000602082015281565b60055481565b600254156113cd576040805160e560020a62461bcd02815260206004820152602160248201527f446f6d61696e20736570617261746f722077617320616c72656164792073657460448201527f2e00000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600160a060020a0383161515611453576040805160e560020a62461bcd02815260206004820152602160248201527f5265636f76657279206f776e657227732061646472657373206973206e756c6c60448201527f2e00000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600160a060020a03821615156114d9576040805160e560020a62461bcd02815260206004820152602660248201527f5265636f7665727920636f6e74726f6c6c65722773206164647265737320697360448201527f206e756c6c2e0000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b60008111611531576040805160e560020a62461bcd02815260206004820152601a60248201527f5265636f7665727920626c6f636b2064656c617920697320302e000000000000604482015290519081900360640190fd5b604080517f454950373132446f6d61696e28616464726573732064656c617965645265636f81527f766572794d6f64756c6529000000000000000000000000000000000000000000602080830191909152825191829003602b018220828201523082840152825180830384018152606090920190925280519101206002556001805473ffffffffffffffffffffffffffffffffffffffff19908116331790915560048054600160a060020a039586169083161790556003805493909416921691909117909155600555565b600354600160a060020a031681565b60025481565b60408051808201909152600581527f302e312e30000000000000000000000000000000000000000000000000000000602082015281565b604080517f52657365745265636f766572794f776e6572537472756374286164647265737381527f206f6c645265636f766572794f776e65722c61646472657373206e65775265636020808301919091527f6f766572794f776e65722900000000000000000000000000000000000000000082840152825191829003604b01822082820152600160a060020a03808616838501528416606080840191909152835180840390910181526080909201909252805191012060009061170a81611869565b949350505050565b6004546040805160008152602080820180845288905260ff85168284015260608201879052608082018690529151600160a060020a039093169260019260a0808401939192601f1981019281900390910190855afa158015611778573d6000803e3d6000fd5b50505060206040510351600160a060020a0316141515611808576040805160e560020a62461bcd02815260206004820152602560248201527f496e76616c6964207369676e617475726520666f72207265636f76657279206f60448201527f776e65722e000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b50505050565b604080516020808201879052600160a060020a0380871683850152808616606084015284166080808401919091528351808403909101815260a0909201909252805191012060009061185f81611869565b9695505050505050565b600254604080517f19000000000000000000000000000000000000000000000000000000000000006020808301919091527f01000000000000000000000000000000000000000000000000000000000000006021830152602282019390935260428082019490945281518082039094018452606201905281519101209056fe4f6e6c79207265636f7665727920636f6e74726f6c6c657220697320616c6c6f77656420746f2063616c6c2e0000000000000000000000000000000000000000a165627a7a72305820d7d2593cd6db88b8ed76cbb8b85e32c50134307556a83712fed6824ac6e6e3e30029 \ No newline at end of file +0x608060405234801561001057600080fd5b50611954806100206000396000f3fe6080604052600436106100fb5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166307218f4381146101005780631db61b54146101275780631de52d4e1461013c578063363893ae146101515780633811b1091461019b578063481c6a75146101e557806365ae42ae14610216578063698eb6681461025b5780637525c346146102a05780637ded0af7146102f95780638583c7c01461030e5780638931417414610323578063a3f4df7e1461037c578063bde4459014610406578063cbe406221461041b578063f48da4751461045e578063f698da2514610473578063ffa1ad7414610488575b600080fd5b34801561010c57600080fd5b5061011561049d565b60408051918252519081900360200190f35b34801561013357600080fd5b5061011561051d565b34801561014857600080fd5b50610115610578565b34801561015d57600080fd5b506101666105f8565b60408051600160a060020a03958616815293851660208501529190931682820152606082019290925290519081900360800190f35b3480156101a757600080fd5b506101e3600480360360808110156101be57600080fd5b508035600160a060020a0316906020810135906040810135906060013560ff1661061b565b005b3480156101f157600080fd5b506101fa61079f565b60408051600160a060020a039092168252519081900360200190f35b34801561022257600080fd5b506101e36004803603606081101561023957600080fd5b50600160a060020a0381358116916020810135821691604090910135166107ae565b34801561026757600080fd5b506101e36004803603606081101561027e57600080fd5b50600160a060020a0381358116916020810135821691604090910135166109ba565b3480156102ac57600080fd5b506101e3600480360360c08110156102c357600080fd5b508035600160a060020a039081169160208101358216916040820135169060608101359060808101359060a0013560ff16610e2f565b34801561030557600080fd5b50610115611075565b34801561031a57600080fd5b506101fa6110f5565b34801561032f57600080fd5b506101e3600480360360c081101561034657600080fd5b508035600160a060020a039081169160208101358216916040820135169060608101359060808101359060a0013560ff16611104565b34801561038857600080fd5b50610391611312565b6040805160208082528351818301528351919283929083019185019080838360005b838110156103cb5781810151838201526020016103b3565b50505050905090810190601f1680156103f85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561041257600080fd5b50610115611349565b34801561042757600080fd5b506101e36004803603606081101561043e57600080fd5b50600160a060020a0381358116916020810135909116906040013561134f565b34801561046a57600080fd5b506101fa6115fc565b34801561047f57600080fd5b5061011561160b565b34801561049457600080fd5b50610391611611565b604080517f496e6974696174655265636f766572795374727563742861646472657373207081527f7265764f776e65722c61646472657373206f6c644f776e65722c61646472657360208201527f73206e65774f776e65722900000000000000000000000000000000000000000081830152905190819003604b01902081565b604080517f454950373132446f6d61696e28616464726573732064656c617965645265636f81527f766572794d6f64756c65290000000000000000000000000000000000000000006020820152905190819003602b01902081565b604080517f52657365745265636f766572794f776e6572537472756374286164647265737381527f206f6c645265636f766572794f776e65722c61646472657373206e657752656360208201527f6f766572794f776e65722900000000000000000000000000000000000000000081830152905190819003604b01902081565b600654600754600854600954600160a060020a0393841693928316929091169084565b600354600160a060020a0316331461067f576040805160e560020a62461bcd02815260206004820152602c60248201526000805160206118e98339815191526044820152600080516020611909833981519152606482015290519081900360840190fd5b600160a060020a0384161515610705576040805160e560020a62461bcd02815260206004820152602560248201527f4e6577207265636f76657279206f776e6572277320616464726573732069732060448201527f6e756c6c2e000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b60045460009061071e90600160a060020a031686611648565b905061072c81858585611712565b60048054600160a060020a0387811673ffffffffffffffffffffffffffffffffffffffff19831617928390556040805192821680845293909116602083015280517f694d34d730078c03a64a5c5937027a85a71f3631085fb14efebcefba0f1200ad9281900390910190a1505050505050565b600154600160a060020a031681565b600354600160a060020a03163314610812576040805160e560020a62461bcd02815260206004820152602c60248201526000805160206118e98339815191526044820152600080516020611909833981519152606482015290519081900360840190fd5b60095460001061086c576040805160e560020a62461bcd02815260206004820152601c60248201527f5468657265206973206e6f20616374697665207265636f766572792e00000000604482015290519081900360640190fd5b600654839083908390600160a060020a03808516911614801561089c5750600754600160a060020a038381169116145b80156108b55750600854600160a060020a038281169116145b1515610931576040805160e560020a62461bcd02815260206004820152602481018290527f54686520657865637574696f6e20726571756573742773206461746120646f6560448201527f73206e6f74206d6174636820776974682074686520616374697665206f6e652e606482015290519081900360840190fd5b6006805473ffffffffffffffffffffffffffffffffffffffff199081169091556007805482169055600880549091169055600060095560408051600160a060020a038881168252878116602083015286168183015290517f7789739c172389f440865a4d26a746e433bc23a4058077237b7c8cf47a9a18bb9181900360600190a1505050505050565b600354600160a060020a03163314610a1e576040805160e560020a62461bcd02815260206004820152602c60248201526000805160206118e98339815191526044820152600080516020611909833981519152606482015290519081900360840190fd5b600954600010610a78576040805160e560020a62461bcd02815260206004820152601c60248201527f5468657265206973206e6f20616374697665207265636f766572792e00000000604482015290519081900360640190fd5b600654839083908390600160a060020a038085169116148015610aa85750600754600160a060020a038381169116145b8015610ac15750600854600160a060020a038281169116145b1515610b3d576040805160e560020a62461bcd02815260206004820152602481018290527f54686520657865637574696f6e20726571756573742773206461746120646f6560448201527f73206e6f74206d6174636820776974682074686520616374697665206f6e652e606482015290519081900360840190fd5b6009544311610bbc576040805160e560020a62461bcd02815260206004820152603860248201527f5265717569726564206e756d626572206f6620626c6f636b7320746f2072656360448201527f6f76657220776173206e6f742070726f677265737365642e0000000000000000606482015290519081900360840190fd5b60408051600160a060020a03808916602480840191909152818916604480850191909152828916606480860191909152855180860382018152608490950186526020850180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fe318b52b0000000000000000000000000000000000000000000000000000000017905260015495517f468721a7000000000000000000000000000000000000000000000000000000008152959093166004860181815260009387018490529495909463468721a794869493889385939291810191018360ff168152602001828103825284818151815260200191508051906020019080838360005b83811015610cd4578181015183820152602001610cbc565b50505050905090810190601f168015610d015780820380516001836020036101000a031916815260200191505b5095505050505050602060405180830381600087803b158015610d2357600080fd5b505af1158015610d37573d6000803e3d6000fd5b505050506040513d6020811015610d4d57600080fd5b50511515610da5576040805160e560020a62461bcd02815260206004820152601a60248201527f5265636f7665727920657865637574696f6e206661696c65642e000000000000604482015290519081900360640190fd5b6006805473ffffffffffffffffffffffffffffffffffffffff199081169091556007805482169055600880549091169055600060095560408051600160a060020a038981168252888116602083015287168183015290517f39a93e422776c9b292c4617cb75d1f0bb8e528c2c06ea7cbc10cd233793a4f859181900360600190a150505050505050565b600954600010610e89576040805160e560020a62461bcd02815260206004820152601c60248201527f5468657265206973206e6f20616374697665207265636f766572792e00000000604482015290519081900360640190fd5b600654869086908690600160a060020a038085169116148015610eb95750600754600160a060020a038381169116145b8015610ed25750600854600160a060020a038281169116145b1515610f4e576040805160e560020a62461bcd02815260206004820152602481018290527f54686520657865637574696f6e20726571756573742773206461746120646f6560448201527f73206e6f74206d6174636820776974682074686520616374697665206f6e652e606482015290519081900360840190fd5b604080517f41626f72745265636f766572795374727563742861646472657373207072657681527f4f776e65722c61646472657373206f6c644f776e65722c61646472657373206e60208201527f65774f776e657229000000000000000000000000000000000000000000000000818301529051908190036048019020600090610fda908b8b8b61180e565b9050610fe881888888611712565b6006805473ffffffffffffffffffffffffffffffffffffffff199081169091556007805482169055600880549091169055600060095560408051600160a060020a038c811682528b811660208301528a168183015290517f7789739c172389f440865a4d26a746e433bc23a4058077237b7c8cf47a9a18bb9181900360600190a150505050505050505050565b604080517f41626f72745265636f766572795374727563742861646472657373207072657681527f4f776e65722c61646472657373206f6c644f776e65722c61646472657373206e60208201527f65774f776e65722900000000000000000000000000000000000000000000000081830152905190819003604801902081565b600454600160a060020a031681565b600354600160a060020a03163314611168576040805160e560020a62461bcd02815260206004820152602c60248201526000805160206118e98339815191526044820152600080516020611909833981519152606482015290519081900360840190fd5b600954156111c0576040805160e560020a62461bcd02815260206004820152601c60248201527f546865726520697320616e20616374697665207265636f766572792e00000000604482015290519081900360640190fd5b604080517f496e6974696174655265636f766572795374727563742861646472657373207081527f7265764f776e65722c61646472657373206f6c644f776e65722c61646472657360208201527f73206e65774f776e65722900000000000000000000000000000000000000000081830152905190819003604b01902060009061124c9088888861180e565b905061125a81858585611712565b60408051608081018252600160a060020a03808a168083528982166020808501829052928a16848601819052600554430160609586018190526006805473ffffffffffffffffffffffffffffffffffffffff1990811686179091556007805482168517905560088054909116831790556009558551928352928201528084019190915291517f984ae6bb7fc6ec202143bd903c70af8408ed9b154ef3e4cfe78e47a90ebbe2e49281900390910190a150505050505050565b60408051808201909152601781527f44656c61796564205265636f76657279204d6f64756c65000000000000000000602082015281565b60055481565b600254156113cd576040805160e560020a62461bcd02815260206004820152602160248201527f446f6d61696e20736570617261746f722077617320616c72656164792073657460448201527f2e00000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600160a060020a0383161515611453576040805160e560020a62461bcd02815260206004820152602160248201527f5265636f76657279206f776e657227732061646472657373206973206e756c6c60448201527f2e00000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600160a060020a03821615156114d9576040805160e560020a62461bcd02815260206004820152602660248201527f5265636f7665727920636f6e74726f6c6c65722773206164647265737320697360448201527f206e756c6c2e0000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b60008111611531576040805160e560020a62461bcd02815260206004820152601a60248201527f5265636f7665727920626c6f636b2064656c617920697320302e000000000000604482015290519081900360640190fd5b604080517f454950373132446f6d61696e28616464726573732064656c617965645265636f81527f766572794d6f64756c6529000000000000000000000000000000000000000000602080830191909152825191829003602b018220828201523082840152825180830384018152606090920190925280519101206002556001805473ffffffffffffffffffffffffffffffffffffffff19908116331790915560048054600160a060020a039586169083161790556003805493909416921691909117909155600555565b600354600160a060020a031681565b60025481565b60408051808201909152600581527f302e312e30000000000000000000000000000000000000000000000000000000602082015281565b604080517f52657365745265636f766572794f776e6572537472756374286164647265737381527f206f6c645265636f766572794f776e65722c61646472657373206e65775265636020808301919091527f6f766572794f776e65722900000000000000000000000000000000000000000082840152825191829003604b01822082820152600160a060020a03808616838501528416606080840191909152835180840390910181526080909201909252805191012060009061170a81611869565b949350505050565b6004546040805160008152602080820180845288905260ff85168284015260608201879052608082018690529151600160a060020a039093169260019260a0808401939192601f1981019281900390910190855afa158015611778573d6000803e3d6000fd5b50505060206040510351600160a060020a0316141515611808576040805160e560020a62461bcd02815260206004820152602560248201527f496e76616c6964207369676e617475726520666f72207265636f76657279206f60448201527f776e65722e000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b50505050565b604080516020808201879052600160a060020a0380871683850152808616606084015284166080808401919091528351808403909101815260a0909201909252805191012060009061185f81611869565b9695505050505050565b600254604080517f19000000000000000000000000000000000000000000000000000000000000006020808301919091527f01000000000000000000000000000000000000000000000000000000000000006021830152602282019390935260428082019490945281518082039094018452606201905281519101209056fe4f6e6c79207265636f7665727920636f6e74726f6c6c657220697320616c6c6f77656420746f2063616c6c2e0000000000000000000000000000000000000000a165627a7a7230582067d82e41b7d93fcee2792f73bf7a6ed5893e8d2d1086d0739413eb0a6687211b0029 \ No newline at end of file diff --git a/contracts/bin/PricerRule.bin b/contracts/bin/PricerRule.bin index 35ec1ac..8a34d52 100644 --- a/contracts/bin/PricerRule.bin +++ b/contracts/bin/PricerRule.bin @@ -1 +1 @@ -0x608060405234801561001057600080fd5b5060405160e080611874833981018060405260e081101561003057600080fd5b508051602082015160408301516060840151608085015160a086015160c090960151949593949293919290919086600160a060020a03811615156100fb57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f4f7267616e697a6174696f6e20636f6e74726163742061646472657373206d7560448201527f7374206e6f74206265207a65726f2e0000000000000000000000000000000000606482015290519081900360840190fd5b60008054600160a060020a031916600160a060020a039283161790558616151561018657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f546f6b656e2061646472657373206973206e756c6c2e00000000000000000000604482015290519081900360640190fd5b7fffffff00000000000000000000000000000000000000000000000000000000008516151561021657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f426173652063757272656e637920636f6465206973206e756c6c2e0000000000604482015290519081900360640190fd5b8315156102aa57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603960248201527f436f6e76657273696f6e20726174652066726f6d20746865206261736520637560448201527f7272656e637920746f2074686520746f6b656e20697320302e00000000000000606482015290519081900360840190fd5b600160a060020a038116151561032157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f546f6b656e2072756c65732061646472657373206973206e756c6c2e00000000604482015290519081900360640190fd5b60018054600160a060020a03978816600160a060020a0319909116179055600080547d010000000000000000000000000000000000000000000000000000000000909604740100000000000000000000000000000000000000000260a060020a62ffffff02199096169590951790945560029290925560ff90811660035560048054939094166101000261010060a860020a03199290911660ff1990931692909217161790555061149d806103d76000396000f3fe6080604052600436106100b65763ffffffff60e060020a60003504166306a2768781146100bb5780631e82d63d1461010157806323bd4d7a146101365780635a887047146101675780635a8f940814610256578063612367bf1461026b578063780e2e2e1461029f5780637db547c7146102b45780639c144d5e146102e8578063bb716ef4146102fd578063e5c379d814610337578063f07478af14610362578063f756eb7314610396578063fabdb613146103ab575b600080fd5b3480156100c757600080fd5b506100ef600480360360208110156100de57600080fd5b5035600160e860020a0319166103dd565b60408051918252519081900360200190f35b34801561010d57600080fd5b506101346004803603602081101561012457600080fd5b5035600160a060020a03166103ef565b005b34801561014257600080fd5b5061014b6108eb565b60408051600160a060020a039092168252519081900360200190f35b34801561017357600080fd5b50610134600480360360a081101561018a57600080fd5b600160a060020a0382351691908101906040810160208201356401000000008111156101b557600080fd5b8201836020820111156101c757600080fd5b803590602001918460208302840111640100000000831117156101e957600080fd5b91939092909160208101903564010000000081111561020757600080fd5b82018360208201111561021957600080fd5b8035906020019184602083028401116401000000008311171561023b57600080fd5b9193509150600160e860020a031981351690602001356108fa565b34801561026257600080fd5b5061014b610cb8565b34801561027757600080fd5b5061014b6004803603602081101561028e57600080fd5b5035600160e860020a031916610cc7565b3480156102ab57600080fd5b506100ef610ce2565b3480156102c057600080fd5b50610134600480360360208110156102d757600080fd5b5035600160e860020a031916610ce8565b3480156102f457600080fd5b5061014b610e6f565b34801561030957600080fd5b506101346004803603604081101561032057600080fd5b50600160e860020a03198135169060200135610e83565b34801561034357600080fd5b5061034c611010565b6040805160ff9092168252519081900360200190f35b34801561036e57600080fd5b506101346004803603602081101561038557600080fd5b5035600160e860020a031916611019565b3480156103a257600080fd5b506100ef611201565b3480156103b757600080fd5b506103c0611207565b60408051600160e860020a03199092168252519081900360200190f35b60066020526000908152604090205481565b6000546040805160e060020a63aa1566450281523360048201529051600160a060020a039092169163aa15664591602480820192602092909190829003018186803b15801561043d57600080fd5b505afa158015610451573d6000803e3d6000fd5b505050506040513d602081101561046757600080fd5b505115156104c1576040805160e560020a62461bcd02815260206004820152603960248201526000805160206114528339815191526044820152600080516020611432833981519152606482015290519081900360840190fd5b600160a060020a0381161515610521576040805160e560020a62461bcd02815260206004820152601d60248201527f5072696365206f7261636c652061646472657373206973206e756c6c2e000000604482015290519081900360640190fd5b60048054604080517f313ce567000000000000000000000000000000000000000000000000000000008152905160ff90921692600160a060020a0385169263313ce567928083019260209291829003018186803b15801561058157600080fd5b505afa158015610595573d6000803e3d6000fd5b505050506040513d60208110156105ab57600080fd5b505160ff1614610651576040805160e560020a62461bcd02815260206004820152604160248201527f5072696365206f7261636c6520646563696d616c73206e756d6265722069732060448201527f646966666572656e63652066726f6d20746865207265717569726564206f6e6560648201527f2e00000000000000000000000000000000000000000000000000000000000000608482015290519081900360a40190fd5b600081600160a060020a03166382564bca6040518163ffffffff1660e060020a02815260040160206040518083038186803b15801561068f57600080fd5b505afa1580156106a3573d6000803e3d6000fd5b505050506040513d60208110156106b957600080fd5b5051600160e860020a03198116600090815260056020526040902054909150600160a060020a031615610736576040805160e560020a62461bcd02815260206004820152601c60248201527f5072696365206f7261636c6520616c7265616479206578697374732e00000000604482015290519081900360640190fd5b600060149054906101000a90047d010000000000000000000000000000000000000000000000000000000000027cffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191682600160a060020a03166392a85fde6040518163ffffffff1660e060020a02815260040160206040518083038186803b1580156107bf57600080fd5b505afa1580156107d3573d6000803e3d6000fd5b505050506040513d60208110156107e957600080fd5b5051600160e860020a03191614610870576040805160e560020a62461bcd02815260206004820152603160248201527f5072696365206f7261636c65277320626173652063757272656e637920636f6460448201527f6520646f6573206e6f74206d617463682e000000000000000000000000000000606482015290519081900360840190fd5b600160e860020a03198116600090815260056020908152604091829020805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038616908117909155825190815291517facf23cc5480d1d549f783a7bd5430fec8c74f0044e925e78beb6733023a105159281900390910190a15050565b600054600160a060020a031681565b600160a060020a038716151561095a576040805160e560020a62461bcd02815260206004820152601560248201527f46726f6d2061646472657373206973206e756c6c2e0000000000000000000000604482015290519081900360640190fd5b8483146109d7576040805160e560020a62461bcd02815260206004820152603960248201527f27746f2720616e642027616d6f756e7427207472616e7366657220617272617960448201527f7327206c656e6774687320617265206e6f7420657175616c2e00000000000000606482015290519081900360840190fd5b8415156109e357610caf565b60006109ee83611245565b9050801515610a6d576040805160e560020a62461bcd02815260206004820152602960248201527f426173652063757272656e637920707269636520696e2070617920637572726560448201527f6e637920697320302e0000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600160e860020a03198316600090815260066020526040902054610a949083908390611354565b1515610b36576040805160e560020a62461bcd02815260206004820152604160248201527f496e74656e646564207072696365206973206e6f7420696e207468652061636360448201527f65707461626c65206d617267696e207772742063757272656e7420707269636560648201527f2e00000000000000000000000000000000000000000000000000000000000000608482015290519081900360a40190fd5b604080518581526020808702820101909152606090858015610b62578160200160208202803883390190505b50905060005b85811015610bac57610b8c83888884818110610b8057fe5b90506020020135611394565b8282815181101515610b9a57fe5b60209081029091010152600101610b68565b50600480546040517fa6a192da000000000000000000000000000000000000000000000000000000008152600160a060020a038c8116938201938452606060248301908152606483018c9052610100909304169263a6a192da928d928d928d92889260448101906084018660208702808284376000838201819052601f909101601f1916909201858103845286518152865160209182019382890193509102908190849084905b83811015610c6b578181015183820152602001610c53565b505050509050019650505050505050600060405180830381600087803b158015610c9457600080fd5b505af1158015610ca8573d6000803e3d6000fd5b5050505050505b50505050505050565b600154600160a060020a031681565b600560205260009081526040902054600160a060020a031681565b60025481565b6000546040805160e060020a63aa1566450281523360048201529051600160a060020a039092169163aa15664591602480820192602092909190829003018186803b158015610d3657600080fd5b505afa158015610d4a573d6000803e3d6000fd5b505050506040513d6020811015610d6057600080fd5b50511515610dba576040805160e560020a62461bcd02815260206004820152603960248201526000805160206114528339815191526044820152600080516020611432833981519152606482015290519081900360840190fd5b600160e860020a031981161515610e1b576040805160e560020a62461bcd02815260206004820152601a60248201527f5061792063757272656e637920636f6465206973206e756c6c2e000000000000604482015290519081900360640190fd5b600160e860020a03198116600081815260066020908152604080832092909255815192835290517f2c48f41fb0ac91148a38a270c2227239ead8136223f9b12cf603e57c799d5e609281900390910190a150565b6004546101009004600160a060020a031681565b6000546040805160e060020a63aa1566450281523360048201529051600160a060020a039092169163aa15664591602480820192602092909190829003018186803b158015610ed157600080fd5b505afa158015610ee5573d6000803e3d6000fd5b505050506040513d6020811015610efb57600080fd5b50511515610f55576040805160e560020a62461bcd02815260206004820152603960248201526000805160206114528339815191526044820152600080516020611432833981519152606482015290519081900360840190fd5b600160e860020a031982161515610fb6576040805160e560020a62461bcd02815260206004820152601a60248201527f5061792063757272656e637920636f6465206973206e756c6c2e000000000000604482015290519081900360640190fd5b600160e860020a031982166000818152600660209081526040918290208490558151928352820183905280517f9342d2e77f78a211818c17938619fcbb5d57089d24841841df0ff3fa4b13b1639281900390910190a15050565b60045460ff1681565b6000546040805160e060020a63aa1566450281523360048201529051600160a060020a039092169163aa15664591602480820192602092909190829003018186803b15801561106757600080fd5b505afa15801561107b573d6000803e3d6000fd5b505050506040513d602081101561109157600080fd5b505115156110eb576040805160e560020a62461bcd02815260206004820152603960248201526000805160206114528339815191526044820152600080516020611432833981519152606482015290519081900360840190fd5b600160e860020a03198116600090815260056020526040902054600160a060020a031680151561118b576040805160e560020a62461bcd02815260206004820152602660248201527f5072696365206f7261636c6520746f2072656d6f766520646f6573206e6f742060448201527f65786973742e0000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600160e860020a03198216600090815260056020908152604091829020805473ffffffffffffffffffffffffffffffffffffffff191690558151600160a060020a038416815291517f1ab93c820592302b2bef0070dd03654585b6942bfde155498ddd3d69190bf0429281900390910190a15050565b60035481565b6000547401000000000000000000000000000000000000000090047d0100000000000000000000000000000000000000000000000000000000000281565b600160e860020a03198116600090815260056020526040812054600160a060020a03168015156112e5576040805160e560020a62461bcd02815260206004820152603c60248201527f5072696365206f7261636c6520666f722074686520737065636966696564206360448201527f757272656e637920636f646520646f6573206e6f742065786973742e00000000606482015290519081900360840190fd5b80600160a060020a03166398d5fdca6040518163ffffffff1660e060020a02815260040160206040518083038186803b15801561132157600080fd5b505afa158015611335573d6000803e3d6000fd5b505050506040513d602081101561134b57600080fd5b50519392505050565b600080848411156113765761136f848663ffffffff6113cd16565b9050611389565b611386858563ffffffff6113cd16565b90505b909110159392505050565b60006113c4836113b8600354600a0a6113b8600254876113e290919063ffffffff16565b9063ffffffff61140d16565b90505b92915050565b6000828211156113dc57600080fd5b50900390565b60008215156113f3575060006113c7565b82820282848281151561140257fe5b04146113c457600080fd5b600080821161141b57600080fd5b6000828481151561142857fe5b0494935050505056fe6f77656420746f2063616c6c2074686973206d6574686f642e000000000000004f6e6c792077686974656c697374656420776f726b6572732061726520616c6ca165627a7a723058206696dd4884bc5cb715d206f6194d2d0013e3d96e2be96dc3c8a2535f489e9ae30029 \ No newline at end of file +0x608060405234801561001057600080fd5b5060405160e080611874833981018060405260e081101561003057600080fd5b508051602082015160408301516060840151608085015160a086015160c090960151949593949293919290919086600160a060020a03811615156100fb57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f4f7267616e697a6174696f6e20636f6e74726163742061646472657373206d7560448201527f7374206e6f74206265207a65726f2e0000000000000000000000000000000000606482015290519081900360840190fd5b60008054600160a060020a031916600160a060020a039283161790558616151561018657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f546f6b656e2061646472657373206973206e756c6c2e00000000000000000000604482015290519081900360640190fd5b7fffffff00000000000000000000000000000000000000000000000000000000008516151561021657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f426173652063757272656e637920636f6465206973206e756c6c2e0000000000604482015290519081900360640190fd5b8315156102aa57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603960248201527f436f6e76657273696f6e20726174652066726f6d20746865206261736520637560448201527f7272656e637920746f2074686520746f6b656e20697320302e00000000000000606482015290519081900360840190fd5b600160a060020a038116151561032157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f546f6b656e2072756c65732061646472657373206973206e756c6c2e00000000604482015290519081900360640190fd5b60018054600160a060020a03978816600160a060020a0319909116179055600080547d010000000000000000000000000000000000000000000000000000000000909604740100000000000000000000000000000000000000000260a060020a62ffffff02199096169590951790945560029290925560ff90811660035560048054939094166101000261010060a860020a03199290911660ff1990931692909217161790555061149d806103d76000396000f3fe6080604052600436106100b65763ffffffff60e060020a60003504166306a2768781146100bb5780631e82d63d1461010157806323bd4d7a146101365780635a887047146101675780635a8f940814610256578063612367bf1461026b578063780e2e2e1461029f5780637db547c7146102b45780639c144d5e146102e8578063bb716ef4146102fd578063e5c379d814610337578063f07478af14610362578063f756eb7314610396578063fabdb613146103ab575b600080fd5b3480156100c757600080fd5b506100ef600480360360208110156100de57600080fd5b5035600160e860020a0319166103dd565b60408051918252519081900360200190f35b34801561010d57600080fd5b506101346004803603602081101561012457600080fd5b5035600160a060020a03166103ef565b005b34801561014257600080fd5b5061014b6108eb565b60408051600160a060020a039092168252519081900360200190f35b34801561017357600080fd5b50610134600480360360a081101561018a57600080fd5b600160a060020a0382351691908101906040810160208201356401000000008111156101b557600080fd5b8201836020820111156101c757600080fd5b803590602001918460208302840111640100000000831117156101e957600080fd5b91939092909160208101903564010000000081111561020757600080fd5b82018360208201111561021957600080fd5b8035906020019184602083028401116401000000008311171561023b57600080fd5b9193509150600160e860020a031981351690602001356108fa565b34801561026257600080fd5b5061014b610cb8565b34801561027757600080fd5b5061014b6004803603602081101561028e57600080fd5b5035600160e860020a031916610cc7565b3480156102ab57600080fd5b506100ef610ce2565b3480156102c057600080fd5b50610134600480360360208110156102d757600080fd5b5035600160e860020a031916610ce8565b3480156102f457600080fd5b5061014b610e6f565b34801561030957600080fd5b506101346004803603604081101561032057600080fd5b50600160e860020a03198135169060200135610e83565b34801561034357600080fd5b5061034c611010565b6040805160ff9092168252519081900360200190f35b34801561036e57600080fd5b506101346004803603602081101561038557600080fd5b5035600160e860020a031916611019565b3480156103a257600080fd5b506100ef611201565b3480156103b757600080fd5b506103c0611207565b60408051600160e860020a03199092168252519081900360200190f35b60066020526000908152604090205481565b6000546040805160e060020a63aa1566450281523360048201529051600160a060020a039092169163aa15664591602480820192602092909190829003018186803b15801561043d57600080fd5b505afa158015610451573d6000803e3d6000fd5b505050506040513d602081101561046757600080fd5b505115156104c1576040805160e560020a62461bcd02815260206004820152603960248201526000805160206114528339815191526044820152600080516020611432833981519152606482015290519081900360840190fd5b600160a060020a0381161515610521576040805160e560020a62461bcd02815260206004820152601d60248201527f5072696365206f7261636c652061646472657373206973206e756c6c2e000000604482015290519081900360640190fd5b60048054604080517f313ce567000000000000000000000000000000000000000000000000000000008152905160ff90921692600160a060020a0385169263313ce567928083019260209291829003018186803b15801561058157600080fd5b505afa158015610595573d6000803e3d6000fd5b505050506040513d60208110156105ab57600080fd5b505160ff1614610651576040805160e560020a62461bcd02815260206004820152604160248201527f5072696365206f7261636c6520646563696d616c73206e756d6265722069732060448201527f646966666572656e63652066726f6d20746865207265717569726564206f6e6560648201527f2e00000000000000000000000000000000000000000000000000000000000000608482015290519081900360a40190fd5b600081600160a060020a03166382564bca6040518163ffffffff1660e060020a02815260040160206040518083038186803b15801561068f57600080fd5b505afa1580156106a3573d6000803e3d6000fd5b505050506040513d60208110156106b957600080fd5b5051600160e860020a03198116600090815260056020526040902054909150600160a060020a031615610736576040805160e560020a62461bcd02815260206004820152601c60248201527f5072696365206f7261636c6520616c7265616479206578697374732e00000000604482015290519081900360640190fd5b600060149054906101000a90047d010000000000000000000000000000000000000000000000000000000000027cffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191682600160a060020a03166392a85fde6040518163ffffffff1660e060020a02815260040160206040518083038186803b1580156107bf57600080fd5b505afa1580156107d3573d6000803e3d6000fd5b505050506040513d60208110156107e957600080fd5b5051600160e860020a03191614610870576040805160e560020a62461bcd02815260206004820152603160248201527f5072696365206f7261636c65277320626173652063757272656e637920636f6460448201527f6520646f6573206e6f74206d617463682e000000000000000000000000000000606482015290519081900360840190fd5b600160e860020a03198116600090815260056020908152604091829020805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038616908117909155825190815291517facf23cc5480d1d549f783a7bd5430fec8c74f0044e925e78beb6733023a105159281900390910190a15050565b600054600160a060020a031681565b600160a060020a038716151561095a576040805160e560020a62461bcd02815260206004820152601560248201527f46726f6d2061646472657373206973206e756c6c2e0000000000000000000000604482015290519081900360640190fd5b8483146109d7576040805160e560020a62461bcd02815260206004820152603960248201527f27746f2720616e642027616d6f756e7427207472616e7366657220617272617960448201527f7327206c656e6774687320617265206e6f7420657175616c2e00000000000000606482015290519081900360840190fd5b8415156109e357610caf565b60006109ee83611245565b9050801515610a6d576040805160e560020a62461bcd02815260206004820152602960248201527f426173652063757272656e637920707269636520696e2070617920637572726560448201527f6e637920697320302e0000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600160e860020a03198316600090815260066020526040902054610a949083908390611354565b1515610b36576040805160e560020a62461bcd02815260206004820152604160248201527f496e74656e646564207072696365206973206e6f7420696e207468652061636360448201527f65707461626c65206d617267696e207772742063757272656e7420707269636560648201527f2e00000000000000000000000000000000000000000000000000000000000000608482015290519081900360a40190fd5b604080518581526020808702820101909152606090858015610b62578160200160208202803883390190505b50905060005b85811015610bac57610b8c83888884818110610b8057fe5b90506020020135611394565b8282815181101515610b9a57fe5b60209081029091010152600101610b68565b50600480546040517fa6a192da000000000000000000000000000000000000000000000000000000008152600160a060020a038c8116938201938452606060248301908152606483018c9052610100909304169263a6a192da928d928d928d92889260448101906084018660208702808284376000838201819052601f909101601f1916909201858103845286518152865160209182019382890193509102908190849084905b83811015610c6b578181015183820152602001610c53565b505050509050019650505050505050600060405180830381600087803b158015610c9457600080fd5b505af1158015610ca8573d6000803e3d6000fd5b5050505050505b50505050505050565b600154600160a060020a031681565b600560205260009081526040902054600160a060020a031681565b60025481565b6000546040805160e060020a63aa1566450281523360048201529051600160a060020a039092169163aa15664591602480820192602092909190829003018186803b158015610d3657600080fd5b505afa158015610d4a573d6000803e3d6000fd5b505050506040513d6020811015610d6057600080fd5b50511515610dba576040805160e560020a62461bcd02815260206004820152603960248201526000805160206114528339815191526044820152600080516020611432833981519152606482015290519081900360840190fd5b600160e860020a031981161515610e1b576040805160e560020a62461bcd02815260206004820152601a60248201527f5061792063757272656e637920636f6465206973206e756c6c2e000000000000604482015290519081900360640190fd5b600160e860020a03198116600081815260066020908152604080832092909255815192835290517f2c48f41fb0ac91148a38a270c2227239ead8136223f9b12cf603e57c799d5e609281900390910190a150565b6004546101009004600160a060020a031681565b6000546040805160e060020a63aa1566450281523360048201529051600160a060020a039092169163aa15664591602480820192602092909190829003018186803b158015610ed157600080fd5b505afa158015610ee5573d6000803e3d6000fd5b505050506040513d6020811015610efb57600080fd5b50511515610f55576040805160e560020a62461bcd02815260206004820152603960248201526000805160206114528339815191526044820152600080516020611432833981519152606482015290519081900360840190fd5b600160e860020a031982161515610fb6576040805160e560020a62461bcd02815260206004820152601a60248201527f5061792063757272656e637920636f6465206973206e756c6c2e000000000000604482015290519081900360640190fd5b600160e860020a031982166000818152600660209081526040918290208490558151928352820183905280517f9342d2e77f78a211818c17938619fcbb5d57089d24841841df0ff3fa4b13b1639281900390910190a15050565b60045460ff1681565b6000546040805160e060020a63aa1566450281523360048201529051600160a060020a039092169163aa15664591602480820192602092909190829003018186803b15801561106757600080fd5b505afa15801561107b573d6000803e3d6000fd5b505050506040513d602081101561109157600080fd5b505115156110eb576040805160e560020a62461bcd02815260206004820152603960248201526000805160206114528339815191526044820152600080516020611432833981519152606482015290519081900360840190fd5b600160e860020a03198116600090815260056020526040902054600160a060020a031680151561118b576040805160e560020a62461bcd02815260206004820152602660248201527f5072696365206f7261636c6520746f2072656d6f766520646f6573206e6f742060448201527f65786973742e0000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600160e860020a03198216600090815260056020908152604091829020805473ffffffffffffffffffffffffffffffffffffffff191690558151600160a060020a038416815291517f1ab93c820592302b2bef0070dd03654585b6942bfde155498ddd3d69190bf0429281900390910190a15050565b60035481565b6000547401000000000000000000000000000000000000000090047d0100000000000000000000000000000000000000000000000000000000000281565b600160e860020a03198116600090815260056020526040812054600160a060020a03168015156112e5576040805160e560020a62461bcd02815260206004820152603c60248201527f5072696365206f7261636c6520666f722074686520737065636966696564206360448201527f757272656e637920636f646520646f6573206e6f742065786973742e00000000606482015290519081900360840190fd5b80600160a060020a03166398d5fdca6040518163ffffffff1660e060020a02815260040160206040518083038186803b15801561132157600080fd5b505afa158015611335573d6000803e3d6000fd5b505050506040513d602081101561134b57600080fd5b50519392505050565b600080848411156113765761136f848663ffffffff6113cd16565b9050611389565b611386858563ffffffff6113cd16565b90505b909110159392505050565b60006113c4836113b8600354600a0a6113b8600254876113e290919063ffffffff16565b9063ffffffff61140d16565b90505b92915050565b6000828211156113dc57600080fd5b50900390565b60008215156113f3575060006113c7565b82820282848281151561140257fe5b04146113c457600080fd5b600080821161141b57600080fd5b6000828481151561142857fe5b0494935050505056fe6f77656420746f2063616c6c2074686973206d6574686f642e000000000000004f6e6c792077686974656c697374656420776f726b6572732061726520616c6ca165627a7a72305820d82bbf0c833b30f96cb34eebfe47f81dd69e5a8df0cd58c79b985533212eb0c10029 \ No newline at end of file diff --git a/contracts/bin/ProxyFactory.bin b/contracts/bin/ProxyFactory.bin index 63c7757..58fe985 100644 --- a/contracts/bin/ProxyFactory.bin +++ b/contracts/bin/ProxyFactory.bin @@ -1 +1 @@ -0x608060405234801561001057600080fd5b5061048e806100206000396000f3fe6080604052600436106100405763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166361b69abd8114610045575b600080fd5b34801561005157600080fd5b506101156004803603604081101561006857600080fd5b73ffffffffffffffffffffffffffffffffffffffff82351691908101906040810160208201356401000000008111156100a057600080fd5b8201836020820111156100b257600080fd5b803590602001918460018302840111640100000000831117156100d457600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061013e945050505050565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b600073ffffffffffffffffffffffffffffffffffffffff831615156101c457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f4d617374657220636f70792061646472657373206973206e756c6c2e00000000604482015290519081900360640190fd5b826101cd61027d565b73ffffffffffffffffffffffffffffffffffffffff909116815260405190819003602001906000f080158015610207573d6000803e3d6000fd5b50905060008251111561022f5760008060008451602086016000865af1141561022f57600080fd5b6040805173ffffffffffffffffffffffffffffffffffffffff8316815290517efffc2da0b561cae30d9826d37709e9421c4725faebc226cbbb7ef5fc5e73499181900360200190a192915050565b6040516101d58061028e8339019056fe608060405234801561001057600080fd5b506040516020806101d58339810180604052602081101561003057600080fd5b5051600160a060020a03811615156100a957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f4d617374657220636f70792061646472657373206973206e756c6c2e00000000604482015290519081900360640190fd5b60008054600160a060020a03909216600160a060020a031990921691909117905560fd806100d86000396000f3fe608060405260043610603e5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663a619486e8114607a575b73ffffffffffffffffffffffffffffffffffffffff600054163660008037600080366000845af43d6000803e8015156075573d6000fd5b3d6000f35b348015608557600080fd5b50608c60b5565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b60005473ffffffffffffffffffffffffffffffffffffffff168156fea165627a7a72305820eb990995fbf08f8cf0abe217a80dc901bb5b96fcdac0cc3d3239573815798cdc0029a165627a7a7230582093d04a3929e3148a667e1bf9e8c19fc4cbf697ef8f628b3e2c386b5dae55b1de0029 \ No newline at end of file +0x608060405234801561001057600080fd5b5061048e806100206000396000f3fe6080604052600436106100405763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166361b69abd8114610045575b600080fd5b34801561005157600080fd5b506101156004803603604081101561006857600080fd5b73ffffffffffffffffffffffffffffffffffffffff82351691908101906040810160208201356401000000008111156100a057600080fd5b8201836020820111156100b257600080fd5b803590602001918460018302840111640100000000831117156100d457600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061013e945050505050565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b600073ffffffffffffffffffffffffffffffffffffffff831615156101c457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f4d617374657220636f70792061646472657373206973206e756c6c2e00000000604482015290519081900360640190fd5b826101cd61027d565b73ffffffffffffffffffffffffffffffffffffffff909116815260405190819003602001906000f080158015610207573d6000803e3d6000fd5b50905060008251111561022f5760008060008451602086016000865af1141561022f57600080fd5b6040805173ffffffffffffffffffffffffffffffffffffffff8316815290517efffc2da0b561cae30d9826d37709e9421c4725faebc226cbbb7ef5fc5e73499181900360200190a192915050565b6040516101d58061028e8339019056fe608060405234801561001057600080fd5b506040516020806101d58339810180604052602081101561003057600080fd5b5051600160a060020a03811615156100a957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f4d617374657220636f70792061646472657373206973206e756c6c2e00000000604482015290519081900360640190fd5b60008054600160a060020a03909216600160a060020a031990921691909117905560fd806100d86000396000f3fe608060405260043610603e5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663a619486e8114607a575b73ffffffffffffffffffffffffffffffffffffffff600054163660008037600080366000845af43d6000803e8015156075573d6000fd5b3d6000f35b348015608557600080fd5b50608c60b5565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b60005473ffffffffffffffffffffffffffffffffffffffff168156fea165627a7a72305820eb990995fbf08f8cf0abe217a80dc901bb5b96fcdac0cc3d3239573815798cdc0029a165627a7a72305820a2b3a9ec1600033900a730b23095a01a2ff7ca3f834ef1a1bc881ff1ed8800080029 \ No newline at end of file diff --git a/contracts/bin/TokenHolder.bin b/contracts/bin/TokenHolder.bin index ac410e7..9ff8827 100644 --- a/contracts/bin/TokenHolder.bin +++ b/contracts/bin/TokenHolder.bin @@ -1 +1 @@ -0x608060405234801561001057600080fd5b5061198a806100206000396000f3fe6080604052600436106100ab5763ffffffff60e060020a600035041663028c979d81146100b05780631f3c99c3146100f15780631fa5d6a41461010657806351491e0c146101395780635c0a60f91461018057806360c30e8f146102c257806389aa2af01461036b5780638da5cb5b1461039257806397ebe030146103c35780639c144d5e14610458578063a2d2ff681461046d578063b7b8d60414610482578063fc0c546a146104db575b600080fd5b3480156100bc57600080fd5b506100ef600480360360608110156100d357600080fd5b50600160a060020a0381351690602081013590604001356104f0565b005b3480156100fd57600080fd5b506100ef610562565b34801561011257600080fd5b506100ef6004803603602081101561012957600080fd5b5035600160a060020a0316610612565b34801561014557600080fd5b5061014e610742565b604080517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff199092168252519081900360200190f35b34801561018c57600080fd5b506100ef600480360360c08110156101a357600080fd5b600160a060020a03823581169260208101358216926040820135909216918101906080810160608201356401000000008111156101df57600080fd5b8201836020820111156101f157600080fd5b8035906020019184602083028401116401000000008311171561021357600080fd5b91939092909160208101903564010000000081111561023157600080fd5b82018360208201111561024357600080fd5b8035906020019184602083028401116401000000008311171561026557600080fd5b91939092909160208101903564010000000081111561028357600080fd5b82018360208201111561029557600080fd5b803590602001918460208302840111640100000000831117156102b757600080fd5b50909250905061079d565b610357600480360360c08110156102d857600080fd5b600160a060020a03823516919081019060408101602082013564010000000081111561030357600080fd5b82018360208201111561031557600080fd5b8035906020019184600183028401116401000000008311171561033757600080fd5b91935091508035906020810135906040810135906060013560ff16610b4a565b604080519115158252519081900360200190f35b34801561037757600080fd5b50610380610f33565b60408051918252519081900360200190f35b34801561039e57600080fd5b506103a7610f39565b60408051600160a060020a039092168252519081900360200190f35b610357600480360360c08110156103d957600080fd5b600160a060020a03823516919081019060408101602082013564010000000081111561040457600080fd5b82018360208201111561041657600080fd5b8035906020019184600183028401116401000000008311171561043857600080fd5b91935091508035906020810135906040810135906060013560ff16610f48565b34801561046457600080fd5b506103a7611403565b34801561047957600080fd5b5061014e611412565b34801561048e57600080fd5b506104b5600480360360208110156104a557600080fd5b5035600160a060020a031661146d565b604080519485526020850193909352838301919091526060830152519081900360800190f35b3480156104e757600080fd5b506103a7611496565b600554600160a060020a03163314610552576040805160e560020a62461bcd02815260206004820152601e60248201527f4f6e6c79206f776e657220697320616c6c6f77656420746f2063616c6c2e0000604482015290519081900360640190fd5b61055d8383836114a5565b505050565b600554600160a060020a031633146105c4576040805160e560020a62461bcd02815260206004820152601e60248201527f4f6e6c79206f776e657220697320616c6c6f77656420746f2063616c6c2e0000604482015290519081900360640190fd5b60025460408051918252517f4fdc3ae5b88cfb88e6fd0018782bd67575d1f425d78385735194b2607f7eda739181900360200190a160025461060d90600163ffffffff61166b16565b600255565b600554600160a060020a03163314610674576040805160e560020a62461bcd02815260206004820152601e60248201527f4f6e6c79206f776e657220697320616c6c6f77656420746f2063616c6c2e0000604482015290519081900360640190fd5b806001600160a060020a03821660009081526003602081905260409091200154116106e9576040805160e560020a62461bcd02815260206004820152601660248201527f4b6579206973206e6f7420617574686f72697a65642e00000000000000000000604482015290519081900360640190fd5b600160a060020a0382166000818152600360208181526040928390206001920191909155815192835290517f2991ab7bfda4556c9e662762b3dfa89a1df391084c4278286d466c1c187e55239281900390910190a15050565b604080517f6578656375746552756c6528616464726573732c62797465732c75696e74323581527f362c75696e74382c627974657333322c627974657333322900000000000000006020820152905190819003603801902081565b600154600160a060020a03161580156107bf5750600554600160a060020a0316155b80156107d45750600454600160a060020a0316155b151561082a576040805160e560020a62461bcd02815260206004820181905260248201527f436f6e747261637420686173206265656e20616c72656164792073657475702e604482015290519081900360640190fd5b600160a060020a038916151561088a576040805160e560020a62461bcd02815260206004820152601f60248201527f546f6b656e20636f6e74726163742061646472657373206973206e756c6c2e00604482015290519081900360640190fd5b600160a060020a038816151561090f576040805160e560020a62461bcd028152602060048201526024808201527f546f6b656e52756c657320636f6e74726163742061646472657373206973206e60448201527f756c6c2e00000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600160a060020a038716151561096f576040805160e560020a62461bcd02815260206004820152601660248201527f4f776e65722061646472657373206973206e756c6c2e00000000000000000000604482015290519081900360640190fd5b8483146109ec576040805160e560020a62461bcd02815260206004820152603e60248201527f53657373696f6e206b65797320616e64207370656e64696e67206c696d69747360448201527f20617272617973206c656e677468732061726520646966666572656e742e0000606482015290519081900360840190fd5b848114610a8f576040805160e560020a62461bcd02815260206004820152604160248201527f53657373696f6e206b65797320616e642065787069726174696f6e206865696760448201527f68747320617272617973206c656e677468732061726520646966666572656e7460648201527f2e00000000000000000000000000000000000000000000000000000000000000608482015290519081900360a40190fd5b60018054600160a060020a03808c1673ffffffffffffffffffffffffffffffffffffffff1992831617909255600480548b841690831617905560058054928a16929091169190911790556002805560005b85811015610b3e57610b36878783818110610af757fe5b90506020020135600160a060020a03168686848181101515610b1557fe5b905060200201358585858181101515610b2a57fe5b905060200201356114a5565b600101610ae0565b50505050505050505050565b600080600160009054906101000a9004600160a060020a0316600160a060020a03166384f48d6a6040518163ffffffff1660e060020a02815260040160206040518083038186803b158015610b9e57600080fd5b505afa158015610bb2573d6000803e3d6000fd5b505050506040513d6020811015610bc857600080fd5b50519050600160a060020a0389811690821614610c55576040805160e560020a62461bcd02815260206004820152602660248201527f27746f272061646472657373206973206e6f7420636f4761746577617920616460448201527f64726573732e0000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600080610cfa60405180807f65786563757465526564656d7074696f6e28616464726573732c62797465732c81526020017f75696e743235362c75696e74382c627974657333322c62797465733332290000815250603e01905060405180910390208c8c8c8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508e92508d91508c90508b611684565b9150915060006003600083600160a060020a0316600160a060020a031681526020019081526020016000209050600160009054906101000a9004600160a060020a0316600160a060020a031663095ea7b38d83600001546040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b158015610da357600080fd5b505af1158015610db7573d6000803e3d6000fd5b505050506040513d6020811015610dcd57600080fd5b5050604051606090600160a060020a038e169034908e908e90808383808284376040519201945060009350909150508083038185875af1925050503d8060008114610e34576040519150601f19603f3d011682016040523d82523d6000602084013e610e39565b606091505b508092508197505050600160009054906101000a9004600160a060020a0316600160a060020a031663095ea7b38e60006040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b158015610ebb57600080fd5b505af1158015610ecf573d6000803e3d6000fd5b505050506040513d6020811015610ee557600080fd5b505060408051858152871515602082015281517f23a87d3083eafe50e6f601373e38cd7afe8a0725d15d3f8b097a83f03acdb064929181900390910190a15050505050979650505050505050565b60025481565b600554600160a060020a031681565b600154600090600160a060020a0389811691161415610fd7576040805160e560020a62461bcd02815260206004820152602660248201527f27746f272061646472657373206973207574696c69747920746f6b656e20616460448201527f64726573732e0000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600160a060020a03881630141561105e576040805160e560020a62461bcd02815260206004820152602b60248201527f27746f27206164647265737320697320546f6b656e486f6c646572206164647260448201527f65737320697473656c662e000000000000000000000000000000000000000000606482015290519081900360840190fd5b60008061110360405180807f6578656375746552756c6528616464726573732c62797465732c75696e74323581526020017f362c75696e74382c627974657333322c62797465733332290000000000000000815250603801905060405180910390208b8b8b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508d92508c91508b90508a611684565b600160a060020a038082166000908152600360205260408082206004805483517f2185810b000000000000000000000000000000000000000000000000000000008152935197995095975090959490931693632185810b93828101939282900301818387803b15801561117557600080fd5b505af1158015611189573d6000803e3d6000fd5b5050600154600480548554604080517f095ea7b3000000000000000000000000000000000000000000000000000000008152600160a060020a03938416948101949094526024840191909152519216935063095ea7b392506044808201926020929091908290030181600087803b15801561120357600080fd5b505af1158015611217573d6000803e3d6000fd5b505050506040513d602081101561122d57600080fd5b5050604051606090600160a060020a038d169034908d908d90808383808284376040519201945060009350909150508083038185875af1925050503d8060008114611294576040519150601f19603f3d011682016040523d82523d6000602084013e611299565b606091505b5060015460048054604080517f095ea7b3000000000000000000000000000000000000000000000000000000008152600160a060020a03928316938101939093526000602484018190529051959a509395509091169263095ea7b392604480840193602093929083900390910190829087803b15801561131857600080fd5b505af115801561132c573d6000803e3d6000fd5b505050506040513d602081101561134257600080fd5b505060048054604080517f212c81570000000000000000000000000000000000000000000000000000000081529051600160a060020a039092169263212c815792828201926000929082900301818387803b1580156113a057600080fd5b505af11580156113b4573d6000803e3d6000fd5b505060408051878152881515602082015281517f36cd2662860eb4ad66890c2d0ac0af9dde2f8927a7190e1eaed43ce9d43682b19450908190039091019150a150505050979650505050505050565b600454600160a060020a031681565b604080517f65786563757465526564656d7074696f6e28616464726573732c62797465732c81527f75696e743235362c75696e74382c627974657333322c627974657333322900006020820152905190819003603e01902081565b600360208190526000918252604090912080546001820154600283015492909301549092919084565b600154600160a060020a031681565b82600160a060020a0381161515611506576040805160e560020a62461bcd02815260206004820152601460248201527f4b65792061646472657373206973206e756c6c2e000000000000000000000000604482015290519081900360640190fd5b836000600160a060020a038216600090815260036020819052604090912001541461157b576040805160e560020a62461bcd02815260206004820152600b60248201527f4b6579206578697374732e000000000000000000000000000000000000000000604482015290519081900360640190fd5b4383116115f8576040805160e560020a62461bcd02815260206004820152603560248201527f45787069726174696f6e20686569676874206973206c746520746f207468652060448201527f63757272656e7420626c6f636b206865696768742e0000000000000000000000606482015290519081900360840190fd5b600160a060020a0385166000818152600360208181526040808420898155600181018990556002808201959095559354928401929092558151938452905191927faaf20b4ab9461ac8240a308f4bae35956040be348d648df2aa88137418189887929081900390910190a1505050505050565b60008282018381101561167d57600080fd5b9392505050565b60008061169a8989898051906020012089611884565b915060018284878760405160008152602001604052604051808581526020018460ff1660ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa1580156116f9573d6000803e3d6000fd5b505060408051601f190151600160a060020a038116600090815260036020819052929020600254928101549194509250146117a4576040805160e560020a62461bcd02815260206004820152603860248201527f4b657927732073657373696f6e206973206e6f7420657175616c20746f20636f60448201527f6e747261637427732073657373696f6e2077696e646f772e0000000000000000606482015290519081900360840190fd5b600181015443106117ff576040805160e560020a62461bcd02815260206004820152601860248201527f53657373696f6e206b65792077617320657870697265642e0000000000000000604482015290519081900360640190fd5b6002810154871461185a576040805160e560020a62461bcd02815260206004820152601d60248201527f496e636f7272656374206e6f6e6365206973207370656369666965642e000000604482015290519081900360640190fd5b600281015461187090600163ffffffff61166b16565b600290910155909890975095505050505050565b604080517f19000000000000000000000000000000000000000000000000000000000000006020808301919091526000602183018190526c010000000000000000000000003081026022850152600160a060020a039097169096026036830152604a8201869052604b820194909452606b810192909252608b8201849052608c8201849052608d82018490527bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19909416608e820152609281018390526093808201939093528351808203909301835260b30190925280519101209056fea165627a7a723058204f6a55fb77b6160849cea39cf95d729484634c77487355b7d41814e19a18b9200029 \ No newline at end of file +0x608060405234801561001057600080fd5b5061198a806100206000396000f3fe6080604052600436106100ab5763ffffffff60e060020a600035041663028c979d81146100b05780631f3c99c3146100f15780631fa5d6a41461010657806351491e0c146101395780635c0a60f91461018057806360c30e8f146102c257806389aa2af01461036b5780638da5cb5b1461039257806397ebe030146103c35780639c144d5e14610458578063a2d2ff681461046d578063b7b8d60414610482578063fc0c546a146104db575b600080fd5b3480156100bc57600080fd5b506100ef600480360360608110156100d357600080fd5b50600160a060020a0381351690602081013590604001356104f0565b005b3480156100fd57600080fd5b506100ef610562565b34801561011257600080fd5b506100ef6004803603602081101561012957600080fd5b5035600160a060020a0316610612565b34801561014557600080fd5b5061014e610742565b604080517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff199092168252519081900360200190f35b34801561018c57600080fd5b506100ef600480360360c08110156101a357600080fd5b600160a060020a03823581169260208101358216926040820135909216918101906080810160608201356401000000008111156101df57600080fd5b8201836020820111156101f157600080fd5b8035906020019184602083028401116401000000008311171561021357600080fd5b91939092909160208101903564010000000081111561023157600080fd5b82018360208201111561024357600080fd5b8035906020019184602083028401116401000000008311171561026557600080fd5b91939092909160208101903564010000000081111561028357600080fd5b82018360208201111561029557600080fd5b803590602001918460208302840111640100000000831117156102b757600080fd5b50909250905061079d565b610357600480360360c08110156102d857600080fd5b600160a060020a03823516919081019060408101602082013564010000000081111561030357600080fd5b82018360208201111561031557600080fd5b8035906020019184600183028401116401000000008311171561033757600080fd5b91935091508035906020810135906040810135906060013560ff16610b4a565b604080519115158252519081900360200190f35b34801561037757600080fd5b50610380610f33565b60408051918252519081900360200190f35b34801561039e57600080fd5b506103a7610f39565b60408051600160a060020a039092168252519081900360200190f35b610357600480360360c08110156103d957600080fd5b600160a060020a03823516919081019060408101602082013564010000000081111561040457600080fd5b82018360208201111561041657600080fd5b8035906020019184600183028401116401000000008311171561043857600080fd5b91935091508035906020810135906040810135906060013560ff16610f48565b34801561046457600080fd5b506103a7611403565b34801561047957600080fd5b5061014e611412565b34801561048e57600080fd5b506104b5600480360360208110156104a557600080fd5b5035600160a060020a031661146d565b604080519485526020850193909352838301919091526060830152519081900360800190f35b3480156104e757600080fd5b506103a7611496565b600554600160a060020a03163314610552576040805160e560020a62461bcd02815260206004820152601e60248201527f4f6e6c79206f776e657220697320616c6c6f77656420746f2063616c6c2e0000604482015290519081900360640190fd5b61055d8383836114a5565b505050565b600554600160a060020a031633146105c4576040805160e560020a62461bcd02815260206004820152601e60248201527f4f6e6c79206f776e657220697320616c6c6f77656420746f2063616c6c2e0000604482015290519081900360640190fd5b60025460408051918252517f4fdc3ae5b88cfb88e6fd0018782bd67575d1f425d78385735194b2607f7eda739181900360200190a160025461060d90600163ffffffff61166b16565b600255565b600554600160a060020a03163314610674576040805160e560020a62461bcd02815260206004820152601e60248201527f4f6e6c79206f776e657220697320616c6c6f77656420746f2063616c6c2e0000604482015290519081900360640190fd5b806001600160a060020a03821660009081526003602081905260409091200154116106e9576040805160e560020a62461bcd02815260206004820152601660248201527f4b6579206973206e6f7420617574686f72697a65642e00000000000000000000604482015290519081900360640190fd5b600160a060020a0382166000818152600360208181526040928390206001920191909155815192835290517f2991ab7bfda4556c9e662762b3dfa89a1df391084c4278286d466c1c187e55239281900390910190a15050565b604080517f6578656375746552756c6528616464726573732c62797465732c75696e74323581527f362c75696e74382c627974657333322c627974657333322900000000000000006020820152905190819003603801902081565b600154600160a060020a03161580156107bf5750600554600160a060020a0316155b80156107d45750600454600160a060020a0316155b151561082a576040805160e560020a62461bcd02815260206004820181905260248201527f436f6e747261637420686173206265656e20616c72656164792073657475702e604482015290519081900360640190fd5b600160a060020a038916151561088a576040805160e560020a62461bcd02815260206004820152601f60248201527f546f6b656e20636f6e74726163742061646472657373206973206e756c6c2e00604482015290519081900360640190fd5b600160a060020a038816151561090f576040805160e560020a62461bcd028152602060048201526024808201527f546f6b656e52756c657320636f6e74726163742061646472657373206973206e60448201527f756c6c2e00000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600160a060020a038716151561096f576040805160e560020a62461bcd02815260206004820152601660248201527f4f776e65722061646472657373206973206e756c6c2e00000000000000000000604482015290519081900360640190fd5b8483146109ec576040805160e560020a62461bcd02815260206004820152603e60248201527f53657373696f6e206b65797320616e64207370656e64696e67206c696d69747360448201527f20617272617973206c656e677468732061726520646966666572656e742e0000606482015290519081900360840190fd5b848114610a8f576040805160e560020a62461bcd02815260206004820152604160248201527f53657373696f6e206b65797320616e642065787069726174696f6e206865696760448201527f68747320617272617973206c656e677468732061726520646966666572656e7460648201527f2e00000000000000000000000000000000000000000000000000000000000000608482015290519081900360a40190fd5b60018054600160a060020a03808c1673ffffffffffffffffffffffffffffffffffffffff1992831617909255600480548b841690831617905560058054928a16929091169190911790556002805560005b85811015610b3e57610b36878783818110610af757fe5b90506020020135600160a060020a03168686848181101515610b1557fe5b905060200201358585858181101515610b2a57fe5b905060200201356114a5565b600101610ae0565b50505050505050505050565b600080600160009054906101000a9004600160a060020a0316600160a060020a03166384f48d6a6040518163ffffffff1660e060020a02815260040160206040518083038186803b158015610b9e57600080fd5b505afa158015610bb2573d6000803e3d6000fd5b505050506040513d6020811015610bc857600080fd5b50519050600160a060020a0389811690821614610c55576040805160e560020a62461bcd02815260206004820152602660248201527f27746f272061646472657373206973206e6f7420636f4761746577617920616460448201527f64726573732e0000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600080610cfa60405180807f65786563757465526564656d7074696f6e28616464726573732c62797465732c81526020017f75696e743235362c75696e74382c627974657333322c62797465733332290000815250603e01905060405180910390208c8c8c8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508e92508d91508c90508b611684565b9150915060006003600083600160a060020a0316600160a060020a031681526020019081526020016000209050600160009054906101000a9004600160a060020a0316600160a060020a031663095ea7b38d83600001546040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b158015610da357600080fd5b505af1158015610db7573d6000803e3d6000fd5b505050506040513d6020811015610dcd57600080fd5b5050604051606090600160a060020a038e169034908e908e90808383808284376040519201945060009350909150508083038185875af1925050503d8060008114610e34576040519150601f19603f3d011682016040523d82523d6000602084013e610e39565b606091505b508092508197505050600160009054906101000a9004600160a060020a0316600160a060020a031663095ea7b38e60006040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b158015610ebb57600080fd5b505af1158015610ecf573d6000803e3d6000fd5b505050506040513d6020811015610ee557600080fd5b505060408051858152871515602082015281517f23a87d3083eafe50e6f601373e38cd7afe8a0725d15d3f8b097a83f03acdb064929181900390910190a15050505050979650505050505050565b60025481565b600554600160a060020a031681565b600154600090600160a060020a0389811691161415610fd7576040805160e560020a62461bcd02815260206004820152602660248201527f27746f272061646472657373206973207574696c69747920746f6b656e20616460448201527f64726573732e0000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600160a060020a03881630141561105e576040805160e560020a62461bcd02815260206004820152602b60248201527f27746f27206164647265737320697320546f6b656e486f6c646572206164647260448201527f65737320697473656c662e000000000000000000000000000000000000000000606482015290519081900360840190fd5b60008061110360405180807f6578656375746552756c6528616464726573732c62797465732c75696e74323581526020017f362c75696e74382c627974657333322c62797465733332290000000000000000815250603801905060405180910390208b8b8b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508d92508c91508b90508a611684565b600160a060020a038082166000908152600360205260408082206004805483517f2185810b000000000000000000000000000000000000000000000000000000008152935197995095975090959490931693632185810b93828101939282900301818387803b15801561117557600080fd5b505af1158015611189573d6000803e3d6000fd5b5050600154600480548554604080517f095ea7b3000000000000000000000000000000000000000000000000000000008152600160a060020a03938416948101949094526024840191909152519216935063095ea7b392506044808201926020929091908290030181600087803b15801561120357600080fd5b505af1158015611217573d6000803e3d6000fd5b505050506040513d602081101561122d57600080fd5b5050604051606090600160a060020a038d169034908d908d90808383808284376040519201945060009350909150508083038185875af1925050503d8060008114611294576040519150601f19603f3d011682016040523d82523d6000602084013e611299565b606091505b5060015460048054604080517f095ea7b3000000000000000000000000000000000000000000000000000000008152600160a060020a03928316938101939093526000602484018190529051959a509395509091169263095ea7b392604480840193602093929083900390910190829087803b15801561131857600080fd5b505af115801561132c573d6000803e3d6000fd5b505050506040513d602081101561134257600080fd5b505060048054604080517f212c81570000000000000000000000000000000000000000000000000000000081529051600160a060020a039092169263212c815792828201926000929082900301818387803b1580156113a057600080fd5b505af11580156113b4573d6000803e3d6000fd5b505060408051878152881515602082015281517f36cd2662860eb4ad66890c2d0ac0af9dde2f8927a7190e1eaed43ce9d43682b19450908190039091019150a150505050979650505050505050565b600454600160a060020a031681565b604080517f65786563757465526564656d7074696f6e28616464726573732c62797465732c81527f75696e743235362c75696e74382c627974657333322c627974657333322900006020820152905190819003603e01902081565b600360208190526000918252604090912080546001820154600283015492909301549092919084565b600154600160a060020a031681565b82600160a060020a0381161515611506576040805160e560020a62461bcd02815260206004820152601460248201527f4b65792061646472657373206973206e756c6c2e000000000000000000000000604482015290519081900360640190fd5b836000600160a060020a038216600090815260036020819052604090912001541461157b576040805160e560020a62461bcd02815260206004820152600b60248201527f4b6579206578697374732e000000000000000000000000000000000000000000604482015290519081900360640190fd5b4383116115f8576040805160e560020a62461bcd02815260206004820152603560248201527f45787069726174696f6e20686569676874206973206c746520746f207468652060448201527f63757272656e7420626c6f636b206865696768742e0000000000000000000000606482015290519081900360840190fd5b600160a060020a0385166000818152600360208181526040808420898155600181018990556002808201959095559354928401929092558151938452905191927faaf20b4ab9461ac8240a308f4bae35956040be348d648df2aa88137418189887929081900390910190a1505050505050565b60008282018381101561167d57600080fd5b9392505050565b60008061169a8989898051906020012089611884565b915060018284878760405160008152602001604052604051808581526020018460ff1660ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa1580156116f9573d6000803e3d6000fd5b505060408051601f190151600160a060020a038116600090815260036020819052929020600254928101549194509250146117a4576040805160e560020a62461bcd02815260206004820152603860248201527f4b657927732073657373696f6e206973206e6f7420657175616c20746f20636f60448201527f6e747261637427732073657373696f6e2077696e646f772e0000000000000000606482015290519081900360840190fd5b600181015443106117ff576040805160e560020a62461bcd02815260206004820152601860248201527f53657373696f6e206b65792077617320657870697265642e0000000000000000604482015290519081900360640190fd5b6002810154871461185a576040805160e560020a62461bcd02815260206004820152601d60248201527f496e636f7272656374206e6f6e6365206973207370656369666965642e000000604482015290519081900360640190fd5b600281015461187090600163ffffffff61166b16565b600290910155909890975095505050505050565b604080517f19000000000000000000000000000000000000000000000000000000000000006020808301919091526000602183018190526c010000000000000000000000003081026022850152600160a060020a039097169096026036830152604a8201869052604b820194909452606b810192909252608b8201849052608c8201849052608d82018490527bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19909416608e820152609281018390526093808201939093528351808203909301835260b30190925280519101209056fea165627a7a723058202bc46049b0be756c816d9a274158a83bcff6d3db8a023faa29b9e6df820a9a330029 \ No newline at end of file diff --git a/contracts/bin/TokenRules.bin b/contracts/bin/TokenRules.bin index f795682..8d57ba0 100644 --- a/contracts/bin/TokenRules.bin +++ b/contracts/bin/TokenRules.bin @@ -1 +1 @@ -0x608060405234801561001057600080fd5b506040516040806116768339810180604052604081101561003057600080fd5b50805160209091015181600160a060020a03811615156100d757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f4f7267616e697a6174696f6e20636f6e74726163742061646472657373206d7560448201527f7374206e6f74206265207a65726f2e0000000000000000000000000000000000606482015290519081900360840190fd5b60008054600160a060020a031916600160a060020a039283161790558116151561016257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f546f6b656e2061646472657373206973206e756c6c2e00000000000000000000604482015290519081900360640190fd5b60048054600160a060020a031916600160a060020a0392909216919091179055506006805460ff191660011790556114d78061019f6000396000f3fe6080604052600436106100cf5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166304d6ded481146100d4578063212c8157146101f55780632185810b1461020c57806322f468ea1461022157806323bd4d7a146102645780633e290e5c14610295578063661309ac146103715780638486c223146103b857806394ac7a3f146103cd578063a6a192da1461049c578063aa7937671461057b578063b286e04714610590578063d6a7d226146105a5578063fc0c546a146105d8575b600080fd5b3480156100e057600080fd5b506100fe600480360360208110156100f757600080fd5b50356105ed565b604051808060200184600160a060020a0316600160a060020a0316815260200180602001838103835286818151815260200191508051906020019080838360005b8381101561015757818101518382015260200161013f565b50505050905090810190601f1680156101845780820380516001836020036101000a031916815260200191505b50838103825284518152845160209182019186019080838360005b838110156101b757818101518382015260200161019f565b50505050905090810190601f1680156101e45780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b34801561020157600080fd5b5061020a610742565b005b34801561021857600080fd5b5061020a61075b565b34801561022d57600080fd5b5061024b6004803603602081101561024457600080fd5b5035610777565b6040805192835290151560208301528051918290030190f35b34801561027057600080fd5b50610279610793565b60408051600160a060020a039092168252519081900360200190f35b3480156102a157600080fd5b5061020a600480360360608110156102b857600080fd5b8101906020810181356401000000008111156102d357600080fd5b8201836020820111156102e557600080fd5b8035906020019184600183028401116401000000008311171561030757600080fd5b91939092600160a060020a038335169260408101906020013564010000000081111561033257600080fd5b82018360208201111561034457600080fd5b8035906020019184600183028401116401000000008311171561036657600080fd5b5090925090506107a2565b34801561037d57600080fd5b506103a46004803603602081101561039457600080fd5b5035600160a060020a0316610d35565b604080519115158252519081900360200190f35b3480156103c457600080fd5b5061020a610d4a565b3480156103d957600080fd5b5061020a600480360360408110156103f057600080fd5b81019060208101813564010000000081111561040b57600080fd5b82018360208201111561041d57600080fd5b8035906020019184602083028401116401000000008311171561043f57600080fd5b91939092909160208101903564010000000081111561045d57600080fd5b82018360208201111561046f57600080fd5b8035906020019184602083028401116401000000008311171561049157600080fd5b509092509050610e65565b3480156104a857600080fd5b5061020a600480360360608110156104bf57600080fd5b600160a060020a0382351691908101906040810160208201356401000000008111156104ea57600080fd5b8201836020820111156104fc57600080fd5b8035906020019184602083028401116401000000008311171561051e57600080fd5b91939092909160208101903564010000000081111561053c57600080fd5b82018360208201111561054e57600080fd5b8035906020019184602083028401116401000000008311171561057057600080fd5b509092509050610f5b565b34801561058757600080fd5b5061020a611062565b34801561059c57600080fd5b506103a461117a565b3480156105b157600080fd5b5061024b600480360360208110156105c857600080fd5b5035600160a060020a0316611183565b3480156105e457600080fd5b5061027961119f565b60018054829081106105fb57fe5b60009182526020918290206003919091020180546040805160026001841615610100026000190190931692909204601f8101859004850283018501909152808252919350918391908301828280156106945780601f1061066957610100808354040283529160200191610694565b820191906000526020600020905b81548152906001019060200180831161067757829003601f168201915b505050506001838101546002808601805460408051602061010097841615979097026000190190921693909304601f81018690048602820186019093528281529596600160a060020a039093169592945091928301828280156107385780601f1061070d57610100808354040283529160200191610738565b820191906000526020600020905b81548152906001019060200180831161071b57829003601f168201915b5050505050905083565b336000908152600560205260409020805460ff19169055565b336000908152600560205260409020805460ff19166001179055565b6003602052600090815260409020805460019091015460ff1682565b600054600160a060020a031681565b600054604080517faa1566450000000000000000000000000000000000000000000000000000000081523360048201529051600160a060020a039092169163aa15664591602480820192602092909190829003018186803b15801561080657600080fd5b505afa15801561081a573d6000803e3d6000fd5b505050506040513d602081101561083057600080fd5b505115156108ae576040805160e560020a62461bcd02815260206004820152603960248201527f4f6e6c792077686974656c697374656420776f726b6572732061726520616c6c60448201527f6f77656420746f2063616c6c2074686973206d6574686f642e00000000000000606482015290519081900360840190fd5b831515610905576040805160e560020a62461bcd02815260206004820152601360248201527f52756c65206e616d6520697320656d7074792e00000000000000000000000000604482015290519081900360640190fd5b600160a060020a0383161515610965576040805160e560020a62461bcd02815260206004820152601560248201527f52756c652061646472657373206973206e756c6c2e0000000000000000000000604482015290519081900360640190fd5b8015156109bc576040805160e560020a62461bcd02815260206004820152601260248201527f52756c652041424920697320656d7074792e0000000000000000000000000000604482015290519081900360640190fd5b60008585604051602001808383808284376040805191909301818103601f190182528352805160209182012060008181526003909252929020600101549195505060ff16159250610a80915050576040805160e560020a62461bcd02815260206004820152602c60248201527f52756c6520776974682074686520737065636966696564206e616d6520616c7260448201527f65616479206578697374732e0000000000000000000000000000000000000000606482015290519081900360840190fd5b600160a060020a03841660009081526002602052604090206001015460ff1615610b1a576040805160e560020a62461bcd02815260206004820152602f60248201527f52756c652077697468207468652073706563696669656420616464726573732060448201527f616c7265616479206578697374732e0000000000000000000000000000000000606482015290519081900360840190fd5b610b226113da565b6040805160806020601f8a0181900402820181019092526060810188815290918291908a908a9081908501838280828437600092019190915250505090825250600160a060020a03871660208083019190915260408051601f8801839004830281018301825287815292019190879087908190840183828082843760009201919091525050509152509050610bb56113f9565b506040805180820182526001805482526020808301828152600160a060020a038a16600090815260028352858120855181558251908501805491151560ff1992831617905588825260038085529682208651815592519285018054931515939091169290921790915582548084018085559390915285518051949593948794929092027fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf60192610c6a92849290910190611410565b5060208281015160018301805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0390921691909117905560408301518051610cb69260028501920190611410565b505060408051600160a060020a038a1660208201528181529081018a90527f4d39292a7c76562755f38e419d757d846579699af484d88be86a1811dca7321592508a9150899089908060608101858580828437600083820152604051601f909101601f1916909201829003965090945050505050a15050505050505050565b60056020526000908152604090205460ff1681565b600054604080517faa1566450000000000000000000000000000000000000000000000000000000081523360048201529051600160a060020a039092169163aa15664591602480820192602092909190829003018186803b158015610dae57600080fd5b505afa158015610dc2573d6000803e3d6000fd5b505050506040513d6020811015610dd857600080fd5b50511515610e56576040805160e560020a62461bcd02815260206004820152603960248201527f4f6e6c792077686974656c697374656420776f726b6572732061726520616c6c60448201527f6f77656420746f2063616c6c2074686973206d6574686f642e00000000000000606482015290519081900360840190fd5b6006805460ff19166001179055565b60065460ff161515610ee7576040805160e560020a62461bcd02815260206004820152602160248201527f446972656374207472616e736665727320617265206e6f7420616c6c6f77656460448201527f2e00000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b610f5533858580806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250506040805160208089028281018201909352888252909350889250879182918501908490808284376000920191909152506111ae92505050565b50505050565b3360009081526002602052604090206001015460ff161515610fed576040805160e560020a62461bcd02815260206004820152602860248201527f4f6e6c7920726567697374657265642072756c6520697320616c6c6f7765642060448201527f746f2063616c6c2e000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b61105b85858580806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250506040805160208089028281018201909352888252909350889250879182918501908490808284376000920191909152506111ae92505050565b5050505050565b600054604080517faa1566450000000000000000000000000000000000000000000000000000000081523360048201529051600160a060020a039092169163aa15664591602480820192602092909190829003018186803b1580156110c657600080fd5b505afa1580156110da573d6000803e3d6000fd5b505050506040513d60208110156110f057600080fd5b5051151561116e576040805160e560020a62461bcd02815260206004820152603960248201527f4f6e6c792077686974656c697374656420776f726b6572732061726520616c6c60448201527f6f77656420746f2063616c6c2074686973206d6574686f642e00000000000000606482015290519081900360840190fd5b6006805460ff19169055565b60065460ff1681565b6002602052600090815260409020805460019091015460ff1682565b600454600160a060020a031681565b600160a060020a03831660009081526005602052604090205460ff161515611246576040805160e560020a62461bcd02815260206004820152602b60248201527f5472616e73666572732066726f6d20746865206164647265737320617265206e60448201527f6f7420616c6c6f7765642e000000000000000000000000000000000000000000606482015290519081900360840190fd5b80518251146112c5576040805160e560020a62461bcd02815260206004820152603960248201527f27746f2720616e642027616d6f756e7427207472616e7366657220617272617960448201527f7327206c656e6774687320617265206e6f7420657175616c2e00000000000000606482015290519081900360840190fd5b60005b82518110156113b6576004548351600160a060020a03909116906323b872dd9086908690859081106112f657fe5b90602001906020020151858581518110151561130e57fe5b6020908102909101810151604080517c010000000000000000000000000000000000000000000000000000000063ffffffff8816028152600160a060020a03958616600482015293909416602484015260448301529151606480830193928290030181600087803b15801561138257600080fd5b505af1158015611396573d6000803e3d6000fd5b505050506040513d60208110156113ac57600080fd5b50506001016112c8565b505050600160a060020a03166000908152600560205260409020805460ff19169055565b6040805160608181018352808252600060208301529181019190915290565b604080518082019091526000808252602082015290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061145157805160ff191683800117855561147e565b8280016001018555821561147e579182015b8281111561147e578251825591602001919060010190611463565b5061148a92915061148e565b5090565b6114a891905b8082111561148a5760008155600101611494565b9056fea165627a7a723058209dbad37b0eaa44a9119e9266bd51a457aafcc77ad0808217f5641f1b6e43285e0029 \ No newline at end of file +0x608060405234801561001057600080fd5b506040516040806116768339810180604052604081101561003057600080fd5b50805160209091015181600160a060020a03811615156100d757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f4f7267616e697a6174696f6e20636f6e74726163742061646472657373206d7560448201527f7374206e6f74206265207a65726f2e0000000000000000000000000000000000606482015290519081900360840190fd5b60008054600160a060020a031916600160a060020a039283161790558116151561016257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f546f6b656e2061646472657373206973206e756c6c2e00000000000000000000604482015290519081900360640190fd5b60048054600160a060020a031916600160a060020a0392909216919091179055506006805460ff191660011790556114d78061019f6000396000f3fe6080604052600436106100cf5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166304d6ded481146100d4578063212c8157146101f55780632185810b1461020c57806322f468ea1461022157806323bd4d7a146102645780633e290e5c14610295578063661309ac146103715780638486c223146103b857806394ac7a3f146103cd578063a6a192da1461049c578063aa7937671461057b578063b286e04714610590578063d6a7d226146105a5578063fc0c546a146105d8575b600080fd5b3480156100e057600080fd5b506100fe600480360360208110156100f757600080fd5b50356105ed565b604051808060200184600160a060020a0316600160a060020a0316815260200180602001838103835286818151815260200191508051906020019080838360005b8381101561015757818101518382015260200161013f565b50505050905090810190601f1680156101845780820380516001836020036101000a031916815260200191505b50838103825284518152845160209182019186019080838360005b838110156101b757818101518382015260200161019f565b50505050905090810190601f1680156101e45780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b34801561020157600080fd5b5061020a610742565b005b34801561021857600080fd5b5061020a61075b565b34801561022d57600080fd5b5061024b6004803603602081101561024457600080fd5b5035610777565b6040805192835290151560208301528051918290030190f35b34801561027057600080fd5b50610279610793565b60408051600160a060020a039092168252519081900360200190f35b3480156102a157600080fd5b5061020a600480360360608110156102b857600080fd5b8101906020810181356401000000008111156102d357600080fd5b8201836020820111156102e557600080fd5b8035906020019184600183028401116401000000008311171561030757600080fd5b91939092600160a060020a038335169260408101906020013564010000000081111561033257600080fd5b82018360208201111561034457600080fd5b8035906020019184600183028401116401000000008311171561036657600080fd5b5090925090506107a2565b34801561037d57600080fd5b506103a46004803603602081101561039457600080fd5b5035600160a060020a0316610d35565b604080519115158252519081900360200190f35b3480156103c457600080fd5b5061020a610d4a565b3480156103d957600080fd5b5061020a600480360360408110156103f057600080fd5b81019060208101813564010000000081111561040b57600080fd5b82018360208201111561041d57600080fd5b8035906020019184602083028401116401000000008311171561043f57600080fd5b91939092909160208101903564010000000081111561045d57600080fd5b82018360208201111561046f57600080fd5b8035906020019184602083028401116401000000008311171561049157600080fd5b509092509050610e65565b3480156104a857600080fd5b5061020a600480360360608110156104bf57600080fd5b600160a060020a0382351691908101906040810160208201356401000000008111156104ea57600080fd5b8201836020820111156104fc57600080fd5b8035906020019184602083028401116401000000008311171561051e57600080fd5b91939092909160208101903564010000000081111561053c57600080fd5b82018360208201111561054e57600080fd5b8035906020019184602083028401116401000000008311171561057057600080fd5b509092509050610f5b565b34801561058757600080fd5b5061020a611062565b34801561059c57600080fd5b506103a461117a565b3480156105b157600080fd5b5061024b600480360360208110156105c857600080fd5b5035600160a060020a0316611183565b3480156105e457600080fd5b5061027961119f565b60018054829081106105fb57fe5b60009182526020918290206003919091020180546040805160026001841615610100026000190190931692909204601f8101859004850283018501909152808252919350918391908301828280156106945780601f1061066957610100808354040283529160200191610694565b820191906000526020600020905b81548152906001019060200180831161067757829003601f168201915b505050506001838101546002808601805460408051602061010097841615979097026000190190921693909304601f81018690048602820186019093528281529596600160a060020a039093169592945091928301828280156107385780601f1061070d57610100808354040283529160200191610738565b820191906000526020600020905b81548152906001019060200180831161071b57829003601f168201915b5050505050905083565b336000908152600560205260409020805460ff19169055565b336000908152600560205260409020805460ff19166001179055565b6003602052600090815260409020805460019091015460ff1682565b600054600160a060020a031681565b600054604080517faa1566450000000000000000000000000000000000000000000000000000000081523360048201529051600160a060020a039092169163aa15664591602480820192602092909190829003018186803b15801561080657600080fd5b505afa15801561081a573d6000803e3d6000fd5b505050506040513d602081101561083057600080fd5b505115156108ae576040805160e560020a62461bcd02815260206004820152603960248201527f4f6e6c792077686974656c697374656420776f726b6572732061726520616c6c60448201527f6f77656420746f2063616c6c2074686973206d6574686f642e00000000000000606482015290519081900360840190fd5b831515610905576040805160e560020a62461bcd02815260206004820152601360248201527f52756c65206e616d6520697320656d7074792e00000000000000000000000000604482015290519081900360640190fd5b600160a060020a0383161515610965576040805160e560020a62461bcd02815260206004820152601560248201527f52756c652061646472657373206973206e756c6c2e0000000000000000000000604482015290519081900360640190fd5b8015156109bc576040805160e560020a62461bcd02815260206004820152601260248201527f52756c652041424920697320656d7074792e0000000000000000000000000000604482015290519081900360640190fd5b60008585604051602001808383808284376040805191909301818103601f190182528352805160209182012060008181526003909252929020600101549195505060ff16159250610a80915050576040805160e560020a62461bcd02815260206004820152602c60248201527f52756c6520776974682074686520737065636966696564206e616d6520616c7260448201527f65616479206578697374732e0000000000000000000000000000000000000000606482015290519081900360840190fd5b600160a060020a03841660009081526002602052604090206001015460ff1615610b1a576040805160e560020a62461bcd02815260206004820152602f60248201527f52756c652077697468207468652073706563696669656420616464726573732060448201527f616c7265616479206578697374732e0000000000000000000000000000000000606482015290519081900360840190fd5b610b226113da565b6040805160806020601f8a0181900402820181019092526060810188815290918291908a908a9081908501838280828437600092019190915250505090825250600160a060020a03871660208083019190915260408051601f8801839004830281018301825287815292019190879087908190840183828082843760009201919091525050509152509050610bb56113f9565b506040805180820182526001805482526020808301828152600160a060020a038a16600090815260028352858120855181558251908501805491151560ff1992831617905588825260038085529682208651815592519285018054931515939091169290921790915582548084018085559390915285518051949593948794929092027fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf60192610c6a92849290910190611410565b5060208281015160018301805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0390921691909117905560408301518051610cb69260028501920190611410565b505060408051600160a060020a038a1660208201528181529081018a90527f4d39292a7c76562755f38e419d757d846579699af484d88be86a1811dca7321592508a9150899089908060608101858580828437600083820152604051601f909101601f1916909201829003965090945050505050a15050505050505050565b60056020526000908152604090205460ff1681565b600054604080517faa1566450000000000000000000000000000000000000000000000000000000081523360048201529051600160a060020a039092169163aa15664591602480820192602092909190829003018186803b158015610dae57600080fd5b505afa158015610dc2573d6000803e3d6000fd5b505050506040513d6020811015610dd857600080fd5b50511515610e56576040805160e560020a62461bcd02815260206004820152603960248201527f4f6e6c792077686974656c697374656420776f726b6572732061726520616c6c60448201527f6f77656420746f2063616c6c2074686973206d6574686f642e00000000000000606482015290519081900360840190fd5b6006805460ff19166001179055565b60065460ff161515610ee7576040805160e560020a62461bcd02815260206004820152602160248201527f446972656374207472616e736665727320617265206e6f7420616c6c6f77656460448201527f2e00000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b610f5533858580806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250506040805160208089028281018201909352888252909350889250879182918501908490808284376000920191909152506111ae92505050565b50505050565b3360009081526002602052604090206001015460ff161515610fed576040805160e560020a62461bcd02815260206004820152602860248201527f4f6e6c7920726567697374657265642072756c6520697320616c6c6f7765642060448201527f746f2063616c6c2e000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b61105b85858580806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250506040805160208089028281018201909352888252909350889250879182918501908490808284376000920191909152506111ae92505050565b5050505050565b600054604080517faa1566450000000000000000000000000000000000000000000000000000000081523360048201529051600160a060020a039092169163aa15664591602480820192602092909190829003018186803b1580156110c657600080fd5b505afa1580156110da573d6000803e3d6000fd5b505050506040513d60208110156110f057600080fd5b5051151561116e576040805160e560020a62461bcd02815260206004820152603960248201527f4f6e6c792077686974656c697374656420776f726b6572732061726520616c6c60448201527f6f77656420746f2063616c6c2074686973206d6574686f642e00000000000000606482015290519081900360840190fd5b6006805460ff19169055565b60065460ff1681565b6002602052600090815260409020805460019091015460ff1682565b600454600160a060020a031681565b600160a060020a03831660009081526005602052604090205460ff161515611246576040805160e560020a62461bcd02815260206004820152602b60248201527f5472616e73666572732066726f6d20746865206164647265737320617265206e60448201527f6f7420616c6c6f7765642e000000000000000000000000000000000000000000606482015290519081900360840190fd5b80518251146112c5576040805160e560020a62461bcd02815260206004820152603960248201527f27746f2720616e642027616d6f756e7427207472616e7366657220617272617960448201527f7327206c656e6774687320617265206e6f7420657175616c2e00000000000000606482015290519081900360840190fd5b60005b82518110156113b6576004548351600160a060020a03909116906323b872dd9086908690859081106112f657fe5b90602001906020020151858581518110151561130e57fe5b6020908102909101810151604080517c010000000000000000000000000000000000000000000000000000000063ffffffff8816028152600160a060020a03958616600482015293909416602484015260448301529151606480830193928290030181600087803b15801561138257600080fd5b505af1158015611396573d6000803e3d6000fd5b505050506040513d60208110156113ac57600080fd5b50506001016112c8565b505050600160a060020a03166000908152600560205260409020805460ff19169055565b6040805160608181018352808252600060208301529181019190915290565b604080518082019091526000808252602082015290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061145157805160ff191683800117855561147e565b8280016001018555821561147e579182015b8281111561147e578251825591602001919060010190611463565b5061148a92915061148e565b5090565b6114a891905b8082111561148a5760008155600101611494565b9056fea165627a7a7230582020f7ce19ef90a3fcc42386bf3bb88bca6b35affe8bf52ef9881e677fe97d5a720029 \ No newline at end of file diff --git a/contracts/generateAbiBins.js b/contracts/generateAbiBins.js index 1824f2a..5745fad 100644 --- a/contracts/generateAbiBins.js +++ b/contracts/generateAbiBins.js @@ -19,8 +19,6 @@ if (process.argv.length > 2) { contractsRepoPath = process.argv[2]; } -console.log(`Looking for truffle compile output in path ${contractsRepoPath}`); - let metadata = { abi: { generated: [], @@ -58,15 +56,11 @@ fs.readdir(contractsRepoPath, function(err, items) { continue; } - console.log(`Processing ${fileName}`); - let jsonFilePath = path.join(contractsRepoPath, fileName); - console.log(`jsonFilePath ${jsonFilePath}`); let json = require(jsonFilePath); //Generate Abi files if (json.abi && json.abi.length) { - console.log('--- Generating abi file'); //Write to file. let fileContent = JSON.stringify(json.abi); let outputFile = path.join(abiOutputPath, contractName + '.abi'); @@ -74,13 +68,11 @@ fs.readdir(contractsRepoPath, function(err, items) { //Update Metadata metadata.abi.generated.push(contractName); } else { - console.log('--- abi file not generated'); metadata.abi.ignored.push(contractName); } //Generate Bin files if (json.bytecode && json.bytecode.length && json.bytecode != '0x') { - console.log('--- Generating bin file'); //Write to file. let fileContent = json.bytecode; let outputFile = path.join(binOutputPath, contractName + '.bin'); @@ -88,29 +80,7 @@ fs.readdir(contractsRepoPath, function(err, items) { //Update Metadata metadata.bin.generated.push(contractName); } else { - console.log('--- bin file not generated'); metadata.bin.ignored.push(contractName); } } - - console.log('------ Task Completed ------'); - console.log('Total truffle Artifacts:', metadata.total); - console.log( - 'Abi File generated for', - metadata.abi.generated.length, - 'contracts. Artifacts can be found here: ', - abiOutputPath - ); - console.log( - 'Bin generated for', - metadata.bin.generated.length, - 'contracts. Artifacts can be found here: ', - binOutputPath - ); - if (metadata.abi.ignored.length) { - console.log('Abi generation ignored for \n\t', metadata.abi.ignored.join('\n\t ')); - } - if (metadata.bin.ignored.length) { - console.log('Bin generation ignored for \n\t', metadata.bin.ignored.join('\n\t ')); - } }); diff --git a/lib/Contracts.js b/lib/Contracts.js index cb030ae..ce2aab0 100644 --- a/lib/Contracts.js +++ b/lib/Contracts.js @@ -85,6 +85,70 @@ class OpenSTContracts extends Contracts { return contractInstance; } + /** + * Static method which returns TokenRules contract instance. + * + * @param auxiliaryWeb3 Origin chain web3 object. + * @param address TokenRules contract address. + * @param options Tx options. + * @returns {web3.eth.Contract} Contract instance. + * @constructor + */ + static getTokenRules(auxiliaryWeb3, address, options) { + const oThis = this; + const jsonInterface = abiBinProvider.getABI('TokenRules'); + const contract = new auxiliaryWeb3.eth.Contract(jsonInterface, address, options); + return contract; + } + + /** + * Static method which returns PricerRule contract instance. + * + * @param auxiliaryWeb3 Origin chain web3 object. + * @param address PricerRule contract instance. + * @param options Tx options. + * @returns {web3.eth.Contract} Contract instance. + * @constructor + */ + static getPricerRule(auxiliaryWeb3, address, options) { + const oThis = this; + const jsonInterface = abiBinProvider.getABI('PricerRule'); + const contract = new auxiliaryWeb3.eth.Contract(jsonInterface, address, options); + return contract; + } + + /** + * Static method which returns TokenHolder contract instance. + * + * @param auxiliaryWeb3 Auxiliary chain web3 object. + * @param address TokenHolder contract address. + * @param options Tx options. + * @returns {web3.eth.Contract} Contract instance. + * @constructor + */ + static getTokenHolder(auxiliaryWeb3, address, options) { + const oThis = this; + const jsonInterface = abiBinProvider.getABI('TokenHolder'); + const contract = new auxiliaryWeb3.eth.Contract(jsonInterface, address, options); + return contract; + } + + /** + * Static method which returns GnosisSafe contract instance. + * + * @param auxiliaryWeb3 Auxiliary chain web3 object. + * @param address GnosisSafe contract address. + * @param options Tx options. + * @returns {web3.eth.Contract} Contract instance. + * @constructor + */ + static getGnosisSafe(auxiliaryWeb3, address, options) { + const oThis = this; + const jsonInterface = abiBinProvider.getABI('GnosisSafe'); + const contract = new auxiliaryWeb3.eth.Contract(jsonInterface, address, options); + return contract; + } + /** * Static method which returns delayed recovery module instance. * @@ -94,9 +158,9 @@ class OpenSTContracts extends Contracts { * @returns {auxiliaryWeb3Object.eth.Contract} */ static getDelayedRecovery(auxiliaryWeb3, address, options) { - const auxiliaryWeb3Object = Contracts._getWeb3(auxiliaryWeb3); + const oThis = this; const jsonInterface = abiBinProvider.getABI('DelayedRecoveryModule'); - const contractInstance = new auxiliaryWeb3Object.eth.Contract(jsonInterface, address, options); + const contractInstance = new auxiliaryWeb3.eth.Contract(jsonInterface, address, options); return contractInstance; } diff --git a/lib/helper/rules/PricerRule.js b/lib/helper/rules/PricerRule.js index 800edf8..1422f08 100644 --- a/lib/helper/rules/PricerRule.js +++ b/lib/helper/rules/PricerRule.js @@ -5,6 +5,8 @@ const AbiBinProvider = require('./../../AbiBinProvider'), const Utils = require('../../../utils/Utils'); +const BN = require('bn.js'); + /** * Helper class which provides interaction methods of PricerRule contract. */ @@ -110,6 +112,26 @@ class PricerRule { return payExecutableData; } + /** + * Converts PayCurrencyCode amount to BT amount. + * + * @param amountInWei Amount which is being transferred. + * @param priceInWei Price set in PriceOracle contract. + * @param conversionRate OST to BT conversion rate. + * @param conversionRateDecimals OST to BT conversion rate decimals. + * + * @returns {BigNumber} Converted BT amount. + */ + static convertPayCurrencyToToken(amountInWei, priceInWei, conversionRate, conversionRateDecimals) { + const conversionRateDecimalsBN = new BN(10).pow(new BN(conversionRateDecimals)); + const amountBN = new BN(amountInWei); + const priceBN = new BN(priceInWei); + return amountBN + .mul(new BN(conversionRate)) + .div(priceBN) + .div(conversionRateDecimalsBN); + } + /** * Adds a new price oracle. * diff --git a/test/integration/DirectTransfer.js b/test/integration/DirectTransfer.js index 9ef251a..618d6cc 100644 --- a/test/integration/DirectTransfer.js +++ b/test/integration/DirectTransfer.js @@ -1,25 +1,16 @@ -const chai = require('chai'), - Web3 = require('web3'), - Package = require('../../index'), - Mosaic = require('@openstfoundation/mosaic.js'); - -const TokenRulesSetup = Package.Setup.TokenRules, - UserSetup = Package.Setup.User, - RulesSetup = Package.Setup.Rules, - MockContractsDeployer = require('./../utils/MockContractsDeployer'), - config = require('../utils/configReader'), - Contracts = Package.Contracts, - User = Package.Helpers.User, - TokenRules = Package.Helpers.TokenRules, - AbiBinProvider = Package.AbiBinProvider, - TokenHolder = Package.Helpers.TokenHolder, - { dockerSetup, dockerTeardown } = require('./../../utils/docker'); - -const assert = chai.assert, - abiBinProvider = new AbiBinProvider(); +const Web3 = require('web3'); +const Mosaic = require('@openstfoundation/mosaic.js'); +const { assert } = require('chai'); +const Package = require('../../index'); +const MockContractsDeployer = require('./../utils/MockContractsDeployer'); +const config = require('../utils/configReader'); +const { dockerSetup, dockerTeardown } = require('./../../utils/docker'); + +const UserSetup = Package.Setup.User; +const { Contracts } = Package; +const UserHelper = Package.Helpers.User; let txOptions, - ContractsInstance, userWalletFactoryAddress, thMasterCopyAddress, gnosisSafeMasterCopyAddress, @@ -27,30 +18,28 @@ let txOptions, tokenRulesAddress, delayedRecoveryModuleMasterCopyAddress, createAndAddModulesAddress, - pricerRuleAddress, - worker, - organization, - mockToken, - owner = config.deployerAddress, + organizationAddress, + eip20Token, tokenHolderSender, - tokenHolderFirstReceiver, tokenHolderSecondReceiver, - gnosisSafeProxy, ephemeralKey, mockTokenDeployerInstance, - tokenRulesObject, deployerAddress, - auxiliaryWeb3; + auxiliaryWeb3, + accountsOrigin; describe('Direct transfers between TH contracts', async function() { before(async function() { const { rpcEndpointOrigin } = await dockerSetup(); auxiliaryWeb3 = new Web3(rpcEndpointOrigin); - ContractsInstance = new Contracts(auxiliaryWeb3); - const accountsOrigin = await auxiliaryWeb3.eth.getAccounts(); + accountsOrigin = await auxiliaryWeb3.eth.getAccounts(); deployerAddress = accountsOrigin[0]; - worker = accountsOrigin[1]; - owner = accountsOrigin[2]; + txOptions = { + from: deployerAddress, + gasPrice: config.gasPrice, + gas: config.gas + }; + await auxiliaryWeb3.eth.accounts.wallet.create(10); }); after(() => { @@ -61,14 +50,14 @@ describe('Direct transfers between TH contracts', async function() { const { Organization } = Mosaic.ContractInteract; const orgConfig = { deployer: deployerAddress, - owner, - admin: worker, - workers: [worker], + owner: deployerAddress, + admin: accountsOrigin[1], + workers: [accountsOrigin[1]], workerExpirationHeight: config.workerExpirationHeight }; const organizationContractInstance = await Organization.setup(auxiliaryWeb3, orgConfig); - organization = organizationContractInstance.address; - assert.isNotNull(organization, 'Organization contract address should not be null.'); + organizationAddress = organizationContractInstance.address; + assert.isNotNull(organizationAddress, 'Organization contract address should not be null.'); }); it('Deploys EIP20Token contract', async function() { @@ -76,191 +65,79 @@ describe('Direct transfers between TH contracts', async function() { await mockTokenDeployerInstance.deployMockToken(); - mockToken = mockTokenDeployerInstance.addresses.MockToken; - assert.isNotNull(mockToken, 'EIP20Token contract address should not be null.'); + eip20Token = mockTokenDeployerInstance.addresses.MockToken; + assert.isNotNull(eip20Token, 'EIP20Token contract address should not be null.'); }); - it('Deploys TokenRules contract', async function() { - txOptions = { - from: deployerAddress, - gasPrice: config.gasPrice, - gas: config.gas - }; - - const tokenRulesSetupInstance = new TokenRulesSetup(auxiliaryWeb3); - - const response = await tokenRulesSetupInstance.deploy(organization, mockToken, txOptions); - tokenRulesAddress = response.receipt.contractAddress; - assert.isNotNull(tokenRulesAddress, 'tokenRules contract address should not be null.'); - - const tokenRulesContractInstance = ContractsInstance.TokenRules(tokenRulesAddress, txOptions); + it('Performs Setup of TokenHolder, MultiSig, DelayedRecoveryModule master copies', async function() { + const userSetup = new UserSetup(auxiliaryWeb3); + const tokenHolderTxResponse = await userSetup.deployTokenHolderMasterCopy(txOptions); + thMasterCopyAddress = tokenHolderTxResponse.receipt.contractAddress; + assert.isNotNull(thMasterCopyAddress, 'TH master copy contract address should not be null.'); - // Verifying stored organization and token address. - assert.strictEqual( - mockToken, - await tokenRulesContractInstance.methods.token().call(), - 'Token address is incorrect' - ); - assert.strictEqual( - organization, - await tokenRulesContractInstance.methods.organization().call(), - 'Organization address is incorrect' - ); - }); + const multiSigTxResponse = await userSetup.deployMultiSigMasterCopy(txOptions); + gnosisSafeMasterCopyAddress = multiSigTxResponse.receipt.contractAddress; + assert.isNotNull(gnosisSafeMasterCopyAddress, 'gnosis safe master copy contract address should not be null.'); - it('Deploys DelayedRecoveryModule master copy.', async function() { - const userSetup = new UserSetup(auxiliaryWeb3); const txResponse = await userSetup.deployDelayedRecoveryModuleMasterCopy(txOptions); delayedRecoveryModuleMasterCopyAddress = txResponse.receipt.contractAddress; - assert.strictEqual(txResponse.receipt.status, true); assert.isNotNull( delayedRecoveryModuleMasterCopyAddress, "DelayedRecoveryModule master copy contract's address is null." ); }); - it('Deploys CreateAndAddModules.', async function() { + it('Performs setup of CreateAndAddModules, UserWalletFactory, ProxyFactory contracts', async function() { const userSetup = new UserSetup(auxiliaryWeb3); const txResponse = await userSetup.deployCreateAndAddModules(txOptions); createAndAddModulesAddress = txResponse.receipt.contractAddress; - assert.strictEqual(txResponse.receipt.status, true); assert.isNotNull(createAndAddModulesAddress, "createAndAddModules contract's address is null."); - }); - it('Deploys Gnosis MultiSig MasterCopy contract', async function() { - const userSetup = new UserSetup(auxiliaryWeb3); - const multiSigTxResponse = await userSetup.deployMultiSigMasterCopy(txOptions); - gnosisSafeMasterCopyAddress = multiSigTxResponse.receipt.contractAddress; - assert.strictEqual(multiSigTxResponse.receipt.status, true); - assert.isNotNull(gnosisSafeMasterCopyAddress, 'gnosis safe master copy contract address should not be null.'); - }); - - it('Deploys TokenHolder MasterCopy contract', async function() { - const userSetup = new UserSetup(auxiliaryWeb3); - const tokenHolderTxResponse = await userSetup.deployTokenHolderMasterCopy(txOptions); - thMasterCopyAddress = tokenHolderTxResponse.receipt.contractAddress; - assert.strictEqual(tokenHolderTxResponse.receipt.status, true); - assert.isNotNull(thMasterCopyAddress, 'TH master copy contract address should not be null.'); - }); - - it('Deploys UserWalletFactory contract', async function() { - const userSetup = new UserSetup(auxiliaryWeb3); const userWalletFactoryResponse = await userSetup.deployUserWalletFactory(txOptions); userWalletFactoryAddress = userWalletFactoryResponse.receipt.contractAddress; - assert.strictEqual(userWalletFactoryResponse.receipt.status, true); assert.isNotNull(userWalletFactoryAddress, 'UserWalletFactory contract address should not be null.'); - }); - it('Deploys ProxyFactory contract', async function() { - const userSetup = new UserSetup(auxiliaryWeb3); const proxyFactoryResponse = await userSetup.deployProxyFactory(txOptions); proxyFactoryAddress = proxyFactoryResponse.receipt.contractAddress; - assert.strictEqual(proxyFactoryResponse.receipt.status, true); assert.isNotNull(proxyFactoryAddress, 'Proxy contract address should not be null.'); }); - it('Deploys PricerRule contract', async function() { - const rulesSetup = new RulesSetup(auxiliaryWeb3, organization, mockToken, tokenRulesAddress); - const pricerRulesDeployResponse = await rulesSetup.deployPricerRule( - config.baseCurrencyCode, - config.conversionRate, - config.conversionRateDecimals, - config.requiredPriceOracleDecimals, - txOptions - ); - assert.strictEqual(pricerRulesDeployResponse.receipt.status, true); - pricerRuleAddress = pricerRulesDeployResponse.receipt.contractAddress; - const pricerRuleInstance = ContractsInstance.PricerRule(pricerRuleAddress, txOptions); - // Sanity check - assert.strictEqual( - await pricerRuleInstance.methods.tokenRules().call(), - tokenRulesAddress, - 'TokenRules address is incorrect!' - ); - }); - - it('Registers PricerRule rule', async function() { - // Only worker can registerRule. - txOptions.from = worker; - - tokenRulesObject = new TokenRules(tokenRulesAddress, auxiliaryWeb3); - const pricerRuleName = 'PricerRule', - pricerRuleAbi = abiBinProvider.getABI('PricerRule'), - response = await tokenRulesObject.registerRule( - pricerRuleName, - pricerRuleAddress, - pricerRuleAbi.toString(), - txOptions - ); - - assert.strictEqual(response.events.RuleRegistered['returnValues']._ruleName, pricerRuleName); - assert.strictEqual(response.events.RuleRegistered['returnValues']._ruleAddress, pricerRuleAddress); - - // Verify the rule data using rule name. - const ruleByNameData = await tokenRulesObject.getRuleByName(pricerRuleName, txOptions); - assert.strictEqual(ruleByNameData.ruleName, pricerRuleName, 'Incorrect rule name was registered'); - assert.strictEqual(ruleByNameData.ruleAddress, pricerRuleAddress, pricerRuleAddress, 'Incorrect rule address'); - - // Verify the rule data using rule address. - const ruleByAddressData = await tokenRulesObject.getRuleByAddress(pricerRuleAddress, txOptions); - assert.strictEqual(ruleByAddressData.ruleName, pricerRuleName, 'Incorrect rule name was registered'); - assert.strictEqual(ruleByAddressData.ruleAddress, pricerRuleAddress, pricerRuleAddress, 'Incorrect rule address'); - }); - - it('Creates first user wallet', async function() { - txOptions.from = deployerAddress; - const userInstance = new User( - thMasterCopyAddress, - gnosisSafeMasterCopyAddress, - delayedRecoveryModuleMasterCopyAddress, - createAndAddModulesAddress, - mockToken, - tokenRulesAddress, - userWalletFactoryAddress, - proxyFactoryAddress, - auxiliaryWeb3 - ); + it('Deploys TokenRules contract', async function() { + txOptions = { + from: deployerAddress, + gasPrice: config.gasPrice, + gas: config.gas + }; - await auxiliaryWeb3.eth.accounts.wallet.create(10); - ephemeralKey = auxiliaryWeb3.eth.accounts.wallet[0]; + const tokenRulesSetupInstance = new Package.Setup.TokenRules(auxiliaryWeb3); - const owners = [owner], - threshold = 1, - sessionKeys = [ephemeralKey.address]; + const response = await tokenRulesSetupInstance.deploy(organizationAddress, eip20Token, txOptions); + tokenRulesAddress = response.receipt.contractAddress; + assert.isNotNull(tokenRulesAddress, 'tokenRules contract address should not be null.'); - const recoveryOwnerAddress = auxiliaryWeb3.eth.accounts.wallet[7].address; - const recoveryControllerAddress = auxiliaryWeb3.eth.accounts.wallet[8].address; - const recoveryBlockDelay = 10; + const tokenRulesContractInstance = Contracts.getTokenRules(auxiliaryWeb3, tokenRulesAddress, txOptions); - const response = await userInstance.createUserWallet( - owners, - threshold, - recoveryOwnerAddress, - recoveryControllerAddress, - recoveryBlockDelay, - sessionKeys, - [config.sessionKeySpendingLimit], - [config.sessionKeyExpirationHeight], - txOptions + // Verifying stored organization and token address. + assert.strictEqual( + eip20Token, + await tokenRulesContractInstance.methods.token().call(), + 'Token address is incorrect' + ); + assert.strictEqual( + organizationAddress, + await tokenRulesContractInstance.methods.organization().call(), + 'Organization address is incorrect' ); - - assert.strictEqual(response.status, true, 'User wallet creation failed.'); - - // Fetching the gnosisSafe and tokenholder proxy address for the user. - let returnValues = response.events.UserWalletCreated.returnValues; - let userWalletEvent = JSON.parse(JSON.stringify(returnValues)); - - gnosisSafeProxy = userWalletEvent._gnosisSafeProxy; - tokenHolderSender = userWalletEvent._tokenHolderProxy; }); - it('Should create second user wallet', async function() { - const userInstance = new User( + it('Creates sender user wallet', async function() { + txOptions.from = deployerAddress; + const userInstance = new UserHelper( thMasterCopyAddress, gnosisSafeMasterCopyAddress, delayedRecoveryModuleMasterCopyAddress, createAndAddModulesAddress, - mockToken, + eip20Token, tokenRulesAddress, userWalletFactoryAddress, proxyFactoryAddress, @@ -270,7 +147,7 @@ describe('Direct transfers between TH contracts', async function() { await auxiliaryWeb3.eth.accounts.wallet.create(10); ephemeralKey = auxiliaryWeb3.eth.accounts.wallet[0]; - const owners = [owner], + const owners = [accountsOrigin[2]], threshold = 1, sessionKeys = [ephemeralKey.address]; @@ -290,23 +167,20 @@ describe('Direct transfers between TH contracts', async function() { txOptions ); - assert.strictEqual(response.status, true, 'User wallet creation failed.'); - // Fetching the gnosisSafe and tokenholder proxy address for the user. let returnValues = response.events.UserWalletCreated.returnValues; let userWalletEvent = JSON.parse(JSON.stringify(returnValues)); - gnosisSafeProxy = userWalletEvent._gnosisSafeProxy; - tokenHolderFirstReceiver = userWalletEvent._tokenHolderProxy; + tokenHolderSender = userWalletEvent._tokenHolderProxy; }); - it('Creates a company wallet', async function() { - const userInstance = new User( + it('Creates company wallet as second receiver', async function() { + const userInstance = new UserHelper( thMasterCopyAddress, null, // gnosis safe master copy address null, // delayed recovery module master copy address null, // create and add modules contract address - mockToken, + eip20Token, tokenRulesAddress, userWalletFactoryAddress, proxyFactoryAddress, // proxy factory address @@ -326,8 +200,6 @@ describe('Direct transfers between TH contracts', async function() { txOptions ); - assert.strictEqual(response.status, true, 'Company wallet creation failed.'); - // Fetching the company tokenholder proxy address for the user. const returnValues = response.events.ProxyCreated.returnValues; const proxyEvent = JSON.parse(JSON.stringify(returnValues)); @@ -337,26 +209,31 @@ describe('Direct transfers between TH contracts', async function() { }); it('Performs direct transfer of tokens', async function() { - const tokenHolder = new TokenHolder(auxiliaryWeb3, tokenHolderSender); + const tokenHolder = new Package.Helpers.TokenHolder(auxiliaryWeb3, tokenHolderSender); // MockToken instance is needed because for transfer. Transfer is not available in Mosaic.ContractInteract.EIP20Token // Please update after transfer is exposed in Mosaic.js const mockTokenAbi = mockTokenDeployerInstance.abiBinProvider.getABI('MockToken'); - const mockContractInstance = new auxiliaryWeb3.eth.Contract(mockTokenAbi, mockToken, txOptions); + const mockContractInstance = new auxiliaryWeb3.eth.Contract(mockTokenAbi, eip20Token, txOptions); - const eip20Instance = new Mosaic.ContractInteract.EIP20Token(auxiliaryWeb3, mockToken); + const eip20Instance = new Mosaic.ContractInteract.EIP20Token(auxiliaryWeb3, eip20Token); // Funding TH proxy with tokens. - const amount = config.tokenHolderBalance; + const amount = config.senderTokenHolderBalance; const txObject = mockContractInstance.methods.transfer(tokenHolderSender, amount); await txObject.send(txOptions); const initialTHProxyBalance = await eip20Instance.balanceOf(tokenHolderSender); - const transferTos = [tokenHolderFirstReceiver, tokenHolderSecondReceiver]; - const firstReceiverInitialBalance = await eip20Instance.balanceOf(tokenHolderFirstReceiver); + const firstReceiver = auxiliaryWeb3.eth.accounts.wallet[0].address; + const transferTos = [firstReceiver, tokenHolderSecondReceiver]; + const firstReceiverInitialBalance = await eip20Instance.balanceOf(firstReceiver); const secondReceiverInitialBalance = await eip20Instance.balanceOf(tokenHolderSecondReceiver); const transferAmounts = [20, 10]; - const directTransferExecutable = tokenRulesObject.getDirectTransferExecutableData(transferTos, transferAmounts); + const tokenRulesHelperObject = new Package.Helpers.TokenRules(tokenRulesAddress, auxiliaryWeb3); + const directTransferExecutable = tokenRulesHelperObject.getDirectTransferExecutableData( + transferTos, + transferAmounts + ); const nonce = 0; let transaction = { @@ -374,16 +251,16 @@ describe('Direct transfers between TH contracts', async function() { await tokenHolder.executeRule(tokenRulesAddress, directTransferExecutable, nonce, vrs.r, vrs.s, vrs.v, txOptions); - const finalTHProxyBalance = await eip20Instance.balanceOf(tokenHolderSender), - firstReceiverFinalBalance = await eip20Instance.balanceOf(tokenHolderFirstReceiver), + const finalTHSenderBalance = await eip20Instance.balanceOf(tokenHolderSender), + firstReceiverFinalBalance = await eip20Instance.balanceOf(firstReceiver), secondReceiverFinalBalance = await eip20Instance.balanceOf(tokenHolderSecondReceiver), firstReceiverExpectedBalance = parseInt(firstReceiverInitialBalance) + transferAmounts[0], secondReceiverExpectedBalance = parseInt(secondReceiverInitialBalance) + transferAmounts[1]; assert.strictEqual( initialTHProxyBalance - transferAmounts[0] - transferAmounts[1], - parseInt(finalTHProxyBalance), - `TokenHolder sender balance is ${finalTHProxyBalance} and expected balance is ${initialTHProxyBalance - + parseInt(finalTHSenderBalance), + `TokenHolder sender balance is ${finalTHSenderBalance} and expected balance is ${initialTHProxyBalance - transferAmounts[0] - transferAmounts[1]}` ); diff --git a/test/integration/PricerRulePay.js b/test/integration/PricerRulePay.js new file mode 100644 index 0000000..79a3c0b --- /dev/null +++ b/test/integration/PricerRulePay.js @@ -0,0 +1,403 @@ +const Web3 = require('web3'); +const { assert } = require('chai'); +const BN = require('bn.js'); +const Package = require('../../index'); +const Mosaic = require('@openstfoundation/mosaic.js'); +const MockContractsDeployer = require('./../utils/MockContractsDeployer'); +const config = require('../utils/configReader'); +const { dockerSetup, dockerTeardown } = require('./../../utils/docker'); +const Utils = require('../../utils/Utils'); + +const UserSetup = Package.Setup.User; +const Contracts = Package.Contracts; +const { AbiBinProvider } = Package; +const PricerRuleHelper = Package.Helpers.Rules.PricerRule; + +let auxiliaryWeb3, + txOptions, + userWalletFactoryAddress, + thMasterCopyAddress, + gnosisSafeMasterCopyAddress, + tokenRulesAddress, + pricerRuleAddress, + worker, + organizationAddress, + eip20Token, + tokenHolderSender, + mockTokenDeployerInstance, + deployerAddress, + priceOracleAddress, + priceOracleOwner, + priceOracleOpsAddress, + pricerRuleHelperObject, + accountsOrigin, + bytesBaseCurrencyCode, + bytesPayCurrencyCode, + delayedRecoveryModuleMasterCopyAddress, + createAndAddModulesAddress, + proxyFactoryAddress, + ephemeralKey; + +describe('TH transfers through PricerRule Pay', async function() { + before(async function() { + const { rpcEndpointOrigin } = await dockerSetup(); + auxiliaryWeb3 = new Web3(rpcEndpointOrigin); + accountsOrigin = await auxiliaryWeb3.eth.getAccounts(); + deployerAddress = accountsOrigin[0]; + priceOracleOwner = accountsOrigin[0]; + worker = accountsOrigin[0]; + priceOracleOpsAddress = accountsOrigin[1]; + txOptions = { + from: deployerAddress, + gasPrice: config.gasPrice, + gas: config.gas + }; + await auxiliaryWeb3.eth.accounts.wallet.create(10); + }); + + after(() => { + dockerTeardown(); + }); + + it('Performs initial setup for economy', async function() { + const { Organization } = Mosaic.ContractInteract; + const orgConfig = { + deployer: deployerAddress, + owner: deployerAddress, + admin: worker, + workers: [worker], + workerExpirationHeight: config.workerExpirationHeight + }; + const organizationContractInstance = await Organization.setup(auxiliaryWeb3, orgConfig); + organizationAddress = organizationContractInstance.address; + assert.isNotNull(organizationAddress, 'Organization contract address should not be null.'); + + mockTokenDeployerInstance = new MockContractsDeployer(deployerAddress, auxiliaryWeb3); + await mockTokenDeployerInstance.deployMockToken(); + + eip20Token = mockTokenDeployerInstance.addresses.MockToken; + assert.isNotNull(eip20Token, 'EIP20Token contract address should not be null.'); + + const tokenRules = new Package.Setup.TokenRules(auxiliaryWeb3); + + const response = await tokenRules.deploy(organizationAddress, eip20Token, txOptions, auxiliaryWeb3); + tokenRulesAddress = response.receipt.contractAddress; + + const tokenRulesContractInstance = Contracts.getTokenRules( + auxiliaryWeb3, + response.receipt.contractAddress, + txOptions + ); + // Verifying stored organization and token address. + assert.strictEqual( + eip20Token, + await tokenRulesContractInstance.methods.token().call(), + 'Token address is incorrect' + ); + assert.strictEqual( + eip20Token, + await tokenRulesContractInstance.methods.token().call(), + 'Token address is incorrect' + ); + assert.strictEqual( + organizationAddress, + await tokenRulesContractInstance.methods.organization().call(), + 'Organization address is incorrect' + ); + }); + + it('Performs Setup of TokenHolder, MultiSig, DelayedRecoveryModule master copies', async function() { + const userSetup = new UserSetup(auxiliaryWeb3); + const tokenHolderTxResponse = await userSetup.deployTokenHolderMasterCopy(txOptions); + thMasterCopyAddress = tokenHolderTxResponse.receipt.contractAddress; + assert.isNotNull(thMasterCopyAddress, 'TH master copy contract address should not be null.'); + + const multiSigTxResponse = await userSetup.deployMultiSigMasterCopy(txOptions); + gnosisSafeMasterCopyAddress = multiSigTxResponse.receipt.contractAddress; + assert.isNotNull(gnosisSafeMasterCopyAddress, 'gnosis safe master copy contract address should not be null.'); + + const txResponse = await userSetup.deployDelayedRecoveryModuleMasterCopy(txOptions); + delayedRecoveryModuleMasterCopyAddress = txResponse.receipt.contractAddress; + assert.isNotNull( + delayedRecoveryModuleMasterCopyAddress, + "DelayedRecoveryModule master copy contract's address is null." + ); + }); + + it('Performs setup of CreateAndAddModules, UserWalletFactory, ProxyFactory contracts', async function() { + const userSetup = new UserSetup(auxiliaryWeb3); + const txResponse = await userSetup.deployCreateAndAddModules(txOptions); + createAndAddModulesAddress = txResponse.receipt.contractAddress; + assert.isNotNull(createAndAddModulesAddress, "createAndAddModules contract's address is null."); + + const userWalletFactoryResponse = await userSetup.deployUserWalletFactory(txOptions); + userWalletFactoryAddress = userWalletFactoryResponse.receipt.contractAddress; + assert.isNotNull(userWalletFactoryAddress, 'UserWalletFactory contract address should not be null.'); + + const proxyFactoryResponse = await userSetup.deployProxyFactory(txOptions); + proxyFactoryAddress = proxyFactoryResponse.receipt.contractAddress; + assert.isNotNull(proxyFactoryAddress, 'Proxy contract address should not be null.'); + }); + + it('Performs setup of PriceOracle', async function() { + bytesBaseCurrencyCode = auxiliaryWeb3.utils.stringToHex(config.baseCurrencyCode); + bytesPayCurrencyCode = auxiliaryWeb3.utils.stringToHex(config.payCurrencyCode); + const pricerOracleArgs = [bytesBaseCurrencyCode, bytesPayCurrencyCode]; + const priceOracleTxOptions = { + from: priceOracleOwner, + gasPrice: config.gasPrice, + gas: config.gas + }; + const priceOracleDeployResponse = await mockTokenDeployerInstance.deployPriceOracle( + auxiliaryWeb3, + pricerOracleArgs, + priceOracleTxOptions + ); + priceOracleAddress = mockTokenDeployerInstance.addresses.PriceOracle; + assert.isNotNull(priceOracleAddress, 'PriceOracle contract address should not be null.'); + + const setOpsTxOptions = { + from: priceOracleOwner, + gasPrice: config.gasPrice, + gas: config.gas + }; + const jsonInterface = mockTokenDeployerInstance.abiBinProvider.getABI('PriceOracle'); + const priceOracleContractInstance = new auxiliaryWeb3.eth.Contract(jsonInterface, priceOracleAddress); + const setOpsTxObject = priceOracleContractInstance.methods.setOpsAddress(priceOracleOpsAddress); + await Utils.sendTransaction(setOpsTxObject, setOpsTxOptions); + assert.strictEqual(await priceOracleContractInstance.methods.opsAddress().call(), priceOracleOpsAddress); + + const setPriceOptions = { + from: priceOracleOpsAddress, + gasPrice: config.gasPrice, + gas: config.gas + }; + const setPriceTxObject = priceOracleContractInstance.methods.setPrice(config.price); + await Utils.sendTransaction(setPriceTxObject, setPriceOptions); + assert.strictEqual(await priceOracleContractInstance.methods.getPrice().call(), config.price); + }); + + it('Performs setup of PricerRule', async function() { + const rulesSetup = new Package.Setup.Rules(auxiliaryWeb3, organizationAddress, eip20Token, tokenRulesAddress); + const pricerRulesDeployResponse = await rulesSetup.deployPricerRule( + config.baseCurrencyCode, + config.conversionRate, + config.conversionRateDecimals, + config.requiredPriceOracleDecimals, + txOptions + ); + pricerRuleAddress = pricerRulesDeployResponse.receipt.contractAddress; + const pricerRuleInstance = Contracts.getPricerRule(auxiliaryWeb3, pricerRuleAddress, txOptions); + // Sanity check + assert.strictEqual( + await pricerRuleInstance.methods.tokenRules().call(), + tokenRulesAddress, + 'TokenRules address is incorrect!' + ); + + const priceOracleTxOptions = { + from: worker, + gasPrice: config.gasPrice, + gas: config.gas + }; + pricerRuleHelperObject = new PricerRuleHelper(auxiliaryWeb3, pricerRuleAddress); + await pricerRuleHelperObject.addPriceOracle(priceOracleAddress, priceOracleTxOptions); + assert.strictEqual( + await pricerRuleInstance.methods.baseCurrencyPriceOracles(bytesPayCurrencyCode).call(), + priceOracleAddress + ); + + const setAcceptanceMarginReceipt = await pricerRuleHelperObject.setAcceptanceMargin( + config.payCurrencyCode, + config.acceptanceMargin, + priceOracleTxOptions + ); + const contractAcceptanceMargin = await pricerRuleInstance.methods + .baseCurrencyPriceAcceptanceMargins(bytesPayCurrencyCode) + .call(); + assert.strictEqual(contractAcceptanceMargin, config.acceptanceMargin); + }); + + it('Perform registration of PricerRule in TokenRules', async function() { + // Only worker can registerRule. + const registerRuleTxOptions = { + from: worker, + gasPrice: config.gasPrice, + gas: config.gas + }; + + const tokenRulesHelperObject = new Package.Helpers.TokenRules(tokenRulesAddress, auxiliaryWeb3); + const pricerRuleName = 'PricerRule'; + const abiBinProvider = new AbiBinProvider(); + const pricerRuleAbi = abiBinProvider.getABI('PricerRule'); + const response = await tokenRulesHelperObject.registerRule( + pricerRuleName, + pricerRuleAddress, + pricerRuleAbi.toString(), + registerRuleTxOptions + ); + + assert.strictEqual(response.events.RuleRegistered['returnValues']._ruleName, pricerRuleName); + assert.strictEqual(response.events.RuleRegistered['returnValues']._ruleAddress, pricerRuleAddress); + + // Verify the rule data using rule name. + const ruleByNameData = await tokenRulesHelperObject.getRuleByName(pricerRuleName, registerRuleTxOptions); + assert.strictEqual(ruleByNameData.ruleName, pricerRuleName, 'Incorrect rule name was registered'); + assert.strictEqual(ruleByNameData.ruleAddress, pricerRuleAddress, pricerRuleAddress, 'Incorrect rule address'); + + // Verify the rule data using rule address. + const ruleByAddressData = await tokenRulesHelperObject.getRuleByAddress(pricerRuleAddress, registerRuleTxOptions); + assert.strictEqual(ruleByAddressData.ruleName, pricerRuleName, 'Incorrect rule name was registered'); + assert.strictEqual(ruleByAddressData.ruleAddress, pricerRuleAddress, pricerRuleAddress, 'Incorrect rule address'); + }); + + it('Creates sender user wallet', async function() { + const userInstance = new Package.Helpers.User( + thMasterCopyAddress, + gnosisSafeMasterCopyAddress, + delayedRecoveryModuleMasterCopyAddress, + createAndAddModulesAddress, + eip20Token, + tokenRulesAddress, + userWalletFactoryAddress, + proxyFactoryAddress, + auxiliaryWeb3 + ); + + ephemeralKey = auxiliaryWeb3.eth.accounts.wallet[0]; + const owners = [auxiliaryWeb3.eth.accounts.wallet[1].address]; + const threshold = 1; + const sessionKeys = [ephemeralKey.address]; + + const recoveryOwnerAddress = auxiliaryWeb3.eth.accounts.wallet[3].address; + const recoveryControllerAddress = auxiliaryWeb3.eth.accounts.wallet[4].address; + const recoveryBlockDelay = 10; + + const response = await userInstance.createUserWallet( + owners, + threshold, + recoveryOwnerAddress, + recoveryControllerAddress, + recoveryBlockDelay, + sessionKeys, + [config.sessionKeySpendingLimit], + [config.sessionKeyExpirationHeight], + txOptions + ); + + assert.strictEqual(response.status, true, 'User wallet creation failed.'); + + // Fetching the gnosisSafe and tokenholder proxy address for the user. + let returnValues = response.events.UserWalletCreated.returnValues; + let userWalletEvent = JSON.parse(JSON.stringify(returnValues)); + + tokenHolderSender = userWalletEvent._tokenHolderProxy; + + const senderTokenHolderInstance = await Contracts.getTokenHolder(auxiliaryWeb3, tokenHolderSender, txOptions); + const sessionKeyData = await senderTokenHolderInstance.methods.sessionKeys(ephemeralKey.address).call(); + const sessionWindow = await senderTokenHolderInstance.methods.sessionWindow().call(); + assert.strictEqual( + sessionKeyData.spendingLimit, + config.sessionKeySpendingLimit, + 'Session spending limit is incorrect' + ); + assert.strictEqual( + sessionKeyData.expirationHeight, + config.sessionKeyExpirationHeight, + 'Session expiration height is incorrect' + ); + assert.strictEqual(sessionKeyData.nonce, '0', 'Session key nonce is incorrect'); + assert.strictEqual(sessionKeyData.session, sessionWindow, 'Session window is incorrect'); + }); + + it('Performs transfer through PricerRule.pay', async function() { + const tokenHolder = new Package.Helpers.TokenHolder(auxiliaryWeb3, tokenHolderSender), + mockTokenAbi = mockTokenDeployerInstance.abiBinProvider.getABI('MockToken'), + eip20TokenContractInstance = new auxiliaryWeb3.eth.Contract(mockTokenAbi, eip20Token, txOptions); + + // Funding TH proxy with tokens. + const txObject = eip20TokenContractInstance.methods.transfer(tokenHolderSender, config.senderTokenHolderBalance); + await txObject.send(txOptions); + const initialSenderBalance = await eip20TokenContractInstance.methods.balanceOf(tokenHolderSender).call(); + assert.strictEqual(initialSenderBalance, config.senderTokenHolderBalance, 'Initial sender TH balance mismatch!'); + + const firstReceiver = accountsOrigin[1]; + const secondReceiver = accountsOrigin[2]; + const transferTos = [firstReceiver, secondReceiver], + firstReceiverInitialBalance = await eip20TokenContractInstance.methods.balanceOf(firstReceiver).call(), + secondReceiverInitialBalance = await eip20TokenContractInstance.methods.balanceOf(secondReceiver).call(), + transferAmountsInUSD = ['2000000000000000', '1000000000000000']; + + const nonce = 0; + const pricerRulePayExecutable = pricerRuleHelperObject.getPayExecutableData( + tokenHolderSender, + transferTos, + transferAmountsInUSD, + config.payCurrencyCode, + config.price + ); + + let transaction = { + from: tokenHolderSender, + to: pricerRuleAddress, + data: pricerRulePayExecutable, + nonce: nonce, + callPrefix: await tokenHolder.getTokenHolderExecuteRuleCallPrefix(), + value: 0, + gasPrice: 0, + gas: 0 + }; + + const vrs = ephemeralKey.signEIP1077Transaction(transaction); + + const executeRuleResponse = await tokenHolder.executeRule( + pricerRuleAddress, + pricerRulePayExecutable, + nonce, + vrs.r, + vrs.s, + vrs.v, + txOptions + ); + assert.strictEqual(executeRuleResponse.status, true, 'ExecuteRule response is failure!'); + + const finalSenderBalance = await eip20TokenContractInstance.methods.balanceOf(tokenHolderSender).call(), + firstReceiverFinalBalance = await eip20TokenContractInstance.methods.balanceOf(firstReceiver).call(), + secondReceiverFinalBalance = await eip20TokenContractInstance.methods.balanceOf(secondReceiver).call(); + + const firstReceiverBTAmount = PricerRuleHelper.convertPayCurrencyToToken( + transferAmountsInUSD[0], + config.price, + config.conversionRate, + config.conversionRateDecimals + ); + const secondReceiverBTAmount = PricerRuleHelper.convertPayCurrencyToToken( + transferAmountsInUSD[1], + config.price, + config.conversionRate, + config.conversionRateDecimals + ); + + const firstReceiverExpectedBalance = new BN(firstReceiverInitialBalance).add(firstReceiverBTAmount); + const secondReceiverExpectedBalance = new BN(secondReceiverInitialBalance).add(secondReceiverBTAmount); + const expectedSenderBalance = new BN(initialSenderBalance).sub(firstReceiverBTAmount).sub(secondReceiverBTAmount); + + assert.strictEqual( + finalSenderBalance, + expectedSenderBalance.toString(10), + `TokenHolder sender balance is ${finalSenderBalance} and expected balance is ${expectedSenderBalance}` + ); + + assert.strictEqual( + firstReceiverFinalBalance, + firstReceiverExpectedBalance.toString(10), + `First receiver account token balance is ${firstReceiverFinalBalance} and expected balance is ${firstReceiverExpectedBalance}` + ); + + assert.strictEqual( + secondReceiverFinalBalance, + secondReceiverExpectedBalance.toString(10), + `Second receiver account token balance is ${secondReceiverFinalBalance} and expected balance is ${secondReceiverExpectedBalance}` + ); + }); +}); diff --git a/test/integration/WalletOperations.js b/test/integration/WalletOperations.js index 927c83a..51190cf 100644 --- a/test/integration/WalletOperations.js +++ b/test/integration/WalletOperations.js @@ -1,26 +1,18 @@ -const chai = require('chai'), - Web3 = require('web3'), - Package = require('../../index'), - abiDecoder = require('abi-decoder'), - MockContractsDeployer = require('../utils/MockContractsDeployer'), - Mosaic = require('@openstfoundation/mosaic.js'), - config = require('../utils/configReader'); - -const TokenRulesSetup = Package.Setup.TokenRules, - UserSetup = Package.Setup.User, - Contracts = Package.Contracts, - User = Package.Helpers.User, - AbiBinProvider = Package.AbiBinProvider, - TokenHolder = Package.Helpers.TokenHolder, - GnosisSafe = Package.Helpers.GnosisSafe; - -const { assert } = chai, - abiBinProvider = new AbiBinProvider(); - +const Web3 = require('web3'); +const { assert } = require('chai'); +const Package = require('../../index'); +const abiDecoder = require('abi-decoder'); +const MockContractsDeployer = require('../utils/MockContractsDeployer'); +const Mosaic = require('@openstfoundation/mosaic.js'); +const config = require('../utils/configReader'); const { dockerSetup, dockerTeardown } = require('./../../utils/docker'); +const UserSetup = Package.Setup.User; +const { Contracts } = Package; +const TokenHolderHelper = Package.Helpers.TokenHolder; +const abiBinProvider = new Package.AbiBinProvider(); + let auxiliaryWeb3, - ContractsInstance, deployerAddress, userWalletFactoryAddress, thMasterCopyAddress, @@ -29,27 +21,21 @@ let auxiliaryWeb3, delayedRecoveryModuleMasterCopyAddress, createAndAddModulesAddress, worker, - organization, - mockToken, - owner, + eip20Token, tokenHolderProxy, gnosisSafeProxy, ephemeralKey, - deployerInstance, - tokenRules, gnosisSafeProxyInstance, txOptions, - tokenHolderInstance; + tokenHolderHelperObject; describe('Wallet operations', async function() { before(async function() { const { rpcEndpointOrigin } = await dockerSetup(); auxiliaryWeb3 = new Web3(rpcEndpointOrigin); - ContractsInstance = new Contracts(auxiliaryWeb3); const accountsOrigin = await auxiliaryWeb3.eth.getAccounts(); deployerAddress = accountsOrigin[0]; worker = accountsOrigin[1]; - owner = accountsOrigin[2]; txOptions = { from: deployerAddress, @@ -62,40 +48,34 @@ describe('Wallet operations', async function() { dockerTeardown(); }); - it('Should deploy Organization contract', async function() { + it('Performs initial setup for economy', async function() { const { Organization } = Mosaic.ContractInteract; const orgConfig = { deployer: deployerAddress, - owner, + owner: deployerAddress, admin: worker, workers: [worker], workerExpirationHeight: config.workerExpirationHeight }; const organizationContractInstance = await Organization.setup(auxiliaryWeb3, orgConfig); - organization = organizationContractInstance.address; + const organization = organizationContractInstance.address; assert.isNotNull(organization, 'Organization contract address should not be null.'); - }); - - it('Deploys EIP20Token contract', async function() { - deployerInstance = new MockContractsDeployer(deployerAddress, auxiliaryWeb3); + const deployerInstance = new MockContractsDeployer(deployerAddress, auxiliaryWeb3); await deployerInstance.deployMockToken(); - mockToken = deployerInstance.addresses.MockToken; - assert.isNotNull(mockToken, 'EIP20Token contract address should not be null.'); - }); + eip20Token = deployerInstance.addresses.MockToken; + assert.isNotNull(eip20Token, 'EIP20Token contract address should not be null.'); - it('Should deploy TokenRules contract', async function() { - tokenRules = new TokenRulesSetup(auxiliaryWeb3); + const tokenRules = new Package.Setup.TokenRules(auxiliaryWeb3); - const response = await tokenRules.deploy(organization, mockToken, txOptions, auxiliaryWeb3); + const response = await tokenRules.deploy(organization, eip20Token, txOptions, auxiliaryWeb3); tokenRulesAddress = response.receipt.contractAddress; - const openstContracts = new Contracts(auxiliaryWeb3); - let contractInstance = openstContracts.TokenRules(response.receipt.contractAddress, txOptions); + const contractInstance = Contracts.getTokenRules(auxiliaryWeb3, response.receipt.contractAddress, txOptions); // Verifying stored organization and token address. - assert.strictEqual(mockToken, await contractInstance.methods.token().call(), 'Token address is incorrect'); + assert.strictEqual(eip20Token, await contractInstance.methods.token().call(), 'Token address is incorrect'); assert.strictEqual( organization, await contractInstance.methods.organization().call(), @@ -103,65 +83,51 @@ describe('Wallet operations', async function() { ); }); - it('Deploys DelayedRecoveryModule master copy.', async function() { + it('Performs Setup of TokenHolder, MultiSig, DelayedRecoveryModule master copies', async function() { const userSetup = new UserSetup(auxiliaryWeb3); + const tokenHolderTxResponse = await userSetup.deployTokenHolderMasterCopy(txOptions); + thMasterCopyAddress = tokenHolderTxResponse.receipt.contractAddress; + assert.isNotNull(thMasterCopyAddress, 'TH master copy contract address should not be null.'); + + const multiSigTxResponse = await userSetup.deployMultiSigMasterCopy(txOptions); + gnosisSafeMasterCopyAddress = multiSigTxResponse.receipt.contractAddress; + assert.isNotNull(gnosisSafeMasterCopyAddress, 'gnosis safe master copy contract address should not be null.'); + const txResponse = await userSetup.deployDelayedRecoveryModuleMasterCopy(txOptions); delayedRecoveryModuleMasterCopyAddress = txResponse.receipt.contractAddress; - assert.strictEqual(txResponse.receipt.status, true); assert.isNotNull( delayedRecoveryModuleMasterCopyAddress, "DelayedRecoveryModule master copy contract's address is null." ); }); - it('Deploys CreateAndAddModules.', async function() { + it('Performs setup of CreateAndAddModules, UserWalletFactory, ProxyFactory contracts', async function() { const userSetup = new UserSetup(auxiliaryWeb3); const txResponse = await userSetup.deployCreateAndAddModules(txOptions); createAndAddModulesAddress = txResponse.receipt.contractAddress; - assert.strictEqual(txResponse.receipt.status, true); assert.isNotNull(createAndAddModulesAddress, "createAndAddModules contract's address is null."); - }); - it('Should deploy Gnosis MultiSig MasterCopy contract', async function() { - const userSetup = new UserSetup(auxiliaryWeb3); - const multiSigTxResponse = await userSetup.deployMultiSigMasterCopy(txOptions); - gnosisSafeMasterCopyAddress = multiSigTxResponse.receipt.contractAddress; - assert.strictEqual(multiSigTxResponse.receipt.status, true); - }); - - it('Should deploy TokenHolder MasterCopy contract', async function() { - const userSetup = new UserSetup(auxiliaryWeb3); - const tokenHolderTxResponse = await userSetup.deployTokenHolderMasterCopy(txOptions); - thMasterCopyAddress = tokenHolderTxResponse.receipt.contractAddress; - assert.strictEqual(tokenHolderTxResponse.receipt.status, true); - }); - - it('Should deploy UserWalletFactory contract', async function() { - const userSetup = new UserSetup(auxiliaryWeb3); const userWalletFactoryResponse = await userSetup.deployUserWalletFactory(txOptions); userWalletFactoryAddress = userWalletFactoryResponse.receipt.contractAddress; - assert.strictEqual(userWalletFactoryResponse.receipt.status, true); - }); + assert.isNotNull(userWalletFactoryAddress, 'UserWalletFactory contract address should not be null.'); - it('Should deploy ProxyFactory contract', async function() { - const userSetup = new UserSetup(auxiliaryWeb3); const proxyFactoryResponse = await userSetup.deployProxyFactory(txOptions); proxyFactoryAddress = proxyFactoryResponse.receipt.contractAddress; - assert.strictEqual(proxyFactoryResponse.receipt.status, true); + assert.isNotNull(proxyFactoryAddress, 'Proxy contract address should not be null.'); }); // wallet3, wallet9 are the owners. - it('Should create a user wallet', async function() { + it('Creates user wallet', async function() { await auxiliaryWeb3.eth.accounts.wallet.create(10); ephemeralKey = auxiliaryWeb3.eth.accounts.wallet[0]; - const userInstance = new User( + const userInstance = new Package.Helpers.User( thMasterCopyAddress, gnosisSafeMasterCopyAddress, delayedRecoveryModuleMasterCopyAddress, createAndAddModulesAddress, - mockToken, + eip20Token, tokenRulesAddress, userWalletFactoryAddress, proxyFactoryAddress, @@ -202,10 +168,10 @@ describe('Wallet operations', async function() { // wallet1 and wallet2 are the owners. // // After AddWallet wallet1, wallet2, wallet3 are the owners. - it('Should add wallet', async function() { + it('Owner adds a wallet', async function() { await auxiliaryWeb3.eth.accounts.wallet.create(1); - gnosisSafeProxyInstance = new GnosisSafe(gnosisSafeProxy, auxiliaryWeb3); + gnosisSafeProxyInstance = new Package.Helpers.GnosisSafe(gnosisSafeProxy, auxiliaryWeb3); const ownerToAdd = auxiliaryWeb3.eth.accounts.wallet[3], currentOwner = auxiliaryWeb3.eth.accounts.wallet[1], @@ -255,7 +221,7 @@ describe('Wallet operations', async function() { // wallet1, wallet2, wallet3 are the owners. // After ReplaceWallet wallet2, wallet3, wallet4 are the owners. - it('Should replace wallet', async function() { + it('Owner replaces a wallet', async function() { const owners = await gnosisSafeProxyInstance.getOwners(); await auxiliaryWeb3.eth.accounts.wallet.create(1); const newOwner = auxiliaryWeb3.eth.accounts.wallet[4], @@ -309,7 +275,7 @@ describe('Wallet operations', async function() { // // wallet2, wallet3, wallet4 are the owners. // After RemoveWallet wallet2, wallet4 are the owners. - it('Should remove wallet', async function() { + it('Owner removes a wallet', async function() { const removeOwner = auxiliaryWeb3.eth.accounts.wallet[3], owner = auxiliaryWeb3.eth.accounts.wallet[2]; @@ -359,14 +325,14 @@ describe('Wallet operations', async function() { }); // wallet2, wallet4 are the owners. - it('Should authorize session', async function() { + it('Owner authorizes a session', async function() { await auxiliaryWeb3.eth.accounts.wallet.create(1); - tokenHolderInstance = new TokenHolder(auxiliaryWeb3, tokenRulesAddress, tokenHolderProxy); + tokenHolderHelperObject = new TokenHolderHelper(auxiliaryWeb3, tokenRulesAddress, tokenHolderProxy); const sessionKey = auxiliaryWeb3.eth.accounts.wallet[5].address; const spendingLimit = config.sessionKeySpendingLimit; const expirationHeight = config.sessionKeyExpirationHeight; const currentOwner = auxiliaryWeb3.eth.accounts.wallet[2]; - const authorizeSessionExData = tokenHolderInstance.getAuthorizeSessionExecutableData( + const authorizeSessionExData = tokenHolderHelperObject.getAuthorizeSessionExecutableData( sessionKey, spendingLimit, expirationHeight @@ -419,10 +385,10 @@ describe('Wallet operations', async function() { }); // wallet2, wallet4 are the owners. - it('Should revoke session', async function() { + it('Owner revokes a session', async function() { const sessionKey = auxiliaryWeb3.eth.accounts.wallet[5].address; const currentOwner = auxiliaryWeb3.eth.accounts.wallet[2]; - const revokeSessionExData = tokenHolderInstance.getRevokeSessionExecutableData(sessionKey); + const revokeSessionExData = tokenHolderHelperObject.getRevokeSessionExecutableData(sessionKey); const nonce = await gnosisSafeProxyInstance.getNonce(); const safeTxData = gnosisSafeProxyInstance.getSafeTxData( @@ -471,8 +437,8 @@ describe('Wallet operations', async function() { }); // wallet2, wallet4 are the owners. - it('Should logout all authorized sessions', async function() { - const tokenHolderInstance = new TokenHolder(auxiliaryWeb3, tokenHolderProxy); + it('Owner logs out all sessions', async function() { + const tokenHolderInstance = new TokenHolderHelper(auxiliaryWeb3, tokenHolderProxy); const currentOwner = auxiliaryWeb3.eth.accounts.wallet[2]; const logoutExData = tokenHolderInstance.getLogoutExecutableData(); @@ -520,7 +486,7 @@ describe('Wallet operations', async function() { }); // wallet2, wallet4 are the owners. - it('Should change required threshold', async function() { + it('Owner changes required threshold', async function() { // Owners already added should be equal or less than the threshold limit. const newThreshold = 2; const currentOwner = auxiliaryWeb3.eth.accounts.wallet[2]; diff --git a/test/utils/MockContractsDeployer.js b/test/utils/MockContractsDeployer.js index 84abbe8..8824cf3 100644 --- a/test/utils/MockContractsDeployer.js +++ b/test/utils/MockContractsDeployer.js @@ -38,30 +38,24 @@ class MockContractsDeployer { */ deployMockToken(web3, txOptions) { const oThis = this; - return oThis.deploy('MockToken', web3, txOptions); + return oThis.deploy('MockToken', web3, [], txOptions); } - /** - * It deploys mock gateway contract. - * - * @param web3 Auxiliary chain web3 object. - * @param txOptions Tx options. - * @returns Promise object. - */ - deployMockGatewayPass(web3, txOptions) { + deployPriceOracle(web3, args, txOptions) { const oThis = this; - return oThis.deploy('MockGatewayPass', web3, txOptions); + return oThis.deploy('PriceOracle', web3, args, txOptions); } /** - * It deploys the contract. + * It deploys the mock contract. * * @param contractName Name for the contract to deploy. * @param web3 Auxiliary chain web3. + * @param args Deployment arguments. * @param txOptions Tx options. * @returns Promise object. */ - deploy(contractName, web3, txOptions) { + deploy(contractName, web3, args = [], txOptions) { const oThis = this; web3 = web3 || oThis.web3; const abiBinProvider = oThis.abiBinProvider; @@ -78,8 +72,6 @@ class MockContractsDeployer { Object.assign(defaultOptions, txOptions); } txOptions = defaultOptions; - - let args = []; const contract = new web3.eth.Contract(abi, null, txOptions); let tx = contract.deploy( { @@ -89,24 +81,18 @@ class MockContractsDeployer { txOptions ); - console.log(`* Deploying ${contractName} Contract`); let txReceipt; return tx .send(txOptions) - .on('transactionHash', function(transactionHash) { - console.log('\t - transaction hash:', transactionHash); - }) + .on('transactionHash', function(transactionHash) {}) .on('error', function(error) { - console.log('\t !! Error !!', error, '\n\t !! ERROR !!\n'); return Promise.reject(error); }) .on('receipt', function(receipt) { txReceipt = receipt; - console.log('\t - Receipt:\n\x1b[2m', JSON.stringify(receipt), '\x1b[0m\n'); }) .then(function(instance) { oThis.addresses[contractName] = instance.options.address; - console.log(`\t - ${contractName} Contract Address:`, instance.options.address); return txReceipt; }); } diff --git a/test/utils/configReader.js b/test/utils/configReader.js index 8ff1473..b2ed707 100644 --- a/test/utils/configReader.js +++ b/test/utils/configReader.js @@ -8,13 +8,16 @@ ConfigReader.prototype = { gas: 7500000, ZERO_BYTES: '0x0000000000000000000000000000000000000000000000000000000000000000', NULL_ADDRESS: '0x0000000000000000000000000000000000000000', - tokenHolderBalance: '1111', + senderTokenHolderBalance: '1111', baseCurrencyCode: 'OST', - conversionRate: 2, - conversionRateDecimals: 18, - requiredPriceOracleDecimals: 18, - sessionKeySpendingLimit: 1000000, - sessionKeyExpirationHeight: 100000000000, + payCurrencyCode: 'USD', + conversionRate: '10', + conversionRateDecimals: '5', + requiredPriceOracleDecimals: '18', + sessionKeySpendingLimit: '1000000000000000000000', //1000 ethers + sessionKeyExpirationHeight: '1000000000000000000', + price: '10000000000', + acceptanceMargin: '10000000000', auxiliaryPort: 8546, workerExpirationHeight: '20000000' }; diff --git a/test/utils/mock-contracts/abi/PriceOracle.abi b/test/utils/mock-contracts/abi/PriceOracle.abi new file mode 100644 index 0000000..ed85687 --- /dev/null +++ b/test/utils/mock-contracts/abi/PriceOracle.abi @@ -0,0 +1 @@ +[{"constant":false,"inputs":[{"name":"_adminAddress","type":"address"}],"name":"setAdminAddress","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"priceValidityDuration","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_opsAddress","type":"address"}],"name":"setOpsAddress","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"quoteCurrency","outputs":[{"name":"","type":"bytes3"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"opsAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_price","type":"uint256"}],"name":"setPrice","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"baseCurrency","outputs":[{"name":"","type":"bytes3"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getPrice","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"expirationHeight","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_proposedOwner","type":"address"}],"name":"initiateOwnershipTransfer","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"proposedOwner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"completeOwnershipTransfer","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"adminAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_baseCurrency","type":"bytes3"},{"name":"_quoteCurrency","type":"bytes3"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_price","type":"uint256"},{"indexed":true,"name":"_expirationHeight","type":"uint256"}],"name":"PriceUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_newAddress","type":"address"}],"name":"AdminAddressChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_newAddress","type":"address"}],"name":"OpsAddressChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_proposedOwner","type":"address"}],"name":"OwnershipTransferInitiated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_newOwner","type":"address"}],"name":"OwnershipTransferCompleted","type":"event"}] \ No newline at end of file diff --git a/test/utils/mock-contracts/bin/PriceOracle.bin b/test/utils/mock-contracts/bin/PriceOracle.bin new file mode 100644 index 0000000..b705a80 --- /dev/null +++ b/test/utils/mock-contracts/bin/PriceOracle.bin @@ -0,0 +1 @@ +0x6060604052341561000f57600080fd5b6040516040806107e2833981016040528080519190602001805160008054600160a060020a03191633600160a060020a03161790559150507fffffff0000000000000000000000000000000000000000000000000000000000808216908316141561007957600080fd5b6006805465ffffff000000191663010000007d01000000000000000000000000000000000000000000000000000000000093849004021762ffffff191691909204179055610716806100cc6000396000f3006060604052600436106100da5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416632c1e816d81146100df578063313ce56714610112578063562e58011461013b578063707789c51461016057806382564bca1461017f5780638da5cb5b146101c75780638ea64376146101f657806391b7f5ed1461020957806392a85fde1461021f57806398d5fdca14610232578063a05e7d0914610245578063c0b6f56114610258578063d153b60c14610277578063e71a78111461028a578063fc6f94681461029d575b600080fd5b34156100ea57600080fd5b6100fe600160a060020a03600435166102b0565b604051901515815260200160405180910390f35b341561011d57600080fd5b610125610383565b60405160ff909116815260200160405180910390f35b341561014657600080fd5b61014e610388565b60405190815260200160405180910390f35b341561016b57600080fd5b6100fe600160a060020a036004351661038e565b341561018a57600080fd5b610192610461565b6040517fffffff0000000000000000000000000000000000000000000000000000000000909116815260200160405180910390f35b34156101d257600080fd5b6101da61048e565b604051600160a060020a03909116815260200160405180910390f35b341561020157600080fd5b6101da61049d565b341561021457600080fd5b61014e6004356104ac565b341561022a57600080fd5b610192610518565b341561023d57600080fd5b61014e61053e565b341561025057600080fd5b61014e610559565b341561026357600080fd5b6100fe600160a060020a036004351661055f565b341561028257600080fd5b6101da6105d4565b341561029557600080fd5b6100fe6105e3565b34156102a857600080fd5b6101da61066a565b60006102bb33610679565b806102ca57506102ca3361068d565b15156102d557600080fd5b600054600160a060020a03838116911614156102f057600080fd5b30600160a060020a031682600160a060020a03161415151561031157600080fd5b61031a826106bd565b1561032457600080fd5b6003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0384169081179091557f17bb0532ac84902a52bb6799529153f5ea501fc54fbcf3ea00dbd42bceb6b0f460405160405180910390a2506001919050565b601290565b61465090565b600061039933610679565b806103a857506103a83361068d565b15156103b357600080fd5b600054600160a060020a03838116911614156103ce57600080fd5b30600160a060020a031682600160a060020a0316141515156103ef57600080fd5b6103f88261068d565b1561040257600080fd5b6002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0384169081179091557fac46a4511b8366ae3b7cf3cf342e31556274975598dcae03c866f8f0f55d51c460405160405180910390a2506001919050565b600654630100000090047d0100000000000000000000000000000000000000000000000000000000000290565b600054600160a060020a031681565b600254600160a060020a031681565b60006104b7336106bd565b15156104c257600080fd5b600082116104cf57600080fd5b60048290556104dc610388565b43016005819055827f945c1c4e99aa89f648fbfe3df471b916f719e16d960fcec0737d4d56bd69683860405160405180910390a3505060055490565b6006547d0100000000000000000000000000000000000000000000000000000000000290565b6000600554431161055157600454610554565b60005b905090565b60055490565b600061056a33610679565b151561057557600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0384169081179091557f20f5afdf40bf7b43c89031a5d4369a30b159e512d164aa46124bcb706b4a1caf60405160405180910390a2506001919050565b600154600160a060020a031681565b60015460009033600160a060020a0390811691161461060157600080fd5b6001805460008054600160a060020a0380841673ffffffffffffffffffffffffffffffffffffffff1992831617928390559216909255167f624adc4c72536289dd9d5439ccdeccd8923cb9af95fb626b21935447c77b840760405160405180910390a250600190565b600354600160a060020a031681565b600054600160a060020a0390811691161490565b600354600090600160a060020a0316158015906106b75750600354600160a060020a038381169116145b92915050565b600254600090600160a060020a0316158015906106b7575050600254600160a060020a03908116911614905600a165627a7a723058203f6e7a24b564bf56e730f696bfdd26eff71005b31dae00edced0a5b27d222ab50029 \ No newline at end of file diff --git a/utils/DeployContract.js b/utils/DeployContract.js index 4246c4a..1da4938 100644 --- a/utils/DeployContract.js +++ b/utils/DeployContract.js @@ -33,15 +33,12 @@ class DeployContract { let receipt = null, transactionHash = null; - console.log('Deploying contract: ' + oThis.contractName); - let instance = await oThis.txObject .send(oThis.txOptions) .on('receipt', function(value) { receipt = value; }) .on('transactionHash', function(value) { - console.log('transaction hash for ' + oThis.contractName + ' : ' + value); transactionHash = value; }) .on('error', function(error) { @@ -59,9 +56,6 @@ class DeployContract { return Promise.reject('Contract deployment failed. oThis.web3.eth.getCode returned empty code.'); } - console.log('Address :', contractAddress); - console.log('Gas used :', receipt.gasUsed, '\n'); - return Promise.resolve({ receipt: receipt, instance: instance