Skip to main content
19 votes

What is the cause of the error: Expected import directive or contract definition

Not true in the OP's case, but a cause of this problem is missing a semi-colon from the first line specifiying compiler version, e.g.: pragma solidity ^0.4.6;
Lee's user avatar
  • 8,618
6 votes

If the hackers of the DAO converted the funds to bitcoin, would it have been possible to return the funds to the investors?

Even if the attacker managed to "withdraw" the funds, the DAO had very special conditions as the money was locked for 35 days. This allowed plenty of time for the Ethereum community to make an ...
Paul Razvan Berg's user avatar
6 votes
Accepted

What is Project Wyvern Protocol?

Their documentation is at their website https://wyvernprotocol.com/. In order to understand the fundamentals of Wyvern Protocol you'll need a deep understanding of blockchain and smart contracts. If ...
Stevers's user avatar
  • 362
5 votes
Accepted

How to automatically send ether, at regular intervals

Short answer: There's no timer. Something has to trigger the transaction to get it started and supply the gas so it can run. The Ethereum Alarm Clock is a cron-like solution for timed events. It ...
Rob Hitchens's user avatar
  • 55.6k
5 votes
Accepted

How many blocks were reversed with the DAO hard fork?

But what is the actual number of blocks that were invalidated by this hard fork? And how many transactions approximately? No blocks were invalidated and nothing was rolled back. Instead, EIP-779: ...
Richard Horrocks's user avatar
5 votes
Accepted

Why is noone exploiting the DAO contract?

I researched a bit the details of the DAO hack. Given this paper (DOI:10.1109/ICSAI.2017.8248566), the hacker exploited the splitDao function (line 945) with a reantrancy trick to withdraw all funds. ...
Yakitori's user avatar
  • 787
5 votes

Why is it called “quadratic” voting?

Classic collective decision making (aka a "majority voting system") is oftenTimes vulnerable to a phenomenon of the "tyranny of the majority", hence the 2nd name. Contrary to that, ...
Mila A's user avatar
  • 1,554
4 votes
Accepted

Understand the functionality of one contract

First of all, in Solidity x || y is evaluated in lazy way, so in case x is true, y is not evaluated at all. This means, that in case transferFrom will fail, send will not be called. Also, throw "...
Mikhail Vladimirov's user avatar
4 votes

Should I claim a Fluence reward?

To check Github account ownership, Github OAuth API should be used. Exposing the SSH key to an unaudited script is high risk and advised against by any security professionals. There are safe ways to ...
Mikko Ohtamaa's user avatar
3 votes

If the hackers of the DAO converted the funds to bitcoin, would it have been possible to return the funds to the investors?

that probably can't happen, since the funds were blocked for 30 days due to Dao ways. Converting to bitcoin is not supported by the ethereum network, so you will have to sell them the old fashion way ...
Kaki Master Of Time's user avatar
3 votes

How can you distribute dividends from a smart contract?

If the divident payments don't happen very often, you can have the investors send a transaction when they want to claim their dividend, either specifying a particular dividend or looping through a (...
Edmund Edgar's user avatar
  • 16.9k
3 votes
Accepted

Exchange Rate between Ether and Token

Two main options. A standing offer in your contract. The simplest policy is a peg: "we buy and sell these tokens for one ETH each". It can literally be any policy you can define since it will be ...
Rob Hitchens's user avatar
  • 55.6k
2 votes

Off-the-chain rules vs. on-chain-rules when designing a DAO

I think you carefully the business rules you want to enforce. The certificates is basically about an onboarding process with some external oversight. You can make it so partners are obligated to ...
Rob Hitchens's user avatar
  • 55.6k
2 votes

How to simulate the DAO attack with Truffle and testRPC

Create your contract DAOHack.sol and save it in contracts folder. Create 2_deploy.js migration file and store it in migrations folder. Specify network parameters in truffle.js. Compile contracts by ...
Roman Frolov's user avatar
  • 3,177
2 votes

Why separate DAO/ICO contract from token contract?

