Skip to content
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

Merged
merged 7 commits into from
Jul 12, 2020
Merged

Add Transition Scheme #769

merged 7 commits into from
Jul 12, 2020

Conversation

ben-kaufman
Copy link
Contributor

No description provided.

*/
function transferAssets() external {
for (uint256 i=0; i < assetAddresses.length; i++) {
Controller(avatar.owner()).genericCall(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get the return value

Copy link
Contributor Author

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...

Copy link
Contributor

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 .

Copy link
Contributor

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

@dkent600
Copy link
Contributor

dkent600 commented Jul 9, 2020

What is the function of this scheme?

@ben-kaufman
Copy link
Contributor Author

To help DAOs migrate from the old stack to the new one.

contracts/schemes/TransitionScheme.sol Show resolved Hide resolved
* @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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this include reputation?

Copy link
Contributor Author

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no

Copy link
Contributor

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?

Copy link
Contributor

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
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

@dkent600 dkent600 Jul 9, 2020

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,
Copy link
Contributor

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 ?

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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

Copy link
Contributor Author

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;
Copy link
Contributor

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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uint -> uint256

@orenyodfat orenyodfat merged commit ef28d1b into master Jul 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants