Comments (2)
The idea of the smart contracts is to do programs that no body controls, even the creator of the contract. Loosing the ownership of a contract is part of the magic of the decentralisation.
Said that, you can always add a method in the controller that transfer back the ownership.
from minime.
I see the rationale now... in fact it appears this is what Aragon did for their token launch - ie. auto-reassign control to a placeholder contract after a sale.
That said, if it's a once-and-done campaign, I'm not seeing a lot of value in keeping the controller in a separate contract.. it may even save gas to integrate it?
I would propose an alternative Controlled.sol which takes into account the Owner of the Controlled contract, so only the Owner can set the Controller. The Owner can do this for as many times as there are Campaigns - eg. Seed Round, Pre-sale, Final Sale - then on the last and final Campaign, the Campaign contract can set both the Owner and Controller to a neutral Contract or even the Token itself to keep things 'decentralized'. This might be a better option for smaller DACs who need something to work out of the box.
Here is an example (unaudited) of how this might be achieved in Controlled.sol in case anyone is looking to support the use case above... it uses the Owned contract code from the sample campaign so that only the Owner can change the controller, change owners, or step down as Owner...
pragma solidity ^0.4.18;
contract Owned {
/// @dev `owner` is the only address that can call a function with this
/// modifier
modifier onlyOwner { require (msg.sender == owner); _; }
address public owner;
/// @notice The Constructor assigns the message sender to be `owner`
function Owned() { owner = msg.sender;}
/// @notice `owner` can step down and assign some other address to this role
/// @param _newOwner The address of the new owner. 0x0 can be used to create
/// an unowned neutral vault, however that cannot be undone
function changeOwner(address _newOwner) onlyOwner {
owner = _newOwner;
}
}
contract Controlled is Owned {
/// @notice The address of the controller is the only address that can call
/// a function with this modifier
modifier onlyController { require(msg.sender == controller); _; }
address public controller;
function Controlled() public { controller = msg.sender;}
/// @notice Changes the controller of the contract - ony the Owner can execute this operation
/// @param _newController The new controller of the contract
function changeController(address _newController) public onlyOwner {
controller = _newController;
}
}
from minime.
Related Issues (20)
- Implement ds-math HOT 1
- Should allow and transfer from address 2 to address allowed to 3 not working HOT 1
- Unclear (and possible wrong) code at internal function updateValueAtNow(Checkpoint[] storage, uint) HOT 2
- It is possible to break totalSupply in a clone and clones that never generate tokens cannot destroy tokens HOT 4
- totalSupply is declared in ERC20Basic and MiniMe, which therefore won't compile HOT 1
- Consider adding unlimited allowance to save gas
- ClaimTokens is awesome HOT 2
- New code needs comments
- Add an event in the token factory to find the clone token address
- Cloned token state is not locked when cloned with current or future block number
- Verification of Code Impossible? HOT 2
- MiniMe does not fire Transfer on Zero Value
- approve should not enforce setting to 0 value
- .length yields the fixed length of the byte array (read-only). so I think checkpoints.length++ is pointless, Can you explain its intention?I'm confused,thank you! HOT 1
- [Improvement Proposal] Save gas in getValueAt function HOT 2
- Switch testrpc dependency HOT 1
- [Alert] Overflow in generateTokens(), doTransfer() and Reentrancy of Controller. HOT 1
- Withdrawal
- Gas-snapshot contains merge conflict artifacts
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from minime.