I'm using a very simple crowdsale it just sells tokens in ratio 1ETH=10000 tokens
I would like to change this so every day token would be more expensive for example
Day1: 1ETH = 10 000 Tokens Day2: 1ETH = 9 950 Tokens Day3: 1ETH = 9 900 Tokens
and so on...
heres the code i use now
pragma solidity ^0.4.18;
interface token {
function transfer(address receiver, uint amount) external;
}
contract Crowdsale {
address public beneficiary;
uint public amountRaised;
uint public price;
token public tokenReward;
mapping(address => uint256) public balanceOf;
event FundTransfer(address backer, uint amount, bool isContribution);
/**
* Constructor function
*
* Setup the owner
*/
constructor(
address ifSuccessfulSendTo,
uint milietherCostOfEachToken,
address addressOfTokenUsedAsReward
) public {
beneficiary = ifSuccessfulSendTo;
price = milietherCostOfEachToken * 0.0001 ether;
tokenReward = token(addressOfTokenUsedAsReward);
}
function () payable public {
uint amount = msg.value;
balanceOf[msg.sender] += amount;
amountRaised += amount;
tokenReward.transfer(msg.sender, amount * 10**18 / price);
emit FundTransfer(msg.sender, amount, true);
// Forward funds immediately to beneficiary
beneficiary.transfer(amount);
}
}