19

A hard cap is defined as the maximum amount a crowdsale will receive. Most projects set a very high cap that is unlikely to happen. Only very famous projects like Status or Brave browser have reached its hard cap. contract crowdsale { uint public maximumEther; uint public totalEther; function () payable { // Do not accept payment if ...


14

Vesting with a cliff is a typical requirement for founders holding shares of a company so they don't just leave the company when they are most needed with the shares they have. The same concept has been translated to ICOs so the founders (and key team members, advisors, etc) don't just dump their tokens as soon as they are listed on exchanges. Vesting ...


8

If you want to accept the Ether in a smart contract then you should have a fallback function. The fallback function will be called by default when someone transfers ETH to the contract address. contract Crowdfunder{ function() Crowdfunder { } function() payable { contributions.push( Contribution({ amount: msg.value, ...


7

Yup, its the same - but if you give 10 developers the same problem you could get 10 different ways of solving it. Its interesting though, if you think about it - Ethereum actually rewards users of more efficient code by charging more for complex solutions.


7

It's slightly more complicated because users don't just send you tokens. They have to first give you allowance to spend the token, then they call your function (say tokenToEther()) First your user would call this function on the token contract, assuming the contract implements ERC-20 interface. function approve(address _spender, uint256 _value) returns (...


6

The origin of the issue is because you're trying to deploy the contract from the file migrations/1_initial_migration.js that is supposed to be used only for the deployment of Migration.sol. To deploy your contracts, you need to create a file in migrations/2_deploy_contracts.js that contains the deployment part of TestCrowsale.sol migrations/...


5

An Ethereum contract cannot directly interact with other blockchains. You have to use a service like BTC Relay, their project on github.


4

I would suggest you using NodeJS and web3js library to interact with ethereum. It would not be really hard to get into NodeJS of you are a web developer. My team and I opened a source code of the dashboard so you can pick it, modify and use. It's already tested in real world and passed security audit. Here is backend. API docs can be found here. Frontend ...


4

This is only a partial answer to your question. One issue you would face is that deposits by people who buy your tokens with BTC or any other cryptocurrency besides ETH would have to be credited manually since they would not be able to interact directly with a smart contract. SONM's ICO accepted both ETH and BTC and run into quite a lot of challenges with ...


4

We had some of the same problems as you did. What we figured out was the following: startTime and endTime must be set so that when you call the contract, you are in fact buying tokens when the sale is open. We added a hasStarted() method and called both this and the hasEnded() method to make sure that we were in fact within the sale period. The startTime ...


4

Check any abstract/interface methods are being implemented correctly. I get this issue, where it compiles but won't deploy, when I fail to implement abstract/interface methods correctly in inheriting contracts. Edit: Also check all the require statements in the Crowdsale constructor will pass. Maybe try with hardcoding a startTime definitely in the future ...


3

You should clarify what you mean by an attack. If you are using your tokens as a mean to get consensus from all the token holders than yeah, owning more than 50% of the tokens effectively means they have control over the decision.


3

All the transfers seem to have the same from and to address (the token contract). I believe the issue is this line in buyTokens: ERC20(token).transfer(this, tokens); Shouldn't that read as follows? ERC20(token).transfer(beneficiary, tokens);


3

For example, when you create a new RefundVault inside of the crowdsale you pass in an address in the constructor. What address should this be? That's the crowdsale's wallet address. The Crowdsale contract has a wallet state variable storing the addess to which the funds raised will be sent. The RefundVault contract used by the RefundableCrowdsale works ...


3

This sounds like a perfect use case for the now finalized ERC-1155 token standard, which allows one to manage any number of fungible and non fungible tokens in a single contract.


2

ICO: Initial coin offering: Doesn't have anything to do with an organization. It can be used by an organization to reward their tokens to members that contribute.


2

Have a look at Interacting with smart contracts using truffles. If you deployed your smart contract with the name SampleCrowdsale, for example with var mycrowdsale = SampleCrowdsale.deployed(); then you have access to the function mint(): mycrowdsale.mint(to, amount); with to as the receiver address and amount the number of tokens created. You can also ...


2

Has anybody used this code to crowdsale tokens and perform a withdrawal as a user? IMO that code is more a sketch of an actual ICO and not meant as a secure and proper ICO reference implementation. It has at least one issue described below. Furthermore, I am not aware of anyone using exactly this code, most of the time the upper limit (cap) seems to be more ...


2

The investors are not owners of the multisig, the founders of the project are. The standard is for the token contract to implement ERC20 such that investors can transfer their tokens (etc). Multisignature features are used such that owners can not withdraw the proceeds of the crowdsale without multiple signatures. It gives investors confidence, and ...


2

You've possibly provided too little information to really be helpful. Can you post the contract's address and the parameters used to create it? address ifSuccessfulSendTo = uint fundingGoalInEthers = uint durationInMinutes = uint etherCostOfEachToken = token addressOfTokenUsedAsReward = Regardless, couple things you can try: ...


2

Yes, of course. Both block timestamp and block number are equally reliable. There is an entire alarm clock system built in ethereum for executing something at a later stage. For more info on that you can even have a look at How can a contract run itself at a later time?


2

SampleCrowdsale is the contract constructor. It is called automatically when the contract is created. You can tell it is the constructor because the name of the method is the same as the name of the contract. You can pass these variables when creating the contract or you could deploy it from within another contract and pass those variables in. You could ...


2

These are the relevant parts: modifier afterDeadline() { if (now >= deadline) _; } and function safeWithdrawal() afterDeadline { if (!fundingGoalReached) { uint amount = balanceOf[msg.sender]; balanceOf[msg.sender] = 0; if (amount > 0) { if (msg.sender.send(amount)) { FundTransfer(msg.sender, ...


2

Just to add to the answerof cappy, it seems you are getting confused between an attack at the ethereum network level and an attack against your contract. When we talk of 51pct attack, its generally at the network level, where there is a consensus mechanism. For this mechanism to work well, we rely on the assumption that no single entity own too big of a ...


2

Is your tokens following ERC20? If yes, it is not necessary to have a minimun amount to avoid attacks. Design patterns are good because it is well used and tested. As I said, if you are following ERC20, don´t worry about the minimun amount.


2

That depends on the contract code. If the contract has functions that change the variables holding these parameters then it's possible to change them. So it's highly recommendable to look at the code before investing in an ICO or buy tokens.


2

One of the problems could be that you are setting tokenReward (the address of the token you will be using for distribution) to be one of the eth accounts, which is an externally owned account (a user). The crowdsale contract requires that you first deploy the token contract, take note of it's address and that's the address you have to pass to the crowdsale ...


2

1: It should be 10 million multiplied by the decimals, so: uint256 constant INITIAL_SUPPLY = 10000000 * 10** uint(decimals); 2: It is unrelated to whether or not the tokens are mintable. The crowdsale contract will deploy a new token contract which -according to your MyCoin definition- sets the initial supply to whatever you defined and assigns that to the ...


2

In HEY you wrote: function StandardToken() public { balance[msg.sender] = INITIAL_SUPPLY; } But the variable name is balances, not balance.


2

When the contract is deployed we have currentTier = 1 weiRaised = 0 cap[currentTier] = 100000000000000000 When the first payment of 100000000000000000 is sent we have weiAmount = 100000000000000000 weiRaised.add(weiAmount) = 100000000000000000 cap[currentTier] = 100000000000000000 Then weiRaised.add(weiAmount) > cap[currentTier] is false. Only ...


Only top voted, non community-wiki answers of a minimum length are eligible