From 18369142ed48c54c109d96c67ae4ea2bba4d1807 Mon Sep 17 00:00:00 2001 From: John Kelleher Date: Sat, 7 Sep 2019 23:00:12 -0400 Subject: [PATCH] stubbed version of balancer --- contracts/balancer.sol | 73 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 contracts/balancer.sol diff --git a/contracts/balancer.sol b/contracts/balancer.sol new file mode 100644 index 0000000..e7004f7 --- /dev/null +++ b/contracts/balancer.sol @@ -0,0 +1,73 @@ +pragma solidity >=0.5.3; + +contract Balancer { + event DepositMade(uint ethAmount, uint daiAmount, uint liquidity); + event WithdrawalMade(uint liquidity, uint ethAmount, uint daiAmount); + event Rebalance(uint oraclePrice, uint amountIn, uint amountOut, string tradeDirection, string exchange); + + + uint[] balances; #Liquidity balance of an address + address currentFutarchy; #Address of current futarchy decision + + /** + * @dev + * @param + * @return + */ + function newFutarchy() + public + { + # Call futarchy factory + # Set current futarchy + } + + /** + * @dev + * @param + * @return + */ + function deposit(uint tokenAmount) + public + payable + { + #Check current position + #Transfer into current position if necessary + #Send liquidity token to depositor + #Emit deposit event + } + + /** + * @dev + * @param + * @return + */ + function withdraw(uint liquidity) + public + { + #Send amount from current position to liquidity holder + #Deduct liquidity from balance + } + + /** + * @dev + * @param + * @return + */ + function rebalance() + public + { + #Call getDecision() + #Make trade on Uniswap or Kyber + } + + /** + * @dev + * @param + * @return + */ + function getDecision() + public + { + # get decision from curentFutarchy + } +}