Skip to content

Commit

Permalink
prettier trailing comma in contracts v01
Browse files Browse the repository at this point in the history
  • Loading branch information
Intizar-T committed Jul 5, 2024
1 parent 1bb6ba2 commit b953f7c
Show file tree
Hide file tree
Showing 93 changed files with 896 additions and 965 deletions.
12 changes: 3 additions & 9 deletions contracts/v0.1/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
{
"root": true,
"extends": [
"prettier"
],
"plugins": [
"prettier"
],
"extends": ["prettier"],
"plugins": ["prettier"],
"rules": {
"prettier/prettier": [
"error"
]
"prettier/prettier": ["error"]
},
"parserOptions": {
"sourceType": "module",
Expand Down
2 changes: 1 addition & 1 deletion contracts/v0.1/.prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"useTabs": false,
"tabWidth": 2,
"singleQuote": true,
"trailingComma": "none",
"trailingComma": "all",
"printWidth": 100,
"semi": false,
"overrides": [
Expand Down
2 changes: 1 addition & 1 deletion contracts/v0.1/.solhint.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"rules": {
"avoid-throw": "off",
"avoid-low-level-calls": "off",
"func-visibility": ["warn",{"ignoreConstructors": true}],
"func-visibility": ["warn", { "ignoreConstructors": true }],
"avoid-suicide": "error",
"avoid-sha3": "warn",
"compiler-version": ["error", "^0.8.16"]
Expand Down
16 changes: 8 additions & 8 deletions contracts/v0.1/deploy/Aggregator/Aggregator.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const {
validateAggregatorDeployConfig,
validateAggregatorChangeOraclesConfig,
validateAggregatorRedirectProxyConfig,
getFormattedDate
getFormattedDate,
} = require('../../scripts/utils.cjs')

const func = async function (hre) {
Expand Down Expand Up @@ -44,10 +44,10 @@ const func = async function (hre) {
deployConfig.timeout,
deployConfig.validator,
deployConfig.decimals,
deployConfig.description
deployConfig.description,
],
from: deployer,
log: true
log: true,
})
aggregator = await ethers.getContractAt('Aggregator', aggregatorDeployment.address)
deployedContracts[`Aggregator_${deployConfig.name}`] = aggregatorDeployment.address
Expand All @@ -72,7 +72,7 @@ const func = async function (hre) {
changeOraclesConfig.added,
changeOraclesConfig.minSubmissionCount,
changeOraclesConfig.maxSubmissionCount,
changeOraclesConfig.restartDelay
changeOraclesConfig.restartDelay,
)
).wait()
}
Expand Down Expand Up @@ -112,7 +112,7 @@ const func = async function (hre) {
expect(confirmedAggregator).to.be.eq(proposedAggregator)

console.log(
`Proxy Aggregator redirected from ${aggregatorAddress} to new ${confirmedAggregator}`
`Proxy Aggregator redirected from ${aggregatorAddress} to new ${confirmedAggregator}`,
)
} else if (redirectProxyConfig.status == 'revert') {
// Revert back to old Aggregator Address
Expand All @@ -135,15 +135,15 @@ const func = async function (hre) {
contract: 'AggregatorProxy',
args: [aggregator.address],
from: deployer,
log: true
log: true,
})

// DataFeedConsumerMock
if (['localhost', 'hardhat'].includes(network.name)) {
await localhostDeployment({
deploy,
aggregatorProxyDeployment,
name: deployConfig.name
name: deployConfig.name,
})
}
}
Expand All @@ -164,7 +164,7 @@ async function localhostDeployment(args) {
contract: 'DataFeedConsumerMock',
args: [aggregatorProxyDeployment.address],
from: consumer,
log: true
log: true,
})
}

Expand Down
9 changes: 4 additions & 5 deletions contracts/v0.1/deploy/AggregatorRouter/AggregatorRouter.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const {
loadJson,
loadMigration,
updateMigration,
loadDeployments
loadDeployments,
} = require('../../scripts/utils.cjs')

