ERC1967Proxy.test.js 711 B

1234567891011121314151617181920212223
  1. const { ethers } = require('hardhat');
  2. const shouldBehaveLikeProxy = require('../Proxy.behaviour');
  3. const { loadFixture } = require('@nomicfoundation/hardhat-network-helpers');
  4. const fixture = async () => {
  5. const [nonContractAddress] = await ethers.getSigners();
  6. const implementation = await ethers.deployContract('DummyImplementation');
  7. const createProxy = (implementation, initData, opts) =>
  8. ethers.deployContract('ERC1967Proxy', [implementation, initData], opts);
  9. return { nonContractAddress, implementation, createProxy };
  10. };
  11. describe('ERC1967Proxy', function () {
  12. beforeEach(async function () {
  13. Object.assign(this, await loadFixture(fixture));
  14. });
  15. shouldBehaveLikeProxy();
  16. });