Skip to content
This repository was archived by the owner on Jul 20, 2023. It is now read-only.
This repository was archived by the owner on Jul 20, 2023. It is now read-only.

deploying APM-Registries  #3

@maektwain

Description

@maektwain

While deploying the service using the command npx truffle exec --network avash scripts/deploy/apm-registries.js

the code throws the error

Error: Transaction: 0x49439795d1bc7574a2c0a77ef15b8ede00c89f1260050ad1bbc112176e235325 exited with an error (status 0).
Please check that the transaction:
    - satisfies all conditions set by Solidity `require` statements.
    - does not trigger a Solidity `revert` statement.

    at StatusError.ExtendableError (/Users/saranshsharma/Documents/aragen/node_modules/truffle/build/webpack:/packages/truffle-error/index.js:10:1)
    at new StatusError (/Users/saranshsharma/Documents/aragen/node_modules/truffle/build/webpack:/packages/truffle-contract/statuserror.js:29:1)
    at Object.callback (/Users/saranshsharma/Documents/aragen/node_modules/truffle/build/webpack:/packages/truffle-contract/contract.js:181:1)
    at /Users/saranshsharma/Documents/aragen/node_modules/truffle/build/webpack:/~/web3/lib/web3/method.js:142:1
    at /Users/saranshsharma/Documents/aragen/node_modules/truffle/build/webpack:/~/web3/lib/web3/requestmanager.js:89:1
    at /Users/saranshsharma/Documents/aragen/node_modules/truffle/build/webpack:/packages/truffle-provider/wrapper.js:134:1
    at /Users/saranshsharma/Documents/aragen/node_modules/@trufflesuite/web3-provider-engine/index.js:240:9
    at /Users/saranshsharma/Documents/aragen/node_modules/async/internal/once.js:12:16
    at replenish (/Users/saranshsharma/Documents/aragen/node_modules/async/internal/eachOfLimit.js:61:25)
    at /Users/saranshsharma/Documents/aragen/node_modules/async/internal/eachOfLimit.js:71:9
    at eachLimit (/Users/saranshsharma/Documents/aragen/node_modules/async/eachLimit.js:43:36)
    at /Users/saranshsharma/Documents/aragen/node_modules/async/internal/doLimit.js:9:16
    at end (/Users/saranshsharma/Documents/aragen/node_modules/@trufflesuite/web3-provider-engine/index.js:217:5)
    at /Users/saranshsharma/Documents/aragen/node_modules/@trufflesuite/web3-provider-engine/subproviders/provider.js:19:5
    at exports.XMLHttpRequest.request.onreadystatechange (/Users/saranshsharma/Documents/aragen/node_modules/web3-providers-http/lib/index.js:98:13)
    at exports.XMLHttpRequest.dispatchEvent (/Users/saranshsharma/Documents/aragen/node_modules/truffle/build/webpack:/~/xmlhttprequest/lib/XMLHttpRequest.js:591:1)
    at setState (/Users/saranshsharma/Documents/aragen/node_modules/truffle/build/webpack:/~/xmlhttprequest/lib/XMLHttpRequest.js:610:1)
    at IncomingMessage.<anonymous> (/Users/saranshsharma/Documents/aragen/node_modules/truffle/build/webpack:/~/xmlhttprequest/lib/XMLHttpRequest.js:447:1)
    at IncomingMessage.emit (events.js:326:22)
    at endReadableNT (_stream_readable.js:1241:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:21) {
  tx: '0x49439795d1bc7574a2c0a77ef15b8ede00c89f1260050ad1bbc112176e235325',
  receipt: {
    blockHash: '0xe031317ece32ce1f4889f8a2e3f95dda07cb50a8e17da4bca2511c556569ecb2',
    blockNumber: 121,
    contractAddress: null,
    cumulativeGasUsed: 3126182,
    effectiveGasPrice: '0x34630b8a00',
    from: '0x8db97c7cece249c2b98bdc0226cc4c2a57bf52fc',
    gasUsed: 3126182,
    logs: [],
    logsBloom: '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
    status: '0x0',
    to: '0xf410140adbc61f985eca89bd9a31578aa6887d13',
    transactionHash: '0x49439795d1bc7574a2c0a77ef15b8ede00c89f1260050ad1bbc112176e235325',
    transactionIndex: 0,
    type: '0x0'
  }
}

This is probable because of this contract

function newAPM(bytes32 _tld, bytes32 _label, address _root) public returns (APMRegistry) {
        bytes32 node = keccak256(abi.encodePacked(_tld, _label));

        // Assume it is the test ENS
        if (ens.owner(node) != address(this)) {
            // If we weren't in test ens and factory doesn't have ownership, will fail
            // this part of the code is failing 
            require(ens.owner(_tld) == address(this));
            ens.setSubnodeOwner(_tld, _label, this);
        }

        Kernel dao = daoFactory.newDAO(this);
        ACL acl = ACL(dao.acl());

        acl.createPermission(this, dao, dao.APP_MANAGER_ROLE(), this);

        // Deploy app proxies
        bytes memory noInit = new bytes(0);
        ENSSubdomainRegistrar ensSub = ENSSubdomainRegistrar(
            dao.newAppInstance(
                keccak256(abi.encodePacked(node, keccak256(abi.encodePacked(ENS_SUB_APP_NAME)))),
                ensSubdomainRegistrarBase,
                noInit,
                false
            )
        );
        APMRegistry apm = APMRegistry(
            dao.newAppInstance(
                keccak256(abi.encodePacked(node, keccak256(abi.encodePacked(APM_APP_NAME)))),
                registryBase,
                noInit,
                false
            )
        );

        // APMRegistry controls Repos
        bytes32 repoAppId = keccak256(abi.encodePacked(node, keccak256(abi.encodePacked(REPO_APP_NAME))));
        dao.setApp(dao.APP_BASES_NAMESPACE(), repoAppId, repoBase);

        emit DeployAPM(node, apm);

        // Grant permissions needed for APM on ENSSubdomainRegistrar
        acl.createPermission(apm, ensSub, ensSub.CREATE_NAME_ROLE(), _root);
        acl.createPermission(apm, ensSub, ensSub.POINT_ROOTNODE_ROLE(), _root);

        // allow apm to create permissions for Repos in Kernel
        bytes32 permRole = acl.CREATE_PERMISSIONS_ROLE();

        acl.grantPermission(apm, acl, permRole);

        // Initialize
        ens.setOwner(node, ensSub);
        ensSub.initialize(ens, node);
        apm.initialize(ensSub);

        uint16[3] memory firstVersion;
        firstVersion[0] = 1;

        acl.createPermission(this, apm, apm.CREATE_REPO_ROLE(), this);

        apm.newRepoWithVersion(APM_APP_NAME, _root, firstVersion, registryBase, b("ipfs:apm"));
        apm.newRepoWithVersion(ENS_SUB_APP_NAME, _root, firstVersion, ensSubdomainRegistrarBase, b("ipfs:enssub"));
        apm.newRepoWithVersion(REPO_APP_NAME, _root, firstVersion, repoBase, b("ipfs:repo"));

        configureAPMPermissions(acl, apm, _root);

        // Permission transition to _root
        acl.setPermissionManager(_root, dao, dao.APP_MANAGER_ROLE());
        acl.revokePermission(this, acl, permRole);
        acl.grantPermission(_root, acl, permRole);
        acl.setPermissionManager(_root, acl, permRole);

        return apm;
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions