fix: linting issues on contracts folder (#212)
This commit is contained in:
parent
a571dabe6c
commit
fdedc18b02
|
|
@ -21,7 +21,6 @@ const {
|
||||||
ETH_MAIN_API_URL,
|
ETH_MAIN_API_URL,
|
||||||
ETH_SEPOLIA_API_URL,
|
ETH_SEPOLIA_API_URL,
|
||||||
ETH_GOERLI_API_URL,
|
ETH_GOERLI_API_URL,
|
||||||
POLYGONSCAN_KEY,
|
|
||||||
MAINNET_API_KEY,
|
MAINNET_API_KEY,
|
||||||
COINMARKETCAP_KEY,
|
COINMARKETCAP_KEY,
|
||||||
} = process.env;
|
} = process.env;
|
||||||
|
|
@ -39,22 +38,22 @@ const config: HardhatUserConfig = {
|
||||||
: undefined,
|
: undefined,
|
||||||
},
|
},
|
||||||
mumbai: {
|
mumbai: {
|
||||||
url: POLYGON_API_URL ? POLYGON_API_URL : "",
|
url: POLYGON_API_URL ? POLYGON_API_URL : '',
|
||||||
accounts: PRIVATE_KEY ? [PRIVATE_KEY] : [],
|
accounts: PRIVATE_KEY ? [PRIVATE_KEY] : [],
|
||||||
chainId: 80001,
|
chainId: 80001,
|
||||||
},
|
},
|
||||||
goerli: {
|
goerli: {
|
||||||
url: ETH_GOERLI_API_URL ? ETH_GOERLI_API_URL : "",
|
url: ETH_GOERLI_API_URL ? ETH_GOERLI_API_URL : '',
|
||||||
accounts: PRIVATE_KEY ? [PRIVATE_KEY] : [],
|
accounts: PRIVATE_KEY ? [PRIVATE_KEY] : [],
|
||||||
chainId: 5,
|
chainId: 5,
|
||||||
},
|
},
|
||||||
sepolia: {
|
sepolia: {
|
||||||
url: ETH_SEPOLIA_API_URL ? ETH_SEPOLIA_API_URL : "",
|
url: ETH_SEPOLIA_API_URL ? ETH_SEPOLIA_API_URL : '',
|
||||||
accounts: PRIVATE_KEY ? [PRIVATE_KEY] : [],
|
accounts: PRIVATE_KEY ? [PRIVATE_KEY] : [],
|
||||||
chainId: 11155111,
|
chainId: 11155111,
|
||||||
},
|
},
|
||||||
mainnet: {
|
mainnet: {
|
||||||
url: ETH_MAIN_API_URL ? ETH_MAIN_API_URL : "",
|
url: ETH_MAIN_API_URL ? ETH_MAIN_API_URL : '',
|
||||||
accounts: PRIVATE_KEY ? [PRIVATE_KEY] : [],
|
accounts: PRIVATE_KEY ? [PRIVATE_KEY] : [],
|
||||||
chainId: 1,
|
chainId: 1,
|
||||||
},
|
},
|
||||||
|
|
@ -90,7 +89,7 @@ const config: HardhatUserConfig = {
|
||||||
// apiKey: {
|
// apiKey: {
|
||||||
// polygonMumbai: POLYGONSCAN_KEY,
|
// polygonMumbai: POLYGONSCAN_KEY,
|
||||||
// },
|
// },
|
||||||
apiKey: ETHERSCAN_API_KEY ? ETHERSCAN_API_KEY : "",
|
apiKey: ETHERSCAN_API_KEY ? ETHERSCAN_API_KEY : '',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ module.exports = async (taskArgs, hre) => {
|
||||||
console.log(taskArgs);
|
console.log(taskArgs);
|
||||||
console.log();
|
console.log();
|
||||||
|
|
||||||
const arguments = [name, symbol, billing];
|
const deployArguments = [name, symbol, billing];
|
||||||
|
|
||||||
const libraries = await libraryDeployment(hre);
|
const libraries = await libraryDeployment(hre);
|
||||||
|
|
||||||
|
|
@ -80,7 +80,7 @@ module.exports = async (taskArgs, hre) => {
|
||||||
console.log('Creating new proxy contract...');
|
console.log('Creating new proxy contract...');
|
||||||
deployResult = await upgrades.deployProxy(
|
deployResult = await upgrades.deployProxy(
|
||||||
Contract,
|
Contract,
|
||||||
arguments,
|
deployArguments,
|
||||||
DEFAULT_PROXY_SETTINGS
|
DEFAULT_PROXY_SETTINGS
|
||||||
);
|
);
|
||||||
await deployResult.deployed();
|
await deployResult.deployed();
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
const { ethers } = require('hardhat');
|
|
||||||
require('@nomiclabs/hardhat-etherscan');
|
require('@nomiclabs/hardhat-etherscan');
|
||||||
|
|
||||||
const networkName = hre.network.name;
|
const networkName = hre.network.name;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
import { loadFixture } from '@nomicfoundation/hardhat-network-helpers';
|
import { loadFixture } from '@nomicfoundation/hardhat-network-helpers';
|
||||||
import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers';
|
|
||||||
import { expect } from 'chai';
|
import { expect } from 'chai';
|
||||||
import { ethers } from 'hardhat';
|
|
||||||
import { TestConstants, Fixtures, Errors } from '../helpers';
|
import { TestConstants, Fixtures, Errors } from '../helpers';
|
||||||
const { AccessPointStatus } = TestConstants;
|
const { AccessPointStatus } = TestConstants;
|
||||||
|
|
||||||
|
|
@ -19,7 +17,7 @@ describe('FleekERC721.AccessPoints.AutoApprovalOff', () => {
|
||||||
.to.emit(contract, 'NewAccessPoint')
|
.to.emit(contract, 'NewAccessPoint')
|
||||||
.withArgs('accesspoint.com', tokenId, owner.address);
|
.withArgs('accesspoint.com', tokenId, owner.address);
|
||||||
|
|
||||||
let ap = await contract.getAccessPointJSON('accesspoint.com');
|
const ap = await contract.getAccessPointJSON('accesspoint.com');
|
||||||
const parsedAp = JSON.parse(ap);
|
const parsedAp = JSON.parse(ap);
|
||||||
|
|
||||||
expect(parsedAp).to.eql({
|
expect(parsedAp).to.eql({
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ describe('FleekERC721.AccessPoints.AutoApprovalOn', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should revert if AP does not exist', async () => {
|
it('should revert if AP does not exist', async () => {
|
||||||
const { contract, tokenId } = fixture;
|
const { contract } = fixture;
|
||||||
|
|
||||||
await expect(
|
await expect(
|
||||||
contract.getAccessPointJSON('random.com')
|
contract.getAccessPointJSON('random.com')
|
||||||
|
|
@ -88,7 +88,7 @@ describe('FleekERC721.AccessPoints.AutoApprovalOn', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should allow anyone to change AP score', async () => {
|
it('should allow anyone to change AP score', async () => {
|
||||||
const { contract, otherAccount, tokenId } = fixture;
|
const { contract, otherAccount } = fixture;
|
||||||
|
|
||||||
await contract.increaseAccessPointScore(DefaultAP);
|
await contract.increaseAccessPointScore(DefaultAP);
|
||||||
await contract.connect(otherAccount).increaseAccessPointScore(DefaultAP);
|
await contract.connect(otherAccount).increaseAccessPointScore(DefaultAP);
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ import { loadFixture } from '@nomicfoundation/hardhat-network-helpers';
|
||||||
import { ethers } from 'hardhat';
|
import { ethers } from 'hardhat';
|
||||||
import { expect } from 'chai';
|
import { expect } from 'chai';
|
||||||
import { Fixtures, TestConstants, Errors } from './helpers';
|
import { Fixtures, TestConstants, Errors } from './helpers';
|
||||||
|
import { BigNumber } from 'ethers';
|
||||||
|
|
||||||
const { Billing, MintParams } = TestConstants;
|
const { Billing, MintParams } = TestConstants;
|
||||||
|
|
||||||
|
|
@ -10,7 +11,7 @@ describe('FleekERC721.Billing', () => {
|
||||||
const mintPrice = ethers.utils.parseEther('1');
|
const mintPrice = ethers.utils.parseEther('1');
|
||||||
const addAPPrice = ethers.utils.parseEther('1');
|
const addAPPrice = ethers.utils.parseEther('1');
|
||||||
|
|
||||||
const mint = (value?: any) => {
|
const mint = (value?: BigNumber) => {
|
||||||
const { contract, owner } = fixture;
|
const { contract, owner } = fixture;
|
||||||
return contract.mint(
|
return contract.mint(
|
||||||
owner.address,
|
owner.address,
|
||||||
|
|
@ -28,7 +29,7 @@ describe('FleekERC721.Billing', () => {
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const addAP = (value?: any) => {
|
const addAP = (value?: BigNumber) => {
|
||||||
const { contract } = fixture;
|
const { contract } = fixture;
|
||||||
return contract.addAccessPoint(0, 'random.com', { value });
|
return contract.addAccessPoint(0, 'random.com', { value });
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ describe('FleekERC721.CollectionRoles', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should fetch the list of owners', async () => {
|
it('should fetch the list of owners', async () => {
|
||||||
const { owner, contract, otherAccount } = fixture;
|
const { contract, otherAccount } = fixture;
|
||||||
|
|
||||||
await contract.grantCollectionRole(
|
await contract.grantCollectionRole(
|
||||||
CollectionRoles.Owner,
|
CollectionRoles.Owner,
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { loadFixture } from '@nomicfoundation/hardhat-network-helpers';
|
import { loadFixture } from '@nomicfoundation/hardhat-network-helpers';
|
||||||
import { expect } from 'chai';
|
import { expect } from 'chai';
|
||||||
import { TestConstants, Fixtures, parseTokenURI } from './helpers';
|
import { TestConstants, Fixtures } from './helpers';
|
||||||
import { ethers } from 'hardhat';
|
import { ethers } from 'hardhat';
|
||||||
const { MintParams } = TestConstants;
|
const { MintParams } = TestConstants;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers';
|
import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers';
|
||||||
import { ethers, upgrades } from 'hardhat';
|
import { ethers } from 'hardhat';
|
||||||
import { TestConstants } from './constants';
|
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||||
const namehash = require('@ensdomains/eth-ens-namehash');
|
const namehash = require('@ensdomains/eth-ens-namehash');
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import { loadFixture } from '@nomicfoundation/hardhat-network-helpers';
|
||||||
import { expect } from 'chai';
|
import { expect } from 'chai';
|
||||||
import { TestConstants, Fixtures, Errors } from './helpers';
|
import { TestConstants, Fixtures, Errors } from './helpers';
|
||||||
|
|
||||||
const { MintParams, CollectionRoles, TokenRoles } = TestConstants;
|
const { MintParams, CollectionRoles } = TestConstants;
|
||||||
|
|
||||||
describe('FleekERC721.Pausable', () => {
|
describe('FleekERC721.Pausable', () => {
|
||||||
let fixture: Awaited<ReturnType<typeof Fixtures.default>>;
|
let fixture: Awaited<ReturnType<typeof Fixtures.default>>;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { loadFixture } from '@nomicfoundation/hardhat-network-helpers';
|
import { loadFixture } from '@nomicfoundation/hardhat-network-helpers';
|
||||||
import { expect } from 'chai';
|
import { expect } from 'chai';
|
||||||
import { TestConstants, Fixtures, parseTokenURI, Errors } from './helpers';
|
import { TestConstants, Fixtures, Errors } from './helpers';
|
||||||
|
|
||||||
const { TokenRoles } = TestConstants;
|
const { TokenRoles } = TestConstants;
|
||||||
|
|
||||||
|
|
@ -25,7 +25,7 @@ describe('FleekERC721.TokenRoles', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should add a new controller', async () => {
|
it('should add a new controller', async () => {
|
||||||
const { contract, owner, otherAccount, tokenId } = fixture;
|
const { contract, otherAccount, tokenId } = fixture;
|
||||||
await contract.grantTokenRole(
|
await contract.grantTokenRole(
|
||||||
tokenId,
|
tokenId,
|
||||||
TokenRoles.Controller,
|
TokenRoles.Controller,
|
||||||
|
|
@ -78,7 +78,7 @@ describe('FleekERC721.TokenRoles', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should remove an added controller', async () => {
|
it('should remove an added controller', async () => {
|
||||||
const { contract, owner, otherAccount, tokenId } = fixture;
|
const { contract, otherAccount, tokenId } = fixture;
|
||||||
await contract.grantTokenRole(
|
await contract.grantTokenRole(
|
||||||
tokenId,
|
tokenId,
|
||||||
TokenRoles.Controller,
|
TokenRoles.Controller,
|
||||||
|
|
@ -134,7 +134,7 @@ describe('FleekERC721.TokenRoles', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should not be able to remove address role', async () => {
|
it('should not be able to remove address role', async () => {
|
||||||
const { contract, owner, otherAccount, tokenId } = fixture;
|
const { contract, otherAccount, tokenId } = fixture;
|
||||||
|
|
||||||
await expect(
|
await expect(
|
||||||
contract
|
contract
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||||
import { expect } from 'chai';
|
import { expect } from 'chai';
|
||||||
import {
|
import {
|
||||||
proxyStore,
|
proxyStore,
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,8 @@
|
||||||
{
|
{
|
||||||
"extends": "../tsconfig.base.json",
|
"extends": "../tsconfig.base.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"allowJs": true,
|
||||||
|
"noEmit": true
|
||||||
|
},
|
||||||
"include": ["./**/*"]
|
"include": ["./**/*"]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue