-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Transition Scheme #769
Conversation
*/ | ||
function transferAssets() external { | ||
for (uint256 i=0; i < assetAddresses.length; i++) { | ||
Controller(avatar.owner()).genericCall( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get the return value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the point of that, we have nothing to do with the returned value here...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check if the transfer success or not .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... which one could test in advance using .call
What is the function of this scheme? |
To help DAOs migrate from the old stack to the new one. |
* @param _newAvatar the avatar to migrate to | ||
* @param _externalTokens external tokens to allow transfer to the new avatar | ||
* @param _assetAddresses the assets to transfer | ||
* @param _selectors the functions to call to to transfer the assets |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this include reputation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, reputation is recreated in the new DAO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any other plan for transferring rep from a 1.0 DAO to a 2.0 DAO?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure.
* @param _newAvatar the avatar to migrate to | ||
* @param _externalTokens external tokens to allow transfer to the new avatar | ||
* @param _assetAddresses the assets to transfer | ||
* @param _selectors the functions to call to to transfer the assets |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be good to document here the form a function must take, like what parameters and return value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a standard selector per the ABI structure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A selector is an ABI specification for any arbitrary function. Don't the selectors in this list have to specify functions that have a specific set of parameters and parameter types?
Avatar _avatar, | ||
address payable _newAvatar, | ||
address[] calldata _externalTokens, | ||
address[] calldata _assetAddresses, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about cap the number of asserts with a number which is applicable ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? The number of assets is determined in the initialized, so the DAO knows how many and which assets will be transferred before adding the scheme.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean in terms of gas usage ..while iterating over the assets.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can do enough assets at a time to make it unnecessary, but if you want we can add it. I could add a test to see how many we can do at a time but it'd be just a rough estimation as different assets will probably cost differently.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test with normal transfer ownership
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok I added a test transferring 101 assets.
avatar = _avatar; | ||
newAvatar = _newAvatar; | ||
externalTokens = _externalTokens; | ||
assetAddresses = _assetAddresses; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets cap this array length with 100
|
||
contract TransitionScheme { | ||
|
||
uint public constant ASSETS_CAP = 100; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uint -> uint256
No description provided.