diff --git a/.circleci/config.yml b/.circleci/config.yml index 62be63a..138df06 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -25,7 +25,7 @@ jobs: - save_cache: paths: - node_modules - key: v1-dependencies-{{ checksum "package.json" }} + key: v1-{{ .Branch }}-dependencies-{{ checksum "package.json" }} - run: npx truffle compile --all - run: npx zos push --network development - run: npx zos publish --network development diff --git a/contracts/crowdloan/CrowdloanToken.sol b/contracts/crowdloan/CrowdloanToken.sol new file mode 100644 index 0000000..2e038bc --- /dev/null +++ b/contracts/crowdloan/CrowdloanToken.sol @@ -0,0 +1,31 @@ +pragma solidity 0.5.11; + +import "openzeppelin-eth/contracts/math/SafeMath.sol"; +import "openzeppelin-eth/contracts/token/ERC20/StandaloneERC20.sol"; + +contract CrowdloanToken is StandaloneERC20 { + using SafeMath for uint256; + + function initialize( + string memory name, + string memory symbol, + uint256 decimals, + uint256 initialSupply, + address initialHolder + ) public { + address[] memory emptyAdressArray = new address[](0); + if (initialHolder == address(0)) { + initialHolder = msg.sender; + } + + StandaloneERC20.initialize( + name, + symbol, + uint8(decimals), + initialSupply, + initialHolder, + emptyAdressArray, //Minters + emptyAdressArray //Pausers + ); + } +} diff --git a/contracts/crowdloan/ICrowdloan.sol b/contracts/crowdloan/ICrowdloan.sol new file mode 100644 index 0000000..0a4682a --- /dev/null +++ b/contracts/crowdloan/ICrowdloan.sol @@ -0,0 +1,32 @@ +pragma solidity 0.5.11; + +contract ICrowdloan { + function amountRepaid () external returns (uint256); + function borrower () external returns (uint256); + function crowdfundStart () external returns (uint256); + function crowdfundEnd () external returns (uint256); + function crowdfundDuration () external returns (uint256); + function principalRequested () external returns (uint256); + function repaymentCap () external returns (uint256); + function totalRepaymentWithdrawn () external returns (uint256); + function loanMetadataUrl () external returns (string memory); + + function amountContributed (address) external returns (uint256); + function repaymentWithdrawn (address) external returns (uint256); + + function fund (uint256) external; + function repay (uint256) external; + function withdrawPrincipal (uint256) external; + function withdrawRepayment () external; + function startCrowdfund () external; + + // Events + event Fund(address sender, uint256 amount); + event WithdrawPrincipal(address borrower, uint256 amount); + event WithdrawRepayment(address lender, uint256 amount); + event Repay(uint256 amount); + event StartCrowdfund(uint256 crowdfundStart); + + + +}