@ensuro/core 2.6.0-beta1 → 2.6.1
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/js/test-utils.js +3 -5
- package/js/utils.js +1 -1
- package/package.json +1 -1
- package/scripts/storageLayout.js +1 -1
package/js/test-utils.js
CHANGED
|
@@ -2,6 +2,8 @@ const hre = require("hardhat");
|
|
|
2
2
|
const { _W, grantRole, getTransactionEvent } = require("../js/utils");
|
|
3
3
|
const { RiskModuleParameter } = require("../js/enums");
|
|
4
4
|
|
|
5
|
+
const { AddressZero } = hre.ethers.constants;
|
|
6
|
+
|
|
5
7
|
async function initCurrency(options, initial_targets, initial_balances) {
|
|
6
8
|
const Currency = await hre.ethers.getContractFactory("TestCurrency");
|
|
7
9
|
let currency = await Currency.deploy(
|
|
@@ -204,11 +206,7 @@ async function deployPool(options) {
|
|
|
204
206
|
async function deployPremiumsAccount(pool, options, addToPool = true) {
|
|
205
207
|
const PremiumsAccount = await hre.ethers.getContractFactory("PremiumsAccount");
|
|
206
208
|
const premiumsAccount = await hre.upgrades.deployProxy(PremiumsAccount, [], {
|
|
207
|
-
constructorArgs: [
|
|
208
|
-
pool.address,
|
|
209
|
-
options.jrEtkAddr || hre.ethers.constants.AddressZero,
|
|
210
|
-
options.srEtkAddr || hre.ethers.constants.AddressZero,
|
|
211
|
-
],
|
|
209
|
+
constructorArgs: [pool.address, options.jrEtkAddr || AddressZero, options.srEtkAddr || AddressZero],
|
|
212
210
|
kind: "uups",
|
|
213
211
|
unsafeAllow: ["delegatecall"], // This holds, because EToken is a reserve and uses delegatecall
|
|
214
212
|
});
|
package/js/utils.js
CHANGED
|
@@ -7,7 +7,7 @@ const _BN = ethers.BigNumber.from;
|
|
|
7
7
|
const WAD = _BN(10).pow(18); // 1e18
|
|
8
8
|
const RAY = _BN(10).pow(27); // 1e27
|
|
9
9
|
|
|
10
|
-
async function getStorageLayout(contractSrc, contractName
|
|
10
|
+
async function getStorageLayout(hre, contractSrc, contractName) {
|
|
11
11
|
const buildInfo = await hre.artifacts.getBuildInfo(`${contractSrc}:${contractName}`);
|
|
12
12
|
if (buildInfo === undefined) throw new Error(`Contract ${contractSrc}:${contractName} not in artifacts`);
|
|
13
13
|
|
package/package.json
CHANGED
package/scripts/storageLayout.js
CHANGED
|
@@ -9,7 +9,7 @@ const { getStorageLayout } = require("../js/utils");
|
|
|
9
9
|
|
|
10
10
|
async function main(contractSrc, contractName) {
|
|
11
11
|
await hre.run("compile");
|
|
12
|
-
const layout = await getStorageLayout(contractSrc, contractName
|
|
12
|
+
const layout = await getStorageLayout(hre, contractSrc, contractName);
|
|
13
13
|
|
|
14
14
|
const summary = layout.storage.map((item) => ({
|
|
15
15
|
slot: parseInt(item.slot),
|