1

I am trying to develop a smart contract that would allow for multisig actions.

So if I, for example, want to add admin to AdminStorage I will need consent of a number of admins. It's exactly like Multisig wallet transaction confirmation, but with external contract method calls.

So I have contract AdminStorage (in contracts/storage/AdminStorage.sol). It's just a simple address storage - nothing to write home about.

But on top of that I have Multisin (in contracts/multisig) and MultisigAddAdmin (that extends Multisig). The purpose of these is to add all this multisig properties to admin addition.

There are no restrictions to the caller of AdminStorage.add yet, but it's just a test run. Soon this method will only be callable from MultisigAddAdmin.

The thing is: MultisigAddAdmin just won't deploy. There are no errors (like "Check your gas limit" when you try to deploy and abstract contract) - nothing. Truffle runs migrations just fine and it even prints deployed address, but then I go to Truffle console and MultisigAddAdmin.isDeployed() is false. And I can't access the deployed instance from web3.js (in React app) either.

Steps to reproduce:

(You will need NodeJS 7, LATEST Truffle and testrpc)

  1. Clone https://github.com/IsThisThePayneResidence/personal-solidity-contracts
  2. npm install
  3. truffle compile --all
  4. run testrpc (to install just type npm install ethereumjs-testrpc)
  5. truffle deploy
  6. truffle console
  7. (In Truffle console) MultisigAddAdmin.isDeployed()

Please, help!

1 Answer 1

1

In case somone else is experiencing the same issue:

The problem persisted in contract migrations. Specifically, in 2_deploy_contracts.js.

The "ture way" of deploying dependent contacts that I always see being suggested didn't work for me.

So

deployer.deploy(
    AdminStorage,
    [
      "0x82283F163eddAa01ca22d080873baE2D1681A94f",
      "0x228B4B687be1103b0985c316C6e7CBA93B4CDaBd",
      "0xC73256378982fF9e8aF364fD1b0B8Fbf2786DD45",
      "0xaD392E402Dd3A0c8b7468e3dac063e777d0963Ee"
    ]
  ).then(() => {
    deployer.link(AdminStorage, MultisigAddAdmin);
    console.log(`AdminStorage.address: ${AdminStorage.address}`);
    deployer.deploy(MultisigAddAdmin).then(() => {
      console.log(`MultisigAddAdmin.address: ${MultisigAddAdmin.address}`);
    });
  });

Is not the way I should be doing contract address injection, apparently. Moving injection to a separate method, moving MultisigAddAdmin deployment from the promise handler and calling the setter method in the actual code solved the problem.

Hope it helps someone not to waste 4 days on trying to figure it out.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.