aragon / aragon-cli

CLI for creating and publishing Aragon apps
GNU General Public License v3.0
91 stars 79 forks source link

Iterate on the `apm info` command #397

Open kernelwhisperer opened 5 years ago

kernelwhisperer commented 5 years ago

If the hash cannot be fetched by ipfs (not running aragon ipfs or it takes to long to download), we only return this:

{
  "content": {
    "provider": "ipfs",
    "location": "QmdtunF4wTJfeihKxCHH1b68p1ezoAyDcgmLmgJ1SQKSUR"
  },
  "contractAddress": "0xbcE9e0203B700f9382C66405Dc5b4687E2e5F0A0",
  "version": "1.0.0"
}

We should warn about not being able to retrieve the content.

This is the full output:

{
  "name": "Token Manager",
  "description": "Controls an organization token allowing to mint new tokens, assign them and create vestings",
  "icons": [
    {
      "src": "images/icon.svg",
      "sizes": "192x192"
    }
  ],
  "script": "/script.js",
  "start_url": "/index.html",
  "roles": [
    {
      "name": "Mint tokens",
      "id": "MINT_ROLE",
      "params": [
        "Receiver",
        "Token amount"
      ],
      "bytes": "0x154c00819833dac601ee5ddded6fda79d9d8b506b911b3dbd54cdb95fe6c3686"
    },
    {
      "name": "Issue tokens",
      "id": "ISSUE_ROLE",
      "params": [
        "Token amount"
      ],
      "bytes": "0x2406f1e99f79cea012fb88c5c36566feaeefee0f4b98d3a376b49310222b53c4"
    },
    {
      "name": "Assign tokens",
      "id": "ASSIGN_ROLE",
      "params": [
        "Receiver",
        "Token amount"
      ],
      "bytes": "0xf5a08927c847d7a29dc35e105208dbde5ce951392105d712761cc5d17440e2ff"
    },
    {
      "name": "Revoke vesting",
      "id": "REVOKE_VESTINGS_ROLE",
      "params": [
        "Holder"
      ],
      "bytes": "0x95ffc68daedf1eb334cfcd22ee24a5eeb5a8e58aa40679f2ad247a84140f8d6e"
    },
    {
      "name": "Burn tokens",
      "id": "BURN_ROLE",
      "params": [
        "Holder",
        "Token amount"
      ],
      "bytes": "0xe97b137254058bd94f28d2f3eb79e2d34074ffb488d042e3bc958e0a57d2fa22"
    }
  ],
  "path": "contracts/TokenManager.sol",
  "appName": "token-manager.aragonpm.eth",
  "appId": "0x6b20a3010614eeebf2138ccec99f028a61c811b3b1a3343b6ff635985c75c91f",
  "deployment": {
    "contractName": "TokenManager",
    "compiledAt": "2018-11-09T15:32:48.682Z",
    "compiler": {
      "name": "solc",
      "version": "0.4.24+commit.e67f0147.Emscripten.clang",
      "optimizer": {
        "enabled": true,
        "runs": 10000
      }
    },
    "flattenedCode": "./code.sol",
    "transactionHash": "0x6d5fbbfcdfb1db1a0e4b083851af5df22214787a6984955f7fa1004070f8bafd"
  },
  "functions": [
    {
      "sig": "initialize(address,bool,uint256)",
      "roles": [],
      "notice": "Initialize Token Manager for `_token.symbol(): string`, whose tokens are `transferable ? 'not' : ''` transferable`_maxAccountTokens > 0 ? ' and limited to a maximum of ' + @tokenAmount(_token, _maxAccountTokens, false) + ' per account' : ''`"
    },
    {
      "sig": "mint(address,uint256)",
      "roles": [
        "MINT_ROLE"
      ],
      "notice": "Mint `@tokenAmount(self.token(): address, _amount, false)` tokens for `_receiver`"
    },
    {
      "sig": "issue(uint256)",
      "roles": [
        "ISSUE_ROLE"
      ],
      "notice": "Mint `@tokenAmount(self.token(): address, _amount, false)` tokens for the Token Manager"
    },
    {
      "sig": "assign(address,uint256)",
      "roles": [
        "ASSIGN_ROLE"
      ],
      "notice": "Assign `@tokenAmount(self.token(): address, _amount, false)` tokens to `_receiver` from the Token Manager's holdings"
    },
    {
      "sig": "burn(address,uint256)",
      "roles": [
        "BURN_ROLE"
      ],
      "notice": "Burn `@tokenAmount(self.token(): address, _amount, false)` tokens from `_holder`"
    },
    {
      "sig": "assignVested(address,uint256,uint64,uint64,uint64,bool)",
      "roles": [
        "ASSIGN_ROLE"
      ],
      "notice": "Assign `@tokenAmount(self.token(): address, _amount, false)` tokens to `_receiver` from the Token Manager's holdings with a `_revokable : 'revokable' : ''` vesting starting at `@formatDate(_start)`, cliff at `@formatDate(_cliff)` (first portion of tokens transferable), and completed vesting at `@formatDate(_vested)` (all tokens transferable)"
    },
    {
      "sig": "revokeVesting(address,uint256)",
      "roles": [
        "REVOKE_VESTINGS_ROLE"
      ],
      "notice": "Revoke vesting #`_vestingId` from `_holder`, returning unvested tokens to the Token Manager"
    },
    {
      "sig": "forward(bytes)",
      "roles": [],
      "notice": "Execute desired action as a token holder"
    },
    {
      "sig": "onTransfer(address,address,uint)",
      "roles": [],
      "notice": null
    },
    {
      "sig": "proxyPayment(address)",
      "roles": [],
      "notice": "Called when ether is sent to the MiniMe Token contract"
    },
    {
      "sig": "onApprove(address,address,uint)",
      "roles": [],
      "notice": null
    }
  ],
  "content": {
    "provider": "ipfs",
    "location": "QmdtunF4wTJfeihKxCHH1b68p1ezoAyDcgmLmgJ1SQKSUR"
  },
  "contractAddress": "0xbcE9e0203B700f9382C66405Dc5b4687E2e5F0A0",
  "version": "1.0.0"
}

There isn't an easy way to determine the version of TokenManager.sol in order to see the source code, only to take the compiledAt timestamp and search through the git history.

sohkai commented 5 years ago

There isn't an easy way to determine the version of TokenManager.sol in order to see the source code, only to take the compiledAt timestamp and search through the git history.

Perhaps this is something we could include at publish-time into the artifact.json, and use a git commit hash as well as origin link.

0xGabi commented 5 years ago

I discussed with Daniel to use sol-compiler to generate custom artifacts at some point. I have to research more about it but might be useful for this use cases.