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;
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 ...
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 ...
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 ...
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: ...
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.
...
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, ...
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 "...
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 ...
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 ...
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 (...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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....
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
dao × 155solidity × 36
the-dao × 33
ether × 15
contract-development × 13
tokens × 12
governance × 10
go-ethereum × 9
voting × 8
myetherwallet × 7
truffle × 6
transactions × 6
blockchain × 6
contract-design × 6
exchanges × 6
erc-20 × 5
dapps × 5
ethereum-wallet-dapp × 5
openzeppelin × 5
dao-hub × 5
nft × 4
ethereum-classic × 4
attacks × 4
protocol × 4
contract-deployment × 3