mirror of
https://github.com/oceanprotocol/ocean.js.git
synced 2024-11-26 20:39:05 +01:00
rename deployERC20 to deployDatatoken
This commit is contained in:
parent
df41cd042f
commit
ad73cf855c
@ -14,7 +14,7 @@ export interface MetadataAndTokenURI {
|
|||||||
|
|
||||||
export interface NftRoles {
|
export interface NftRoles {
|
||||||
manager: boolean
|
manager: boolean
|
||||||
deployERC20: boolean
|
deployDatatoken: boolean
|
||||||
updateMetadata: boolean
|
updateMetadata: boolean
|
||||||
store: boolean
|
store: boolean
|
||||||
}
|
}
|
||||||
|
@ -621,7 +621,7 @@ export class Datatoken extends SmartContract {
|
|||||||
const isNftOwner = nftAddress && (await this.nft.getNftOwner(nftAddress)) === address
|
const isNftOwner = nftAddress && (await this.nft.getNftOwner(nftAddress)) === address
|
||||||
const nftPermissions =
|
const nftPermissions =
|
||||||
nftAddress && !isNftOwner && (await this.nft.getNftPermissions(nftAddress, address))
|
nftAddress && !isNftOwner && (await this.nft.getNftPermissions(nftAddress, address))
|
||||||
const isDatatokenDeployer = nftPermissions?.deployERC20
|
const isDatatokenDeployer = nftPermissions?.deployDatatoken
|
||||||
if (!isPaymentManager && !isNftOwner && !isDatatokenDeployer) {
|
if (!isPaymentManager && !isNftOwner && !isDatatokenDeployer) {
|
||||||
throw new Error(`Caller is not Fee Manager, owner or erc20 Deployer`)
|
throw new Error(`Caller is not Fee Manager, owner or erc20 Deployer`)
|
||||||
}
|
}
|
||||||
@ -1129,7 +1129,7 @@ export class Datatoken extends SmartContract {
|
|||||||
return nftAddress
|
return nftAddress
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Returns true if address has deployERC20 role
|
/** Returns true if address has deployDatatoken role
|
||||||
* @param {String} dtAddress Datatoken adress
|
* @param {String} dtAddress Datatoken adress
|
||||||
* @param {String} dtAddress Datatoken adress
|
* @param {String} dtAddress Datatoken adress
|
||||||
* @return {Promise<boolean>}
|
* @return {Promise<boolean>}
|
||||||
|
@ -81,7 +81,7 @@ export class Nft extends SmartContract {
|
|||||||
symbol?: string,
|
symbol?: string,
|
||||||
templateIndex?: number
|
templateIndex?: number
|
||||||
): Promise<string> {
|
): Promise<string> {
|
||||||
if ((await this.getNftPermissions(nftAddress, address)).deployERC20 !== true) {
|
if ((await this.getNftPermissions(nftAddress, address)).deployDatatoken !== true) {
|
||||||
throw new Error(`Caller is not DatatokenDeployer`)
|
throw new Error(`Caller is not DatatokenDeployer`)
|
||||||
}
|
}
|
||||||
if (!templateIndex) templateIndex = 1
|
if (!templateIndex) templateIndex = 1
|
||||||
@ -316,7 +316,7 @@ export class Nft extends SmartContract {
|
|||||||
if (
|
if (
|
||||||
(await this.getNftPermissions(nftAddress, address)).manager !== true ||
|
(await this.getNftPermissions(nftAddress, address)).manager !== true ||
|
||||||
(address === datatokenDeployer &&
|
(address === datatokenDeployer &&
|
||||||
(await this.getNftPermissions(nftAddress, address)).deployERC20 !== true)
|
(await this.getNftPermissions(nftAddress, address)).deployDatatoken !== true)
|
||||||
) {
|
) {
|
||||||
throw new Error(`Caller is not Manager nor DatatokenDeployer`)
|
throw new Error(`Caller is not Manager nor DatatokenDeployer`)
|
||||||
}
|
}
|
||||||
|
@ -303,7 +303,7 @@ describe('Datatoken', () => {
|
|||||||
it('#setPaymentCollector - should set a new paymentCollector, if ERC 20 DEPLOYER', async () => {
|
it('#setPaymentCollector - should set a new paymentCollector, if ERC 20 DEPLOYER', async () => {
|
||||||
assert(
|
assert(
|
||||||
(await nftDatatoken.getNftPermissions(nftAddress, datatokenDeployer))
|
(await nftDatatoken.getNftPermissions(nftAddress, datatokenDeployer))
|
||||||
.deployERC20 === true
|
.deployDatatoken === true
|
||||||
)
|
)
|
||||||
|
|
||||||
await datatoken.setPaymentCollector(datatokenAddress, datatokenDeployer, user3)
|
await datatoken.setPaymentCollector(datatokenAddress, datatokenDeployer, user3)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user