Separation of concerns is a good programming practice. The smart contract world needs to keep up with the best programming practices, as otherwise we have a bunch of amateurs going around and losing ...
Mikko Ohtamaa's user avatar
2 votes

Why separate DAO/ICO contract from token contract?

There are several possible reasons: Block Gas limit: The block gas limit limits how much functionality you can include in a single contract. This should be a non-issue because mainnet has 8M gas ...
Ismael's user avatar
  • 30.3k
2 votes
Accepted

Is geth --rpc --support-dao-fork still valid

On hard fork the PR 2813 was introduced to support the network split and those two options were added. This PR implements setting the --support-dao-fork and --oppose-dao-fork flags. As of now ...
Igor Barinov's user avatar
  • 2,158
2 votes
Accepted

Did DAO attacker gained ETH on Ethereum Classic?

Yes, that's right. The hacker got the ETC, but not ETH. This is his address
Tudor Constantin's user avatar
2 votes

DAO like functionality on Gnosis?

The Zodiac team from Gnosis is building DAO tools around the Safe. There are quite some extensions already and the community is open for new proposals. You can find more information on the Zodiac ...
Richard's user avatar
  • 5,144
2 votes
Accepted

DAO with ERC1155 as governance token

It is possible to use an ERC1155 contract as a governance token for a DAO (Decentralized Autonomous Organization). ERC1155 is a standard for a class of smart contracts that can manage multiple types ...
Hasan S.'s user avatar
2 votes

Should I claim a Fluence reward?

Disclosing the private SSH key is not safe, but what I did was to delete my public SSH key from GitHub first and create a new one. And then I used the old now deleted and useless key with the Fluence ...
k_o_'s user avatar
  • 121
1 vote
Accepted

Unable to use call.value to send the ether to another contract

I think there are two problems in your fallback function: function () public payable { if (a<5){ bank.withdraw(address(this),50*10**18); a++; } } You only increment a at ...
user19510's user avatar
  • 28.1k
1 vote
Accepted

Create two contracts that each with different accounts.

In your Truffle migration file, you are able to specify the from account which actually deploys the contract. Details are in their documentation here. Assuming you are using a tool like Ganache for ...
Shawn Tabrizi's user avatar
1 vote

The DAO: Stalker Attack - Attacker split from childDAO?

According to this paper, the Attacker could simply create a new Split proposal and withdraw as explained. Worse still, it is not only a matter of the people who have "voted YES" committing a Stalker ...
3mrsh's user avatar
  • 93
1 vote
Accepted

Serious BUG in the example DAO contract on the official Ethereum.org website?

I think the bug can be fixed by adding memberId[members[i].member]--; and memberId[targetMember]=0; to the removeMember function as below: function removeMember(address targetMember) onlyOwner public ...
sfmiller940's user avatar
1 vote

How can you distribute dividends from a smart contract?

A (standard?) solution is to calculate the dividend to be redeemed to each address and let address' holders claim this dividend as they wish via a specific method call on your contract. That's what ...
l1b3rty's user avatar
  • 190
1 vote

DAO withdrawal without keystore

There's no such thing as a password for the DAO (unless I'm forgetting something). By "DAO address", I'm assuming you mean "account that is holding DAO tokens". Your friend needs the decrypted ...
lungj's user avatar
  • 6,680
1 vote

Wouldn't a smart contract that deals with regulated markets need legal paper work to be legal?

I told my lawyer I want him to write a very simple paper contract. It would have a single line: "The two parties signed below agree that the terms of this contract are fully described in the Solidity ...
Thomas Jay Rush's user avatar
1 vote
Accepted

Differentiating Pre-ICO and ICO in contract

I can see two ways of approaching it. If you have created a common DAO, let the token buyers be associated with it. Both PreICO, ICO results can be sent to same DAO, by which they have controls in it....
Rajesh's user avatar
  • 716
1 vote

How to sell product's access on a blockchain based marketplace?

In your product contract you can store the download link and the address of the buyer. When the buyer wants to download the product, he can follow the download link and send a request to the download ...
ivicaa's user avatar
  • 7,539

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