const func = async function (hre) {
Expand All @@ -26,12 +26,12 @@ const func = async function (hre) {
const aggregatorRouterDeployment = await deploy('AggregatorRouter', {
args: [],
from: deployer,
log: true
log: true,
})

aggregatorRouter = await ethers.getContractAt(
'AggregatorRouter',
aggregatorRouterDeployment.address
aggregatorRouterDeployment.address,
)

console.log('AggregatorRouter:', aggregatorRouterDeployment)
Expand All @@ -50,7 +50,7 @@ const func = async function (hre) {

if (updateProxiesConfig.updateAll) {
const deployments = await loadDeployments(`./deployments/${network.name}`)

for (const key in deployments) {
if (key.includes('AggregatorProxy')) {
const feedName = key.split('_')[1]
Expand All @@ -66,7 +66,6 @@ const func = async function (hre) {
feedNames.push(feedName)
addresses.push(address)
}

}
if (feedNames.length == 0 || addresses.length == 0) {
throw new Error('no proxies to update')
Expand Down
4 changes: 2 additions & 2 deletions contracts/v0.1/deploy/L1Endpoint/L1Endpoint.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ const func = async function (hre) {
args: [
deployConfig.registry,
deployConfig.vrfCoordinator,
deployConfig.requestResponseCoordinator
deployConfig.requestResponseCoordinator,
],
from: deployer,
log: true
log: true,
})

console.log('L1Endpoint:', l1Endpoint)
Expand Down
2 changes: 1 addition & 1 deletion contracts/v0.1/deploy/L2Endpoint/L2Endpoint.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const func = async function (hre) {
const l2EndpointDeployment = await deploy('L2Endpoint', {
args: [],
from: deployer,
log: true
log: true,
})

console.log('l2EndpointDeployment:', l2EndpointDeployment)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const func = async function (hre) {
const l2RequestResponseConsumerMock = await deploy('L2RequestResponseConsumerMock', {
args: [deployConfig.l2EndpointAddress],
from: deployer,
log: true
log: true,
})

console.log('L2RequestResponseConsumerMock:', l2RequestResponseConsumerMock)
Expand Down
2 changes: 1 addition & 1 deletion contracts/v0.1/deploy/L2VRFConsumerMock/L2VRFConsumer.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const func = async function (hre) {
const l2VRFConsumerMock = await deploy('L2VRFConsumerMock', {
args: [deployConfig.l2EndpointAddress],
from: deployer,
log: true
log: true,
})

console.log('L2VRFConsumerMock:', l2VRFConsumerMock)
Expand Down
18 changes: 9 additions & 9 deletions contracts/v0.1/deploy/POR/POR.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const {
validateAggregatorDeployConfig,
validateAggregatorChangeOraclesConfig,
validateAggregatorRedirectProxyConfig,
getFormattedDate
getFormattedDate,
} = require('../../scripts/utils.cjs')

const func = async function (hre) {
Expand Down Expand Up @@ -41,10 +41,10 @@ const func = async function (hre) {
deployConfig.timeout,
deployConfig.validator,
deployConfig.decimals,
deployConfig.description
deployConfig.description,
],
from: deployer,
log: true
log: true,
})
aggregator = await ethers.getContractAt('Aggregator', aggregatorDeployment.address)
}
Expand All @@ -68,7 +68,7 @@ const func = async function (hre) {
changeOraclesConfig.added,
changeOraclesConfig.minSubmissionCount,
changeOraclesConfig.maxSubmissionCount,
changeOraclesConfig.restartDelay
changeOraclesConfig.restartDelay,
)
).wait()
}
Expand Down Expand Up @@ -108,7 +108,7 @@ const func = async function (hre) {
expect(confirmedAggregator).to.be.eq(proposedAggregator)

console.log(
`Proxy POR address redirected from ${aggregatorAddress} to new ${confirmedAggregator}`
`Proxy POR address redirected from ${aggregatorAddress} to new ${confirmedAggregator}`,
)
} else if (redirectProxyConfig.status == 'revert') {
// Revert back to old POR contract address
Expand All @@ -120,7 +120,7 @@ const func = async function (hre) {
expect(revertedAggregator).to.be.eq(aggregatorAddress)

console.log(
`Proxy POR address reverted from ${proposedAggregator} to ${revertedAggregator}`
`Proxy POR address reverted from ${proposedAggregator} to ${revertedAggregator}`,
)
} else {
console.log('Wrong proxyRedirect method')
Expand All @@ -133,15 +133,15 @@ const func = async function (hre) {
contract: 'AggregatorProxy',
args: [aggregator.address],
from: deployer,
log: true
log: true,
})

// DataFeedConsumerMock
if (['localhost', 'hardhat'].includes(network.name)) {
await localhostDeployment({
deploy,
aggregatorProxyDeployment,
name: deployConfig.name
name: deployConfig.name,
})
}
}
Expand All @@ -160,7 +160,7 @@ async function localhostDeployment(args) {
contract: 'DataFeedConsumerMock',
args: [aggregatorProxyDeployment.address],
from: consumer,
log: true
log: true,
})
}

Expand Down
4 changes: 2 additions & 2 deletions contracts/v0.1/deploy/Prepayment/Prepayment.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const {
loadJson,
loadMigration,
updateMigration,
validatePrepaymentDeployConfig
validatePrepaymentDeployConfig,
} = require('../../scripts/utils.cjs')

const func = async function (hre) {
Expand Down Expand Up @@ -31,7 +31,7 @@ const func = async function (hre) {
const prepaymentDeployment = await deploy('Prepayment', {
args: [deployConfig.protocolFeeRecipient],
from: deployer,
log: true
log: true,
})
}

Expand Down
2 changes: 1 addition & 1 deletion contracts/v0.1/deploy/Registry/Registry.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const func = async function (hre) {
const registryDeployment = await deploy('Registry', {
args: [],
from: deployer,
log: true
log: true,
})

console.log('registeryDeployment:', registryDeployment)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const {
loadMigration,
updateMigration,
validateCoordinatorDeployConfig,
validateSetConfig
validateSetConfig,
} = require('../../scripts/utils.cjs')

const func = async function (hre) {
Expand Down Expand Up @@ -37,20 +37,20 @@ const func = async function (hre) {
contract: 'RequestResponseCoordinator',
args: [prepayment.address],
from: deployer,
log: true
log: true,
})

requestResponseCoordinator = await ethers.getContractAt(
'RequestResponseCoordinator',
requestResponseDeployment.address
requestResponseDeployment.address,
)

// RequestResponseConsumerMock
if (['localhost', 'hardhat'].includes(network.name)) {
await localhostDeployment({
deploy,
requestResponseCoordinator,
prepayment
prepayment,
})
}
}
Expand All @@ -59,7 +59,7 @@ const func = async function (hre) {
? requestResponseCoordinator
: await ethers.getContractAt(
'RequestResponseCoordinator',
config.requestResponseCoordinatorAddress
config.requestResponseCoordinatorAddress,
)

// Register Oracle //////////////////////////////////////////////////////////
Expand Down Expand Up @@ -94,7 +94,7 @@ const func = async function (hre) {
await requestResponseCoordinator.setConfig(
setConfig.maxGasLimit,
setConfig.gasAfterPaymentCalculation,
setConfig.feeConfig
setConfig.feeConfig,
)
).wait()
}
Expand All @@ -114,7 +114,7 @@ const func = async function (hre) {
const prepaymentDeployerSigner = await ethers.getContractAt(
'Prepayment',
prepayment.address,
deployer
deployer,
)
await (
await prepaymentDeployerSigner.addCoordinator(requestResponseCoordinatorAddress)
Expand All @@ -133,13 +133,13 @@ async function localhostDeployment(args) {
contract: 'RequestResponseConsumerMock',
args: [requestResponseCoordinator.address],
from: consumer,
log: true
log: true,
})

const prepaymentConsumerSigner = await ethers.getContractAt(
'Prepayment',
prepayment.address,
consumer
consumer,
)

// Create account
Expand Down
Loading

0 comments on commit b953f7c

Please sign in to comment.