compound-finance / compound-protocol

The Compound On-Chain Protocol
https://compound.finance/developers
BSD 3-Clause "New" or "Revised" License
1.88k stars 1.2k forks source link

Cannot reproduce latest deploy scripts on master #117

Closed Pet3ris closed 3 years ago

Pet3ris commented 3 years ago

Hi There,

I'm having trouble reproducing the GovernorBravo deployment scripts on master.

After installing the repository, I'm running the following:

./spec/sim/0009-gov-bravo/hypothetical_upgrade_post_propose.scen

Which results in this error:

Command: From CompVoter1 (GovernorBravo GovernorBravoDelegator Propose "Grant Comp" [(Address Comptroller)] [0] ["_grantComp(address,uint256)"] [[(Address Arr00) 2]])
TypeError: governor.methods.propose is not a function
    at propose (/Users/p/Dev/compound-protocol/scenario/src/Event/GovernorBravoEvent.ts:92:22)
    at Command_1.Command.namePos [as processor] (/Users/p/Dev/compound-protocol/scenario/src/Event/GovernorBravoEvent.ts:348:22)
    at Command.process (/Users/p/Dev/compound-protocol/scenario/src/Command.ts:201:25)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at Object.processGovernorBravoEvent (/Users/p/Dev/compound-protocol/scenario/src/Event/GovernorBravoEvent.ts:554:10)
    at Command.process (/Users/p/Dev/compound-protocol/scenario/src/Command.ts:201:14)
    at processCoreEvent (/Users/p/Dev/compound-protocol/scenario/src/CoreEvent.ts:869:10)
    at View.process (/Users/p/Dev/compound-protocol/scenario/src/Command.ts:203:14)
    at processCoreEvent (/Users/p/Dev/compound-protocol/scenario/src/CoreEvent.ts:869:10)
    at /Users/p/Dev/compound-protocol/scenario/src/CoreEvent.ts:66:15
    at /Users/p/Dev/compound-protocol/scenario/src/Repl.ts:177:14
    at /Users/p/Dev/compound-protocol/scenario/src/Repl.ts:177:31
    at /Users/p/Dev/compound-protocol/scenario/src/Repl.ts:177:31
    at /Users/p/Dev/compound-protocol/scenario/src/Repl.ts:177:31
    at /Users/p/Dev/compound-protocol/scenario/src/Repl.ts:177:31 {
  error: TypeError: governor.methods.propose is not a function
      at propose (/Users/p/Dev/compound-protocol/scenario/src/Event/GovernorBravoEvent.ts:92:22)
      at Command_1.Command.namePos [as processor] (/Users/p/De/compound-protocol/scenario/src/Event/GovernorBravoEvent.ts:348:22)
      at Command.process (/Users/p/Dev/compound-protocol/scenario/src/Command.ts:201:25)
      at runMicrotasks (<anonymous>)
      at processTicksAndRejections (internal/process/task_queues.js:97:5)
      at Object.processGovernorBravoEvent (/Users/p/Dev/compound-protocol/scenario/src/Event/GovernorBravoEvent.ts:554:10)
      at Command.process (/Users/p/Dev/compound-protocol/scenario/src/Command.ts:201:14)
      at processCoreEvent (/Users/p/Dev/compound-protocol/scenario/src/CoreEvent.ts:869:10)
      at View.process (/Users/p/Dev/compound-protocol/scenario/src/Command.ts:203:14)
      at processCoreEvent (/Users/p/Dev/compound-protocol/scenario/src/CoreEvent.ts:869:10)
      at /Users/p/Dev/compound-protocol/scenario/src/CoreEvent.ts:66:15
      at /Users/p/Dev/compound-protocol/scenario/src/Repl.ts:177:14
      at /Users/p/Dev/compound-protocol/scenario/src/Repl.ts:177:31
      at /Users/p/Dev/compound-protocol/scenario/src/Repl.ts:177:31
      at /Users/p/Dev/compound-protocol/scenario/src/Repl.ts:177:31
      at /Users/p/Dev/compound-protocol/scenario/src/Repl.ts:177:31,
  event: [
    'From',
    'CompVoter1',
    [
      'GovernorBravo',
      'GovernorBravoDelegator',
      'Propose',
      [Array],
      [Array],
      [Array],
      [Array],
      [Array]
    ]
  ]
}

Attaching the mainnet-abi.json selection for GovernorBravo.propose:

{
    "constant": false,
    "inputs": [
        {
            "internalType": "address[]",
            "name": "targets",
            "type": "address[]"
        },
        {
            "internalType": "uint256[]",
            "name": "values",
            "type": "uint256[]"
        },
        {
            "internalType": "string[]",
            "name": "signatures",
            "type": "string[]"
        },
        {
            "internalType": "bytes[]",
            "name": "calldatas",
            "type": "bytes[]"
        },
        {
            "internalType": "string",
            "name": "description",
            "type": "string"
        }
    ],
    "name": "propose",
    "outputs": [
        {
            "internalType": "uint256",
            "name": "",
            "type": "uint256"
        }
    ],
    "payable": false,
    "stateMutability": "nonpayable",
    "type": "function",
    "signature": "0xda95691a"
},
Pet3ris commented 3 years ago

This issue is resolved by using the following mainnet-abi.json: https://github.com/Arr00-Blurr/compound-protocol/blob/master/networks/mainnet-abi.json.

All credit to @arr00 for the fix.