@gooddollar/goodprotocol 1.0.7-beta.0 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/artifacts/contracts/DAOStackInterfaces.sol/Avatar.dbg.json +1 -1
- package/artifacts/contracts/DAOStackInterfaces.sol/Controller.dbg.json +1 -1
- package/artifacts/contracts/DAOStackInterfaces.sol/GlobalConstraintInterface.dbg.json +1 -1
- package/artifacts/contracts/DAOStackInterfaces.sol/IntVoteInterface.dbg.json +1 -1
- package/artifacts/contracts/DAOStackInterfaces.sol/ReputationInterface.dbg.json +1 -1
- package/artifacts/contracts/DAOStackInterfaces.sol/SchemeRegistrar.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/AggregatorV3Interface.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/ERC20.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IAaveIncentivesController.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IAdminWallet.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IDonationStaking.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IERC2917.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IFirstClaimPool.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IGoodDollar.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IGoodStaking.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IHasRouter.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IIdentity.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/ILendingPool.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/INameService.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IUBIScheme.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/ProxyAdmin.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/Reserve.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/Uniswap.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/UniswapFactory.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/UniswapPair.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/cERC20.dbg.json +1 -1
- package/artifacts/contracts/governance/ClaimersDistribution.sol/ClaimersDistribution.dbg.json +1 -1
- package/artifacts/contracts/governance/CompoundVotingMachine.sol/CompoundVotingMachine.dbg.json +1 -1
- package/artifacts/contracts/governance/GReputation.sol/GReputation.dbg.json +1 -1
- package/artifacts/contracts/governance/GovarnanceStaking.sol/GovernanceStaking.dbg.json +1 -1
- package/artifacts/contracts/governance/MultiBaseGovernanceShareField.sol/MultiBaseGovernanceShareField.dbg.json +1 -1
- package/artifacts/contracts/governance/Reputation.sol/Reputation.dbg.json +1 -1
- package/artifacts/contracts/governance/StakersDistribution.sol/StakersDistribution.dbg.json +1 -1
- package/artifacts/contracts/mocks/AaveMock.sol/AaveMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/DAIMock.sol/DAIMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/DecimalsMock.sol/DecimalsMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/GoodCompoundStakingTest.sol/GoodCompoundStakingTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/GoodCompoundStakingTest.sol/GoodCompoundStakingTest.json +6 -6
- package/artifacts/contracts/mocks/GoodFundManagerTest.sol/GoodFundManagerTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/IncentiveControllerMock.sol/IncentiveControllerMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/LendingPoolMock.sol/LendingPoolMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/OverMintTester.sol/OverMintTester.dbg.json +1 -1
- package/artifacts/contracts/mocks/OverMintTesterRegularStake.sol/OverMintTesterRegularStake.dbg.json +1 -1
- package/artifacts/contracts/mocks/SixteenDecimalsTokenMock.sol/SixteenDecimalsTokenMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/SwapHelperTest.sol/SwapHelperTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/TwentyDecimalsTokenMock.sol/TwentyDecimalsTokenMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock2.dbg.json +1 -1
- package/artifacts/contracts/mocks/UsdcMock.sol/USDCMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cBATMock.sol/cBATMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cDAILowWorthMock.sol/cDAILowWorthMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cDAIMock.sol/cDAIMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cDAINonMintableMock.sol/cDAINonMintableMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cDecimalsMock.sol/cDecimalsMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cSDTMock.sol/cSDTMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cUSDCMock.sol/cUSDCMock.dbg.json +1 -1
- package/artifacts/contracts/reserve/ExchangeHelper.sol/ExchangeHelper.dbg.json +1 -1
- package/artifacts/contracts/reserve/GoodMarketMaker.sol/GoodMarketMaker.dbg.json +1 -1
- package/artifacts/contracts/reserve/GoodReserveCDai.sol/ContributionCalc.dbg.json +1 -1
- package/artifacts/contracts/reserve/GoodReserveCDai.sol/GoodReserveCDai.dbg.json +1 -1
- package/artifacts/contracts/staking/BaseShareField.sol/BaseShareField.dbg.json +1 -1
- package/artifacts/contracts/staking/DonationsStaking.sol/DonationsStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/GoodFundManager.sol/GoodFundManager.dbg.json +1 -1
- package/artifacts/contracts/staking/SimpleStaking.sol/SimpleStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/UniswapV2SwapHelper.sol/UniswapV2SwapHelper.dbg.json +1 -1
- package/artifacts/contracts/staking/aave/AaveStakingFactory.sol/AaveStakingFactory.dbg.json +1 -1
- package/artifacts/contracts/staking/aave/AaveStakingFactory.sol/AaveStakingFactory.json +3 -3
- package/artifacts/contracts/staking/aave/GoodAaveStaking.sol/GoodAaveStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/aave/GoodAaveStaking.sol/GoodAaveStaking.json +4 -4
- package/artifacts/contracts/staking/compound/CompoundStakingFactory.sol/CompoundStakingFactory.dbg.json +1 -1
- package/artifacts/contracts/staking/compound/CompoundStakingFactory.sol/CompoundStakingFactory.json +2 -2
- package/artifacts/contracts/staking/compound/GoodCompoundStaking.sol/GoodCompoundStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/compound/GoodCompoundStaking.sol/GoodCompoundStaking.json +4 -4
- package/artifacts/contracts/ubi/UBIScheme.sol/UBIScheme.dbg.json +1 -1
- package/artifacts/contracts/ubi/UBIScheme.sol/UBIScheme.json +2 -2
- package/artifacts/contracts/unaudited-foundation/FuseFaucet.sol/FuseFaucet.dbg.json +1 -1
- package/artifacts/contracts/unaudited-foundation/InvitesV1.sol/InvitesV1.dbg.json +1 -1
- package/artifacts/contracts/utils/BancorFormula.sol/BancorFormula.dbg.json +1 -1
- package/artifacts/contracts/utils/DAOContract.sol/DAOContract.dbg.json +1 -1
- package/artifacts/contracts/utils/DAOUpgradeableContract.sol/DAOUpgradeableContract.dbg.json +1 -1
- package/artifacts/contracts/utils/DSMath.sol/DSMath.dbg.json +1 -1
- package/artifacts/contracts/utils/DataTypes.sol/DataTypes.dbg.json +1 -1
- package/artifacts/contracts/utils/NameService.sol/NameService.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtocolUpgrade.sol/OldMarketMaker.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtocolUpgrade.sol/ProtocolUpgrade.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtocolUpgradeFuse.sol/ProtocolUpgradeFuse.dbg.json +1 -1
- package/artifacts/contracts/utils/ReputationTestHelper.sol/ReputationTestHelper.dbg.json +1 -1
- package/contracts/staking/aave/GoodAaveStaking.sol +4 -3
- package/contracts/staking/compound/GoodCompoundStaking.sol +4 -3
- package/contracts/ubi/UBIScheme.sol +16 -11
- package/package.json +1 -1
- package/releases/deployment.json +107 -96
- package/releases/olddao.json +1 -406
- package/scripts/deployFullDAO.ts +19 -8
- package/scripts/misc/goodgiveback.ts +65 -0
- package/scripts/verify.ts +60 -47
- package/truffle-config.js +12 -0
package/scripts/verify.ts
CHANGED
|
@@ -1,54 +1,67 @@
|
|
|
1
|
-
import fs from "fs"
|
|
2
|
-
import { isArray } from "lodash"
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import { isArray } from "lodash";
|
|
3
3
|
import type EthersT from "ethers";
|
|
4
|
-
import type HreT from "hardhat"
|
|
5
|
-
import { HardhatEthersHelpers } from "@nomiclabs/hardhat-ethers/types"
|
|
6
|
-
import { execSync } from "child_process"
|
|
7
|
-
type Ethers = typeof EthersT.ethers & HardhatEthersHelpers
|
|
8
|
-
type HRE = typeof HreT
|
|
4
|
+
import type HreT from "hardhat";
|
|
5
|
+
import { HardhatEthersHelpers } from "@nomiclabs/hardhat-ethers/types";
|
|
6
|
+
import { execSync } from "child_process";
|
|
7
|
+
type Ethers = typeof EthersT.ethers & HardhatEthersHelpers;
|
|
8
|
+
type HRE = typeof HreT;
|
|
9
9
|
|
|
10
|
-
let ethers:Ethers
|
|
10
|
+
let ethers: Ethers;
|
|
11
11
|
export const verify = async (hre: HRE) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
if(isArray(entry[1]))
|
|
22
|
-
return
|
|
23
|
-
const addr = await getImplementationAddress(entry[1])
|
|
24
|
-
return entry[0]+'@'+addr
|
|
25
|
-
}))).filter(_ => _)
|
|
12
|
+
console.log("truffle compiling....");
|
|
13
|
+
const Verify = require("truffle-plugin-verify"); //not imported because of bug
|
|
14
|
+
const truffleOutput = execSync("npx truffle compile").toString("utf8");
|
|
15
|
+
console.log({ truffleOutput });
|
|
16
|
+
ethers = hre.ethers;
|
|
17
|
+
const deployed = JSON.parse(
|
|
18
|
+
fs.readFileSync("releases/deployment.json").toString()
|
|
19
|
+
);
|
|
20
|
+
const contracts = deployed[hre.network.name];
|
|
26
21
|
|
|
27
|
-
|
|
22
|
+
const contractPairs = (
|
|
23
|
+
await Promise.all(
|
|
24
|
+
Object.entries(contracts).map(async entry => {
|
|
25
|
+
if (isArray(entry[1])) return;
|
|
26
|
+
if (
|
|
27
|
+
typeof entry[1] !== "string" ||
|
|
28
|
+
(entry[1] as string).startsWith("0x") === false
|
|
29
|
+
)
|
|
30
|
+
return;
|
|
31
|
+
const addr = await getImplementationAddress(entry[1]);
|
|
32
|
+
return entry[0] + "@" + addr;
|
|
33
|
+
})
|
|
34
|
+
)
|
|
35
|
+
).filter(_ => _);
|
|
28
36
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
contractPairs.unshift();
|
|
38
|
+
|
|
39
|
+
const config = {
|
|
40
|
+
debug: false,
|
|
41
|
+
network_id: hre.network.config.chainId,
|
|
42
|
+
api_keys: {
|
|
43
|
+
etherscan: hre.config.etherscan.apiKey
|
|
44
|
+
},
|
|
45
|
+
working_directory: ".",
|
|
46
|
+
contracts_build_directory: "build/contracts",
|
|
47
|
+
_: contractPairs
|
|
48
|
+
};
|
|
49
|
+
return Verify(config);
|
|
40
50
|
};
|
|
41
51
|
|
|
42
|
-
const getImplementationAddress = async
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
52
|
+
const getImplementationAddress = async addr => {
|
|
53
|
+
console.log("finding impl for:", addr);
|
|
54
|
+
let proxy = await ethers.provider.getStorageAt(
|
|
55
|
+
addr,
|
|
56
|
+
"0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc"
|
|
57
|
+
);
|
|
58
|
+
let res = addr;
|
|
59
|
+
if (proxy != ethers.constants.HashZero) res = "0x" + proxy.slice(-40);
|
|
60
|
+
else {
|
|
61
|
+
const code = await ethers.getDefaultProvider().getCode(addr);
|
|
62
|
+
if (code.startsWith("0x363d3d373d3d3d363d73"))
|
|
63
|
+
res = "0x" + code.slice(22, 62);
|
|
64
|
+
}
|
|
65
|
+
console.log("impl address for:", addr, res);
|
|
66
|
+
return res;
|
|
67
|
+
};
|
package/truffle-config.js
CHANGED
|
@@ -70,6 +70,18 @@ module.exports = {
|
|
|
70
70
|
timeoutBlocks: 200, // # of blocks before a deployment times out (minimum/default: 50)
|
|
71
71
|
skipDryRun: true // Skip dry run before migrations? (default: false for public nets )
|
|
72
72
|
},
|
|
73
|
+
ropsten: {
|
|
74
|
+
provider: () =>
|
|
75
|
+
new HDWalletProvider(
|
|
76
|
+
mnemonic,
|
|
77
|
+
`https://ropsten.infura.io/v3/YOUR-PROJECT-ID`
|
|
78
|
+
),
|
|
79
|
+
network_id: 3, // Ropsten's id
|
|
80
|
+
gas: 5000000, // Ropsten has a lower block limit than mainnet
|
|
81
|
+
confirmations: 2, // # of confs to wait between deployments. (default: 0)
|
|
82
|
+
timeoutBlocks: 200, // # of blocks before a deployment times out (minimum/default: 50)
|
|
83
|
+
skipDryRun: true // Skip dry run before migrations? (default: false for public nets )
|
|
84
|
+
},
|
|
73
85
|
fuse: {
|
|
74
86
|
provider: () => new HDWalletProvider(mnemonic, `https://rpc.fuse.io`),
|
|
75
87
|
network_id: 122, // Ropsten's id
|