How to use the ethereum-waffle.deployContract function in ethereum-waffle

To help you get started, we’ve selected a few ethereum-waffle examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github EthWorks / Doppelganger / test / integrations / proxied.ts View on Github external
it('mocking mechanism works', async () => {
    const doppelganger = new Doppelganger(Counter.interface);
    await doppelganger.deploy(wallet);
    const capContract = await deployContract(
      wallet,
      {
        abi: Cap.interface,
        evm: {
          bytecode: {
            object: Cap.bytecode,
          },
        },
      },
      [doppelganger.address],
    );

    await doppelganger.read.returns(5);
    const ret1 = await expect(capContract.read()).to.be.eventually.fulfilled;
    expect(ret1.toNumber()).to.be.equal(5);
github TovarishFin / crypto-weddings-contracts / test / helpers / general.js View on Github external
const setupContext = async noInit => {
  const provider = createMockProvider()
  const wallets = getWallets(provider)
  const [owner, partner1, partner2, weddingStub, other] = wallets

  const wngMaster = await deployContract(owner, Wedding)
  const wmrMaster = await deployContract(owner, WeddingManager)
  const wmrMasterStub = await deployContract(owner, WeddingManagerStub)
  const wngEmitterStub = await deployContract(owner, WeddingEventEmitterStub)

  const wmrProxy = await deployContract(owner, UpgradeableProxy, [
    wmrMaster.address
  ])
  const wmr = new Contract(wmrProxy.address, WeddingManager.abi, owner)

  if (!noInit) {
    wmr.initialize(wngMaster.address, { gasLimit })
  }

  return {
    provider,
    wallets,
    owner,
    partner1,
    partner2,
github TovarishFin / crypto-weddings-contracts / test / helpers / general.js View on Github external
const setupContext = async noInit => {
  const provider = createMockProvider()
  const wallets = getWallets(provider)
  const [owner, partner1, partner2, weddingStub, other] = wallets

  const wngMaster = await deployContract(owner, Wedding)
  const wmrMaster = await deployContract(owner, WeddingManager)
  const wmrMasterStub = await deployContract(owner, WeddingManagerStub)
  const wngEmitterStub = await deployContract(owner, WeddingEventEmitterStub)

  const wmrProxy = await deployContract(owner, UpgradeableProxy, [
    wmrMaster.address
  ])
  const wmr = new Contract(wmrProxy.address, WeddingManager.abi, owner)

  if (!noInit) {
    wmr.initialize(wngMaster.address, { gasLimit })
  }

  return {
    provider,
    wallets,
    owner,
    partner1,
github Amxx / KitsuneWallet-ERC1836 / test / wallets / WalletMultisig.js View on Github external
before(async () => {
		await sdk.contracts.getMasterInstance("WalletMultisig", { allowDeploy: true });
		targetContract = await deployContract(wallet, Target, []);
	});
github Amxx / KitsuneWallet-ERC1836 / test / wallets / IexecWhitelist.js View on Github external
beforeEach(async () => {
		proxyContract = await deployContract(wallet, Proxy, [
			walletContract.address,
			walletContract.interface.functions.initialize.encode([
				[
					addrToKey(user1.address),
				],
				[
					'0x0000000000000000000000000000000000000000000000000000000000000007',
				],
				1,
				1,
			])
		]);
		proxyAsWallet = new ethers.Contract(proxyContract.address, Wallet.abi, provider);

		await wallet.sendTransaction({to: proxyAsWallet.address, value: eth(1)});
	});
github Amxx / KitsuneWallet-ERC1836 / test / wallets / IexecWhitelist.js View on Github external
before(async () => {
		walletContract = await deployContract(wallet, Wallet, []);
		targetContract = await deployContract(wallet, Target, []);
	});
github Amxx / KitsuneWallet-ERC1836 / test / wallets / WalletMultisigRefundOutOfOrder.js View on Github external
before(async () => {
		await sdk.contracts.getMasterInstance("WalletMultisigRefundOutOfOrder", { allowDeploy: true });
		targetContract = await deployContract(wallet, Target, []);
		tokenContract  = await deployContract(wallet, Token,  []);
	});
github Amxx / KitsuneWallet-ERC1836 / test / wallets / IexecWhitelist.js View on Github external
before(async () => {
		walletContract = await deployContract(wallet, Wallet, []);
		targetContract = await deployContract(wallet, Target, []);
	});
github Amxx / KitsuneWallet-ERC1836 / test / wallets / WalletOwnable.js View on Github external
before(async () => {
		walletContract = await sdk.contracts.getMasterInstance("WalletOwnable", { allowDeploy: true });
		targetContract = await deployContract(wallet, Target, []);
		dest = ethers.utils.getAddress(ethers.utils.hexlify(ethers.utils.randomBytes(20)));
	});
github EthWorks / Doppelganger / lib / index.ts View on Github external
async deploy(wallet: Wallet) {
    this.contractInstance = await deployContract(wallet, DoppelgangerContract);
  }
}

ethereum-waffle

Sweeter, faster and simpler than truffle.

MIT
Latest version published 2 years ago

Package Health Score

53 / 100
Full package analysis