Skip to content

Commit

Permalink
Merge 591ab24 into cc91e1d
Browse files Browse the repository at this point in the history
  • Loading branch information
mariacarmina authored Oct 14, 2024
2 parents cc91e1d + 591ab24 commit cd3f376
Show file tree
Hide file tree
Showing 32 changed files with 352 additions and 255 deletions.
6 changes: 4 additions & 2 deletions CodeExamples.md
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,8 @@ you need to mint oceans to mentioned accounts only if you are using barge to tes
const bundleNFT = await factory.createNftWithDatatokenWithFixedRate(
nftParams,
datatokenParams,
freParams
freParams,
false
)

const trxReceipt = await bundleNFT.wait()
Expand Down Expand Up @@ -606,7 +607,8 @@ Lets check that the download URL was successfully received
const bundleNFT = await factory.createNftWithDatatokenWithDispenser(
nftParams,
datatokenParams,
dispenserParams
dispenserParams,
false
)
const trxReceipt = await bundleNFT.wait()
const nftCreatedEvent = getEventFromTx(trxReceipt, 'NFTCreated')
Expand Down
3 changes: 2 additions & 1 deletion ComputeExamples.md
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,8 @@ async function createAsset(

const bundleNFT = await nftFactory.createNftWithDatatoken(
nftParamsAsset,
datatokenParams
datatokenParams,
false
)

const trxReceipt = await bundleNFT.wait()
Expand Down
4 changes: 3 additions & 1 deletion src/config/Config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { AbiItem } from '../@types'
import { LogLevel } from '../utils'

type SDK = 'evm' | 'oasis'

export class Config {
/**
* Ethereum node URL.
Expand Down Expand Up @@ -187,6 +189,6 @@ export class Config {
veFeeEstimate?: string

// is confidential evm
confidentialEVM?: boolean
sdk?: SDK
accessListFactory?: string
}
54 changes: 32 additions & 22 deletions src/config/ConfigHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@ export const configHelperNetworks: Config[] = [
// comment th following configs if running on macOS
metadataCacheUri: 'http://172.15.0.5:5000',
providerUri: 'http://172.15.0.4:8030',
subgraphUri: 'https://172.15.0.15:8000'
subgraphUri: 'https://172.15.0.15:8000',
// uncomment the following configs if running on macOS
// metadataCacheUri: 'http://127.0.0.1:5000',
// providerUri: 'http://127.0.0.1:8030/',
// subgraphUri: 'http://127.0.0.1:9000/'
sdk: 'evm'
},
{
...configHelperNetworksBase,
Expand All @@ -48,7 +49,8 @@ export const configHelperNetworks: Config[] = [
nodeUri: 'https://sepolia.infura.io/v3',
subgraphUri: 'https://v4.subgraph.sepolia.oceanprotocol.com',
explorerUri: 'https://sepolia.etherscan.io',
gasFeeMultiplier: 1.1
gasFeeMultiplier: 1.1,
sdk: 'evm'
},
{
...configHelperNetworksBase,
Expand All @@ -61,7 +63,8 @@ export const configHelperNetworks: Config[] = [
transactionBlockTimeout: 150,
transactionConfirmationBlocks: 5,
transactionPollingTimeout: 1750,
gasFeeMultiplier: 1.05
gasFeeMultiplier: 1.05,
sdk: 'evm'
},
{
...configHelperNetworksBase,
Expand All @@ -71,7 +74,8 @@ export const configHelperNetworks: Config[] = [
subgraphUri: 'https://v4.subgraph.polygon.oceanprotocol.com',
explorerUri: 'https://polygonscan.com',
oceanTokenSymbol: 'mOCEAN',
gasFeeMultiplier: 1.6
gasFeeMultiplier: 1.6,
sdk: 'evm'
},
{
...configHelperNetworksBase,
Expand All @@ -80,7 +84,8 @@ export const configHelperNetworks: Config[] = [
nodeUri: 'https://rpc.gaiaxtestnet.oceanprotocol.com',
providerUri: 'https://v4.provider.gaiaxtestnet.oceanprotocol.com',
subgraphUri: 'https://v4.subgraph.gaiaxtestnet.oceanprotocol.com',
explorerUri: 'https://blockscout.gaiaxtestnet.oceanprotocol.com'
explorerUri: 'https://blockscout.gaiaxtestnet.oceanprotocol.com',
sdk: 'evm'
},
{
...configHelperNetworksBase,
Expand All @@ -89,7 +94,8 @@ export const configHelperNetworks: Config[] = [
nodeUri: 'https://polygon-mumbai.infura.io/v3',
subgraphUri: 'https://v4.subgraph.mumbai.oceanprotocol.com',
explorerUri: 'https://mumbai.polygonscan.com',
gasFeeMultiplier: 1.1
gasFeeMultiplier: 1.1,
sdk: 'evm'
},
{
...configHelperNetworksBase,
Expand All @@ -98,7 +104,8 @@ export const configHelperNetworks: Config[] = [
nodeUri: 'https://bsc-dataseed.binance.org',
subgraphUri: 'https://v4.subgraph.bsc.oceanprotocol.com',
explorerUri: 'https://bscscan.com/',
gasFeeMultiplier: 1.05
gasFeeMultiplier: 1.05,
sdk: 'evm'
},
{
...configHelperNetworksBase,
Expand All @@ -107,7 +114,8 @@ export const configHelperNetworks: Config[] = [
nodeUri: 'https://rpc.energyweb.org',
subgraphUri: 'https://v4.subgraph.energyweb.oceanprotocol.com',
explorerUri: 'https://explorer.energyweb.org',
gasFeeMultiplier: 1.05
gasFeeMultiplier: 1.05,
sdk: 'evm'
},
{
...configHelperNetworksBase,
Expand All @@ -116,7 +124,8 @@ export const configHelperNetworks: Config[] = [
nodeUri: 'https://moonriver.api.onfinality.io/public',
subgraphUri: 'https://v4.subgraph.moonriver.oceanprotocol.com',
explorerUri: 'https://moonriver.moonscan.io/',
gasFeeMultiplier: 1.05
gasFeeMultiplier: 1.05,
sdk: 'evm'
},
{
...configHelperNetworksBase,
Expand All @@ -127,7 +136,8 @@ export const configHelperNetworks: Config[] = [
providerUri: 'https://provider.v4.genx.delta-dao.com',
subgraphUri: 'https://subgraph.v4.genx.minimal-gaia-x.eu',
explorerUri: 'https://explorer.genx.minimal-gaia-x.eu/',
gasFeeMultiplier: 1
gasFeeMultiplier: 1,
sdk: 'evm'
},
{
...configHelperNetworksBase,
Expand All @@ -136,7 +146,8 @@ export const configHelperNetworks: Config[] = [
nodeUri: 'https://mainnet.optimism.io',
subgraphUri: 'https://v4.subgraph.optimism.oceanprotocol.com',
explorerUri: 'https://optimistic.etherscan.io/',
gasFeeMultiplier: 1.1
gasFeeMultiplier: 1.1,
sdk: 'evm'
},
{
...configHelperNetworksBase,
Expand All @@ -145,7 +156,8 @@ export const configHelperNetworks: Config[] = [
nodeUri: 'https://sepolia.optimism.io',
subgraphUri: 'https://v4.subgraph.optimism-sepolia.oceanprotocol.com',
explorerUri: 'https://sepolia-optimism.etherscan.io/',
gasFeeMultiplier: 1.1
gasFeeMultiplier: 1.1,
sdk: 'evm'
},
{
...configHelperNetworksBase,
Expand All @@ -154,7 +166,8 @@ export const configHelperNetworks: Config[] = [
nodeUri: 'https://sapphire.oasis.io',
subgraphUri: 'https://v4.subgraph.sapphire-mainnet.oceanprotocol.com/',
explorerUri: 'https://explorer.oasis.io/mainnet/sapphire/',
gasFeeMultiplier: 1
gasFeeMultiplier: 1,
sdk: 'oasis'
},
{
...configHelperNetworksBase,
Expand All @@ -164,7 +177,8 @@ export const configHelperNetworks: Config[] = [
subgraphUri:
'https://v4.subgraph.sapphire-testnet.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph',
explorerUri: 'https://explorer.oasis.io/testnet/sapphire/',
gasFeeMultiplier: 1
gasFeeMultiplier: 1,
sdk: 'oasis'
},
{
...configHelperNetworksBase,
Expand All @@ -174,7 +188,8 @@ export const configHelperNetworks: Config[] = [
metadataCacheUri: 'https://aquarius.dev.pontus-x.eu',
providerUri: 'https://provider.dev.pontus-x.eu',
subgraphUri: 'https://subgraph.dev.pontus-x.eu',
explorerUri: 'https://explorer.dev.pontus-x.eu/testnet/pontusx'
explorerUri: 'https://explorer.dev.pontus-x.eu/testnet/pontusx',
sdk: 'evm'
}
]

Expand Down Expand Up @@ -315,13 +330,8 @@ export class ConfigHelper {
addresses
)
}
config.confidentialEVM =
filterBy === 'chainId'
? KNOWN_CONFIDENTIAL_EVMS.includes(Number(network))
: network.toString().includes('oasis_sap')
if (config.confidentialEVM) {
config.accessListFactory = contractAddressesConfig.accessListFactory
}

config.accessListFactory = contractAddressesConfig.accessListFactory

config = { ...config, ...contractAddressesConfig }

Expand Down
15 changes: 5 additions & 10 deletions src/contracts/AccessList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,9 @@ export class AccessListContract extends SmartContractWithAddress {
): Promise<ReceiptOrEstimate<G>> {
const estGas = await this.contract.estimateGas.mint(user, tokenUri)
if (estimateGas) return <ReceiptOrEstimate<G>>estGas

const trxReceipt = await sendTx(
estGas,
this.signer,
this.getSignerAccordingSdk(),
this.config?.gasFeeMultiplier,
this.contract.mint,
user,
Expand All @@ -122,10 +121,9 @@ export class AccessListContract extends SmartContractWithAddress {
): Promise<ReceiptOrEstimate<G>> {
const estGas = await this.contract.estimateGas.batchMint(users, tokenUris)
if (estimateGas) return <ReceiptOrEstimate<G>>estGas

const trxReceipt = await sendTx(
estGas,
this.signer,
this.getSignerAccordingSdk(),
this.config?.gasFeeMultiplier,
this.contract.batchMint,
users,
Expand All @@ -146,10 +144,9 @@ export class AccessListContract extends SmartContractWithAddress {
): Promise<ReceiptOrEstimate<G>> {
const estGas = await this.contract.estimateGas.burn(tokenId)
if (estimateGas) return <ReceiptOrEstimate<G>>estGas

const trxReceipt = await sendTx(
estGas,
this.signer,
this.getSignerAccordingSdk(),
this.config?.gasFeeMultiplier,
this.contract.burn,
tokenId
Expand All @@ -169,10 +166,9 @@ export class AccessListContract extends SmartContractWithAddress {
): Promise<ReceiptOrEstimate<G>> {
const estGas = await this.contract.estimateGas.transferOwnership(newOwner)
if (estimateGas) return <ReceiptOrEstimate<G>>estGas

const trxReceipt = await sendTx(
estGas,
this.signer,
this.getSignerAccordingSdk(),
this.config?.gasFeeMultiplier,
this.contract.transferOwnership,
newOwner
Expand All @@ -190,10 +186,9 @@ export class AccessListContract extends SmartContractWithAddress {
): Promise<ReceiptOrEstimate<G>> {
const estGas = await this.contract.estimateGas.renounceOwnership()
if (estimateGas) return <ReceiptOrEstimate<G>>estGas

const trxReceipt = await sendTx(
estGas,
this.signer,
this.getSignerAccordingSdk(),
this.config?.gasFeeMultiplier,
this.contract.renounceOwnership
)
Expand Down
5 changes: 2 additions & 3 deletions src/contracts/AccessListFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export class AccesslistFactory extends SmartContractWithAddress {
try {
const tx = await sendTx(
estGas,
this.signer,
this.getSignerAccordingSdk(),
this.config?.gasFeeMultiplier,
this.contract.deployAccessListContract,
nameAccessList,
Expand Down Expand Up @@ -144,10 +144,9 @@ export class AccesslistFactory extends SmartContractWithAddress {

const estGas = await this.contract.estimateGas.changeTemplateAddress(templateAddress)
if (estimateGas) return <ReceiptOrEstimate<G>>estGas

const trxReceipt = await sendTx(
estGas,
this.signer,
this.getSignerAccordingSdk(),
this.config?.gasFeeMultiplier,
this.contract.functions.changeTemplateAddress,
templateAddress
Expand Down
Loading

0 comments on commit cd3f376

Please sign in to comment.