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

Unable to switch DFOs #3

Open
microbecode opened this issue Sep 20, 2020 · 0 comments
Open

Unable to switch DFOs #3

microbecode opened this issue Sep 20, 2020 · 0 comments

Comments

@microbecode
Copy link

We have deployed two DFOs: one old and one new. The aim is to implement functionality in the new DFO which allows old token holders to switch their old tokens for the new tokens. This should be done by burning the old tokens and minting the new tokens.

However I can't get the process to work. Calling the Switch contract results in a simple revert without reason. What could be the problem?

As far as we understand, similar process has been performed by the Buidl DFO and the Arte DFO and we copied most of the functionality from them.

Here is the process we have tried:

  1. Create old and new DFO in Ropsten
    1. Set total token amount 10000
    2. Set survey length to something biggish, like 10000
    3. Survey Quorum something small, like 5
    4. Max Cap something small, like 10
  2. Get old DFO's doubleproxy address
    1. Easiest to use web3 direct calls to DFO Core's getDoubleProxyAddress()
  3. Deploy the Switch contract with parameters:
    1. "0x123", // doubleProxyAddress of the new DFO
    2. "0x234", // oldTokenAddress
    3. , // startBlock
    4. 10000, // totalMintable
    5. [10000000], // time windows (block numbers) until which block multiplier and divider is used
    6. [1], // multipliers
    7. [1] // dividers
  4. Create proposal in new DFO
    1. Change Solidity version to 6.0
    2. Copypaste code (MintAndTransferFunctionality)
    3. Change the tokenSwitchAddress to be the address of the deployed switch contract
    4. New, description and discussion link arbitrary
    5. Compile -> Check "Needs Sender"
    6. Publish
  5. Vote to accept the proposal
  6. Perform the switch for some tokens:
    1. Increase allowance for VPS contract by the amount you want to switch:
      1. Send an allowance transaction to the old token contract
    2. Call the Switch contract's "yakuzaSwitch" (vasaPowerSwitch originally) function in Switch contract with the amount you want to switch
      1. Results in "Revert" without a message

The used contracts are the following:

  1. Old DFO
    1. Dapp: https://dapp.dfohub.com/?addr=0x53453571d73F15a1E6E5A45CB26bdB202e0da840
    2. Token: https://ropsten.etherscan.io/address/0x20dF2A22A573b38f9028d38ED59Ebe7726423d22
    3. Doubleproxy: 0x59095e53c903c80e37fa25b57fd812c6d58f13d3
  2. New DFO
    1. Dapp: https://dapp.dfohub.com/?addr=0xEC26Fde512Bc65f6e5EBa1134dF94a92Db0B7aF7
    2. Token: https://ropsten.etherscan.io/address/0xE9e4baF3908490458447e2CcC245f01FeB0d8A95
    3. Core: https://ropsten.etherscan.io/address/0xEC26Fde512Bc65f6e5EBa1134dF94a92Db0B7aF7
    4. Doubleproxy: 0x38367fe79846e4d0d04df18464da643a555f52aa
  3. Switch address: 0xF8E0Ae5Ec38A2193ad562B2552074F13e04FD360

Code for the used contracts can be found at https://github.com/microbecode/Yakuza-token/tree/master/Contracts
The transaction to the Switch contract is: https://ropsten.etherscan.io/tx/0x8417e0b6811a7144d8a99b1c63c4b2ad2fae7adf5be6f651f31ad94828bf450c
Allowance for the Switch is in place at the old token contract (checked that).

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

No branches or pull requests

1 participant