mirror of
https://github.com/oceanprotocol/ocean.js.git
synced 2024-11-26 20:39:05 +01:00
try another way, debug
This commit is contained in:
parent
36f1865175
commit
df2d5dd054
@ -20,8 +20,11 @@ import { ProviderInstance } from '../services/Provider'
|
|||||||
|
|
||||||
import { HardhatEthersHelpers } from '@nomiclabs/hardhat-ethers/types'
|
import { HardhatEthersHelpers } from '@nomiclabs/hardhat-ethers/types'
|
||||||
import { HardhatRuntimeEnvironment } from 'hardhat/types'
|
import { HardhatRuntimeEnvironment } from 'hardhat/types'
|
||||||
import { getContractAtFromArtifact } from '@nomiclabs/hardhat-ethers/internal/helpers'
|
|
||||||
import hre from 'hardhat'
|
import hre from 'hardhat'
|
||||||
|
// eslint-disable-next-line import/no-named-default
|
||||||
|
import ERC20Template from '@oceanprotocol/contracts/artifacts/contracts/templates/ERC20Template.sol/ERC20Template.json'
|
||||||
|
|
||||||
|
console.log('ABI', ERC20Template.abi)
|
||||||
|
|
||||||
const hardhatEthers = hre as HardhatRuntimeEnvironment & { ethers: any } & {
|
const hardhatEthers = hre as HardhatRuntimeEnvironment & { ethers: any } & {
|
||||||
ethers: typeof ethers & HardhatEthersHelpers
|
ethers: typeof ethers & HardhatEthersHelpers
|
||||||
@ -141,14 +144,19 @@ export async function calculateTemplateIndexV2(
|
|||||||
console.log(tokenTemplate)
|
console.log(tokenTemplate)
|
||||||
console.log('hardhatEthers', hardhatEthers)
|
console.log('hardhatEthers', hardhatEthers)
|
||||||
|
|
||||||
const artifact = await hre.artifacts.readArtifact('ERC20Template')
|
// const artifact = await hre.artifacts.readArtifact('ERC20Template')
|
||||||
|
const erc20Template = new ethers.Contract(
|
||||||
const erc20Template = await getContractAtFromArtifact(
|
|
||||||
hre,
|
|
||||||
artifact,
|
|
||||||
tokenTemplate.templateAddress,
|
tokenTemplate.templateAddress,
|
||||||
|
ERC20Template.abi,
|
||||||
owner
|
owner
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// const erc20Template = await getContractAtFromArtifact(
|
||||||
|
// hre,
|
||||||
|
// artifact,
|
||||||
|
// tokenTemplate.templateAddress,
|
||||||
|
// owner
|
||||||
|
// )
|
||||||
console.log('erc20Template: ', erc20Template)
|
console.log('erc20Template: ', erc20Template)
|
||||||
// hardhatEthers.ethers.getContractAt(
|
// hardhatEthers.ethers.getContractAt(
|
||||||
// 'ERC20Template',
|
// 'ERC20Template',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user