Skip to content

Commit

Permalink
Merge pull request #66 from abhayks1/rule_deploy
Browse files Browse the repository at this point in the history
Deployment of PricerRule and It's interactions
  • Loading branch information
gulshanvasnani authored Feb 6, 2019
2 parents f60d0c9 + 5dc2697 commit 1b17fe3
Show file tree
Hide file tree
Showing 19 changed files with 3,081 additions and 2,057 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ branches:
only:
- master
- develop
- /^release-.*/
notifications:
email:
recipients:
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Version 0.10.0

Rule setup: Pricer rule setup and interaction([66](https://github.com/OpenSTFoundation/openst.js/pull/66))
User setup: Company to User Implementation([68](https://github.com/OpenSTFoundation/openst.js/pull/68))
Direct transfer of tokens using TokenRules contract([67](https://github.com/OpenSTFoundation/openst.js/pull/67))
TokenRules: Create a getter to fetch registered rules([#60](https://github.com/OpenSTFoundation/openst.js/pull/60))
TokenRules : Rules registration framework for registration of rules([#60](https://github.com/OpenSTFoundation/openst.js/pull/60))
User setup : Implement createUserWallet ([#55](https://github.com/OpenSTFoundation/openst.js/pull/55))
Expand Down
1 change: 1 addition & 0 deletions contracts/abi/PricerRule.abi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"constant":true,"inputs":[{"name":"","type":"bytes3"}],"name":"baseCurrencyPriceAcceptanceMargins","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"organization","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"eip20Token","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"bytes3"}],"name":"baseCurrencyPriceOracles","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"conversionRateFromBaseCurrencyToToken","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"tokenRules","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"requiredPriceOracleDecimals","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"conversionRateDecimalsFromBaseCurrencyToToken","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"baseCurrencyCode","outputs":[{"name":"","type":"bytes3"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_organization","type":"address"},{"name":"_eip20Token","type":"address"},{"name":"_baseCurrencyCode","type":"bytes3"},{"name":"_conversionRate","type":"uint256"},{"name":"_conversionRateDecimals","type":"uint8"},{"name":"_requiredPriceOracleDecimals","type":"uint8"},{"name":"_tokenRules","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_priceOracle","type":"address"}],"name":"PriceOracleAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_priceOracle","type":"address"}],"name":"PriceOracleRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_quoteCurrencyCode","type":"bytes3"},{"indexed":false,"name":"_acceptanceMargin","type":"uint256"}],"name":"AcceptanceMarginSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_quoteCurrencyCode","type":"bytes3"}],"name":"AcceptanceMarginRemoved","type":"event"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_toList","type":"address[]"},{"name":"_amountList","type":"uint256[]"},{"name":"_payCurrencyCode","type":"bytes3"},{"name":"_baseCurrencyIntendedPrice","type":"uint256"}],"name":"pay","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_priceOracle","type":"address"}],"name":"addPriceOracle","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_payCurrencyCode","type":"bytes3"}],"name":"removePriceOracle","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_payCurrencyCode","type":"bytes3"},{"name":"_acceptanceMargin","type":"uint256"}],"name":"setAcceptanceMargin","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_payCurrencyCode","type":"bytes3"}],"name":"removeAcceptanceMargin","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"}]
1 change: 1 addition & 0 deletions contracts/bin/PricerRule.bin
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0x608060405234801561001057600080fd5b5060405160e080611874833981018060405260e081101561003057600080fd5b508051602082015160408301516060840151608085015160a086015160c090960151949593949293919290919086600160a060020a03811615156100fb57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f4f7267616e697a6174696f6e20636f6e74726163742061646472657373206d7560448201527f7374206e6f74206265207a65726f2e0000000000000000000000000000000000606482015290519081900360840190fd5b60008054600160a060020a031916600160a060020a039283161790558616151561018657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f546f6b656e2061646472657373206973206e756c6c2e00000000000000000000604482015290519081900360640190fd5b7fffffff00000000000000000000000000000000000000000000000000000000008516151561021657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f426173652063757272656e637920636f6465206973206e756c6c2e0000000000604482015290519081900360640190fd5b8315156102aa57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603960248201527f436f6e76657273696f6e20726174652066726f6d20746865206261736520637560448201527f7272656e637920746f2074686520746f6b656e20697320302e00000000000000606482015290519081900360840190fd5b600160a060020a038116151561032157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f546f6b656e2072756c65732061646472657373206973206e756c6c2e00000000604482015290519081900360640190fd5b60018054600160a060020a03978816600160a060020a0319909116179055600080547d010000000000000000000000000000000000000000000000000000000000909604740100000000000000000000000000000000000000000260a060020a62ffffff02199096169590951790945560029290925560ff90811660035560048054939094166101000261010060a860020a03199290911660ff1990931692909217161790555061149d806103d76000396000f3fe6080604052600436106100b65763ffffffff60e060020a60003504166306a2768781146100bb5780631e82d63d1461010157806323bd4d7a146101365780635a887047146101675780635a8f940814610256578063612367bf1461026b578063780e2e2e1461029f5780637db547c7146102b45780639c144d5e146102e8578063bb716ef4146102fd578063e5c379d814610337578063f07478af14610362578063f756eb7314610396578063fabdb613146103ab575b600080fd5b3480156100c757600080fd5b506100ef600480360360208110156100de57600080fd5b5035600160e860020a0319166103dd565b60408051918252519081900360200190f35b34801561010d57600080fd5b506101346004803603602081101561012457600080fd5b5035600160a060020a03166103ef565b005b34801561014257600080fd5b5061014b6108eb565b60408051600160a060020a039092168252519081900360200190f35b34801561017357600080fd5b50610134600480360360a081101561018a57600080fd5b600160a060020a0382351691908101906040810160208201356401000000008111156101b557600080fd5b8201836020820111156101c757600080fd5b803590602001918460208302840111640100000000831117156101e957600080fd5b91939092909160208101903564010000000081111561020757600080fd5b82018360208201111561021957600080fd5b8035906020019184602083028401116401000000008311171561023b57600080fd5b9193509150600160e860020a031981351690602001356108fa565b34801561026257600080fd5b5061014b610cb8565b34801561027757600080fd5b5061014b6004803603602081101561028e57600080fd5b5035600160e860020a031916610cc7565b3480156102ab57600080fd5b506100ef610ce2565b3480156102c057600080fd5b50610134600480360360208110156102d757600080fd5b5035600160e860020a031916610ce8565b3480156102f457600080fd5b5061014b610e6f565b34801561030957600080fd5b506101346004803603604081101561032057600080fd5b50600160e860020a03198135169060200135610e83565b34801561034357600080fd5b5061034c611010565b6040805160ff9092168252519081900360200190f35b34801561036e57600080fd5b506101346004803603602081101561038557600080fd5b5035600160e860020a031916611019565b3480156103a257600080fd5b506100ef611201565b3480156103b757600080fd5b506103c0611207565b60408051600160e860020a03199092168252519081900360200190f35b60066020526000908152604090205481565b6000546040805160e060020a63aa1566450281523360048201529051600160a060020a039092169163aa15664591602480820192602092909190829003018186803b15801561043d57600080fd5b505afa158015610451573d6000803e3d6000fd5b505050506040513d602081101561046757600080fd5b505115156104c1576040805160e560020a62461bcd02815260206004820152603960248201526000805160206114528339815191526044820152600080516020611432833981519152606482015290519081900360840190fd5b600160a060020a0381161515610521576040805160e560020a62461bcd02815260206004820152601d60248201527f5072696365206f7261636c652061646472657373206973206e756c6c2e000000604482015290519081900360640190fd5b60048054604080517f313ce567000000000000000000000000000000000000000000000000000000008152905160ff90921692600160a060020a0385169263313ce567928083019260209291829003018186803b15801561058157600080fd5b505afa158015610595573d6000803e3d6000fd5b505050506040513d60208110156105ab57600080fd5b505160ff1614610651576040805160e560020a62461bcd02815260206004820152604160248201527f5072696365206f7261636c6520646563696d616c73206e756d6265722069732060448201527f646966666572656e63652066726f6d20746865207265717569726564206f6e6560648201527f2e00000000000000000000000000000000000000000000000000000000000000608482015290519081900360a40190fd5b600081600160a060020a03166382564bca6040518163ffffffff1660e060020a02815260040160206040518083038186803b15801561068f57600080fd5b505afa1580156106a3573d6000803e3d6000fd5b505050506040513d60208110156106b957600080fd5b5051600160e860020a03198116600090815260056020526040902054909150600160a060020a031615610736576040805160e560020a62461bcd02815260206004820152601c60248201527f5072696365206f7261636c6520616c7265616479206578697374732e00000000604482015290519081900360640190fd5b600060149054906101000a90047d010000000000000000000000000000000000000000000000000000000000027cffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191682600160a060020a03166392a85fde6040518163ffffffff1660e060020a02815260040160206040518083038186803b1580156107bf57600080fd5b505afa1580156107d3573d6000803e3d6000fd5b505050506040513d60208110156107e957600080fd5b5051600160e860020a03191614610870576040805160e560020a62461bcd02815260206004820152603160248201527f5072696365206f7261636c65277320626173652063757272656e637920636f6460448201527f6520646f6573206e6f74206d617463682e000000000000000000000000000000606482015290519081900360840190fd5b600160e860020a03198116600090815260056020908152604091829020805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038616908117909155825190815291517facf23cc5480d1d549f783a7bd5430fec8c74f0044e925e78beb6733023a105159281900390910190a15050565b600054600160a060020a031681565b600160a060020a038716151561095a576040805160e560020a62461bcd02815260206004820152601560248201527f46726f6d2061646472657373206973206e756c6c2e0000000000000000000000604482015290519081900360640190fd5b8483146109d7576040805160e560020a62461bcd02815260206004820152603960248201527f27746f2720616e642027616d6f756e7427207472616e7366657220617272617960448201527f7327206c656e6774687320617265206e6f7420657175616c2e00000000000000606482015290519081900360840190fd5b8415156109e357610caf565b60006109ee83611245565b9050801515610a6d576040805160e560020a62461bcd02815260206004820152602960248201527f426173652063757272656e637920707269636520696e2070617920637572726560448201527f6e637920697320302e0000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600160e860020a03198316600090815260066020526040902054610a949083908390611354565b1515610b36576040805160e560020a62461bcd02815260206004820152604160248201527f496e74656e646564207072696365206973206e6f7420696e207468652061636360448201527f65707461626c65206d617267696e207772742063757272656e7420707269636560648201527f2e00000000000000000000000000000000000000000000000000000000000000608482015290519081900360a40190fd5b604080518581526020808702820101909152606090858015610b62578160200160208202803883390190505b50905060005b85811015610bac57610b8c83888884818110610b8057fe5b90506020020135611394565b8282815181101515610b9a57fe5b60209081029091010152600101610b68565b50600480546040517fa6a192da000000000000000000000000000000000000000000000000000000008152600160a060020a038c8116938201938452606060248301908152606483018c9052610100909304169263a6a192da928d928d928d92889260448101906084018660208702808284376000838201819052601f909101601f1916909201858103845286518152865160209182019382890193509102908190849084905b83811015610c6b578181015183820152602001610c53565b505050509050019650505050505050600060405180830381600087803b158015610c9457600080fd5b505af1158015610ca8573d6000803e3d6000fd5b5050505050505b50505050505050565b600154600160a060020a031681565b600560205260009081526040902054600160a060020a031681565b60025481565b6000546040805160e060020a63aa1566450281523360048201529051600160a060020a039092169163aa15664591602480820192602092909190829003018186803b158015610d3657600080fd5b505afa158015610d4a573d6000803e3d6000fd5b505050506040513d6020811015610d6057600080fd5b50511515610dba576040805160e560020a62461bcd02815260206004820152603960248201526000805160206114528339815191526044820152600080516020611432833981519152606482015290519081900360840190fd5b600160e860020a031981161515610e1b576040805160e560020a62461bcd02815260206004820152601a60248201527f5061792063757272656e637920636f6465206973206e756c6c2e000000000000604482015290519081900360640190fd5b600160e860020a03198116600081815260066020908152604080832092909255815192835290517f2c48f41fb0ac91148a38a270c2227239ead8136223f9b12cf603e57c799d5e609281900390910190a150565b6004546101009004600160a060020a031681565b6000546040805160e060020a63aa1566450281523360048201529051600160a060020a039092169163aa15664591602480820192602092909190829003018186803b158015610ed157600080fd5b505afa158015610ee5573d6000803e3d6000fd5b505050506040513d6020811015610efb57600080fd5b50511515610f55576040805160e560020a62461bcd02815260206004820152603960248201526000805160206114528339815191526044820152600080516020611432833981519152606482015290519081900360840190fd5b600160e860020a031982161515610fb6576040805160e560020a62461bcd02815260206004820152601a60248201527f5061792063757272656e637920636f6465206973206e756c6c2e000000000000604482015290519081900360640190fd5b600160e860020a031982166000818152600660209081526040918290208490558151928352820183905280517f9342d2e77f78a211818c17938619fcbb5d57089d24841841df0ff3fa4b13b1639281900390910190a15050565b60045460ff1681565b6000546040805160e060020a63aa1566450281523360048201529051600160a060020a039092169163aa15664591602480820192602092909190829003018186803b15801561106757600080fd5b505afa15801561107b573d6000803e3d6000fd5b505050506040513d602081101561109157600080fd5b505115156110eb576040805160e560020a62461bcd02815260206004820152603960248201526000805160206114528339815191526044820152600080516020611432833981519152606482015290519081900360840190fd5b600160e860020a03198116600090815260056020526040902054600160a060020a031680151561118b576040805160e560020a62461bcd02815260206004820152602660248201527f5072696365206f7261636c6520746f2072656d6f766520646f6573206e6f742060448201527f65786973742e0000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600160e860020a03198216600090815260056020908152604091829020805473ffffffffffffffffffffffffffffffffffffffff191690558151600160a060020a038416815291517f1ab93c820592302b2bef0070dd03654585b6942bfde155498ddd3d69190bf0429281900390910190a15050565b60035481565b6000547401000000000000000000000000000000000000000090047d0100000000000000000000000000000000000000000000000000000000000281565b600160e860020a03198116600090815260056020526040812054600160a060020a03168015156112e5576040805160e560020a62461bcd02815260206004820152603c60248201527f5072696365206f7261636c6520666f722074686520737065636966696564206360448201527f757272656e637920636f646520646f6573206e6f742065786973742e00000000606482015290519081900360840190fd5b80600160a060020a03166398d5fdca6040518163ffffffff1660e060020a02815260040160206040518083038186803b15801561132157600080fd5b505afa158015611335573d6000803e3d6000fd5b505050506040513d602081101561134b57600080fd5b50519392505050565b600080848411156113765761136f848663ffffffff6113cd16565b9050611389565b611386858563ffffffff6113cd16565b90505b909110159392505050565b60006113c4836113b8600354600a0a6113b8600254876113e290919063ffffffff16565b9063ffffffff61140d16565b90505b92915050565b6000828211156113dc57600080fd5b50900390565b60008215156113f3575060006113c7565b82820282848281151561140257fe5b04146113c457600080fd5b600080821161141b57600080fd5b6000828481151561142857fe5b0494935050505056fe6f77656420746f2063616c6c2074686973206d6574686f642e000000000000004f6e6c792077686974656c697374656420776f726b6572732061726520616c6ca165627a7a723058206696dd4884bc5cb715d206f6194d2d0013e3d96e2be96dc3c8a2535f489e9ae30029
Loading

0 comments on commit 1b17fe3

Please sign in to comment.