Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Add correct code format and solidity tag to match the example
Source Link

openzeppelin-test-environmentopenzeppelin-test-environment is quite a new package, it doesn't tell how to initialize the upgradeable contract in the information below:

https://github.com/OpenZeppelin/openzeppelin-test-environment

https://github.com/OpenZeppelin/openzeppelin-test-environment

Just a basic example from the link above:

const { accounts, contract } = require('@openzeppelin/test-environment');
const [ owner ] = accounts;

const { expect } = require('chai');

const MyContract = contract.fromArtifact('MyContract'); // Loads a compiled contract

describe('MyContract', function () {
  it('deployer is owner', async function () {
    const myContract = await MyContract.new({ from: owner });
    expect(await myContract.owner()).to.equal(owner);
  });
});

How to add an upgradeable contract which doesn't have constructor but initialize method?

How to add an upgradeable contract which doesn't have constructor but initialize method?

openzeppelin-test-environment is quite a new package, it doesn't tell how to initialize the upgradeable contract

https://github.com/OpenZeppelin/openzeppelin-test-environment

Just a basic example from the link above:

const { accounts, contract } = require('@openzeppelin/test-environment');
const [ owner ] = accounts;

const { expect } = require('chai');

const MyContract = contract.fromArtifact('MyContract'); // Loads a compiled contract

describe('MyContract', function () {
  it('deployer is owner', async function () {
    const myContract = await MyContract.new({ from: owner });
    expect(await myContract.owner()).to.equal(owner);
  });
});

How to add an upgradeable contract which doesn't have constructor but initialize method?

openzeppelin-test-environment is quite a new package, it doesn't tell how to initialize the upgradeable contract in the information below:

https://github.com/OpenZeppelin/openzeppelin-test-environment

Just a basic example from the link above:

const { accounts, contract } = require('@openzeppelin/test-environment');
const [ owner ] = accounts;

const { expect } = require('chai');

const MyContract = contract.fromArtifact('MyContract'); // Loads a compiled contract

describe('MyContract', function () {
  it('deployer is owner', async function () {
    const myContract = await MyContract.new({ from: owner });
    expect(await myContract.owner()).to.equal(owner);
  });
});

How to add an upgradeable contract which doesn't have constructor but initialize method?

Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Source Link

Using openzeppelin-test-environment to test upgradeable contract

openzeppelin-test-environment is quite a new package, it doesn't tell how to initialize the upgradeable contract

https://github.com/OpenZeppelin/openzeppelin-test-environment

Just a basic example from the link above:

const { accounts, contract } = require('@openzeppelin/test-environment');
const [ owner ] = accounts;

const { expect } = require('chai');

const MyContract = contract.fromArtifact('MyContract'); // Loads a compiled contract

describe('MyContract', function () {
  it('deployer is owner', async function () {
    const myContract = await MyContract.new({ from: owner });
    expect(await myContract.owner()).to.equal(owner);
  });
});

How to add an upgradeable contract which doesn't have constructor but initialize method?