Skip to content

Automation billing refactor #2311

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
133 changes: 131 additions & 2 deletions src/features/chainlink-automation/components/AutomationConfig.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @jsxImportSource preact */
import { ethers, BigNumber } from "ethers"
import { ChainlinkAutomationConfig } from "@features/chainlink-automation"
import { ChainlinkAutomationConfig, ChainlinkAutomationConfig_2_3 } from "@features/chainlink-automation"
import { Address } from "@components"

export const AutomationConfig = ({
Expand All @@ -21,7 +21,10 @@ export const AutomationConfig = ({
minUpkeepSpend,
maxPerformGas,
maxPerformDataSize,
fallbackGasPrice,
fallbackLinkPrice,
registrar,
latestVersion
} = config

return (
Expand Down Expand Up @@ -55,7 +58,7 @@ export const AutomationConfig = ({
)}
</tr>
<tr>
<td>Payment Premium %</td>
<td>Payment Premium % (LINK)</td>
{!paymentPremiumPPB ? <td /> : <td>{Math.round(parseInt(paymentPremiumPPB.toString(), 10) / 10000000)}</td>}
</tr>
<tr>
Expand Down Expand Up @@ -86,8 +89,134 @@ export const AutomationConfig = ({
<td>Minimum Upkeep Spend (LINK)</td>
{!minUpkeepSpend ? <td /> : <td>{ethers.utils.formatEther(BigNumber.from(minUpkeepSpend))}</td>}
</tr>
<tr>
<td>Fallback Gas Price</td>
{!fallbackGasPrice ? <td /> : <td>{ethers.utils.formatEther(BigNumber.from(fallbackGasPrice))}</td>}
</tr>
<tr>
<td>Fallback LINK Price</td>
{!fallbackLinkPrice ? <td /> : <td>{ethers.utils.formatEther(BigNumber.from(fallbackLinkPrice))}</td>}
</tr>
<tr>
<td>Latest Automation Version</td>
{!latestVersion ? <td /> : <td>{latestVersion.toLocaleString()}</td>}
</tr>
</tbody>
</table>
</div>
)
}

export const AutomationConfig2_3 = ({
config,
registryAddress,
getExplorerAddressUrl: getUrl,
}: {
config: ChainlinkAutomationConfig_2_3
registryAddress: string
getExplorerAddressUrl: (contractAddress: string) => string
}) => {
const {
gasFeePPBLink,
gasFeePPBNative,
maxCheckDataSize,
checkGasLimit,
gasCeilingMultiplier,
minSpendLink,
minSpendNative,
maxPerformGas,
maxPerformDataSize,
fallbackGasPrice,
fallbackLinkPrice,
fallbackNativePrice,
registrar,
latestVersion
} = config

return (
<div style={{ overflowX: "auto" }}>
<table style={{ display: "block", overflowX: "auto" }}>
<thead>
<tr>
<th>Item</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<tr>
<td>Registry Address</td>
{!registryAddress ? (
<td />
) : (
<td>
<Address contractUrl={getUrl(registryAddress)} />
</td>
)}
</tr>
<tr>
<td>Registrar Address</td>
{!registrar ? (
<td />
) : (
<td>
<Address contractUrl={getUrl(registrar)} />
</td>
)}
</tr>
<tr>
<td>Payment Premium % (LINK)</td>
{!gasFeePPBLink ? <td /> : <td>{Math.round(parseInt(gasFeePPBLink.toString(), 10) / 10000000)}</td>}
</tr>
<tr>
<td>Payment Premium % (Native)</td>
{!gasFeePPBNative ? <td /> : <td>{Math.round(parseInt(gasFeePPBNative.toString(), 10) / 10000000)}</td>}
</tr>
<tr>
<td>Maximum Check Data Size</td>
{!maxCheckDataSize ? <td /> : <td>{maxCheckDataSize.toLocaleString()}</td>}
</tr>
<tr>
<td>Check Gas Limit</td>
{!checkGasLimit ? <td /> : <td>{checkGasLimit.toLocaleString()}</td>}
</tr>
<tr>
<td>Perform Gas Limit</td>
{!maxPerformGas ? <td /> : <td>{maxPerformGas.toLocaleString()}</td>}
</tr>
<tr>
<td>Maximum Perform Data Size</td>
{!maxPerformDataSize ? <td /> : <td>{maxPerformDataSize.toLocaleString()}</td>}
</tr>
<tr>
<td>Fallback Gas Price</td>
{!fallbackGasPrice ? <td /> : <td>{ethers.utils.formatEther(BigNumber.from(fallbackGasPrice))}</td>}
</tr>
<tr>
<td>Fallback LINK Price</td>
{!fallbackLinkPrice ? <td /> : <td>{ethers.utils.formatEther(BigNumber.from(fallbackLinkPrice))}</td>}
</tr>
<tr>
<td>Fallback Native Price</td>
{!fallbackNativePrice ? <td /> : <td>{ethers.utils.formatEther(BigNumber.from(fallbackNativePrice))}</td>}
</tr>
<tr>
<td>Gas Ceiling Multiplier</td>
{!gasCeilingMultiplier ? <td /> : <td>{gasCeilingMultiplier.toLocaleString()}</td>}
</tr>
<tr>
<td>Minimum Upkeep Spend (LINK)</td>
{!minSpendLink ? <td /> : <td>{ethers.utils.formatEther(BigNumber.from(minSpendLink))}</td>}
</tr>
<tr>
<td>Minimum Upkeep Spend (Native)</td>
{!minSpendNative ? <td /> : <td>{ethers.utils.formatEther(BigNumber.from(minSpendNative))}</td>}
</tr>
<tr>
<td>Latest Automation Version</td>
{!latestVersion ? <td /> : <td>{latestVersion.toLocaleString()}</td>}
</tr>
</tbody>
</table>
</div>
)
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @jsxImportSource preact */
import { AutomationConfig, chainlinkAutomationConfig, automationAddresses } from "@features/chainlink-automation"
import { AutomationConfig, AutomationConfig2_3, chainlinkAutomationConfig, automationAddresses } from "@features/chainlink-automation"
import { SupportedChain, SupportedTechnology } from "@config"
import { getTitle, getExplorer, getExplorerAddressUrl, normalizeConfig } from "@features/utils"
import { FunctionComponent } from "preact"
Expand Down Expand Up @@ -95,7 +95,7 @@ export const AutomationConfigList = () => {
updateTOC={false}
key={supportedChain}
>
{title === "Fantom mainnet" || title === "Fantom testnet" ? (
{title === "Fantom" || title === "Fantom Testnet" ? (
<>
<TemporaryNote title="New Fantom upkeeps not supported">
Creating new Fantom upkeeps is no longer supported. Existing Fantom upkeeps are still supported.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"SCROLL_MAINNET": {
"gasFeePPBLink": 560000000,
"gasFeePPBNative": 560000000,
"maxCheckDataSize": 5000,
"checkGasLimit": 10000000,
"gasCeilingMultiplier": 2,
"minUpkeepSpend": {
"type": "BigNumber",
"hex": "0x16bcc41e90000"
},
"maxPerformGas": 5000000,
"fallbackGasPrice": {
"type": "BigNumber",
"hex": "12a05f200"
},
"fallbackLinkPrice": {
"type": "BigNumber",
"hex": "44728f8c"
},
"fallbackNativePrice": {
"type": "BigNumber",
"hex": "44728f8c"
},
"maxPerformDataSize": 5000,
"stalenessSeconds": 360000,
"registrar": "0x80C55e674a34FfE730B0357E16e8852B19573f7C",
"latestVersion": "2.3"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
{
"SCROLL_MAINNET": {
"paymentPremiumPPB": 560000000,
"blockCountPerTurn": "Not Applicable",
"maxCheckDataSize": 5000,
"checkGasLimit": 10000000,
"gasCeilingMultiplier": 2,
"minUpkeepSpend": {
"type": "BigNumber",
"hex": "0x16bcc41e90000"
},
"maxPerformGas": 5000000,
"fallbackGasPrice": {
"type": "BigNumber",
"hex": "12a05f200"
},
"fallbackLinkPrice": {
"type": "BigNumber",
"hex": "44728f8c"
},
"maxPerformDataSize": 5000,
"flatFeeMicroLink": 10000,
"stalenessSeconds": 360000,
"registrar": "0x80C55e674a34FfE730B0357E16e8852B19573f7C",
"transcoder": "0x0000000000000000000000000000000000000000",
"latestVersion": "2.3"
},
"SCROLL_SEPOLIA": {
"paymentPremiumPPB": 500000000,
"blockCountPerTurn": "Not Applicable",
"maxCheckDataSize": 5000,
"checkGasLimit": 10000000,
"gasCeilingMultiplier": 2,
"minUpkeepSpend": {
"type": "BigNumber",
"hex": "0x016345785d8a0000"
},
"maxPerformGas": 5000000,
"fallbackGasPrice": {
"type": "BigNumber",
"hex": "5f5e100"
},
"fallbackLinkPrice": {
"type": "BigNumber",
"hex": "4343e8e0"
},
"maxPerformDataSize": 5000,
"flatFeeMicroLink": 10000,
"stalenessSeconds": 360000,
"registrar": "0x8ee44ab698169a0AcA2571834b19a02d09D818d5",
"transcoder": "0x0000000000000000000000000000000000000000",
"latestVersion": "2.3"
},
"POLYGON_ZKEVM_MAINNET": {
"paymentPremiumPPB": 560000000,
"blockCountPerTurn": "Not Applicable",
"maxCheckDataSize": 5000,
"checkGasLimit": 10000000,
"gasCeilingMultiplier": 2,
"minUpkeepSpend": {
"type": "BigNumber",
"hex": "0x16bcc41e90000"
},
"maxPerformGas": 5000000,
"fallbackGasPrice": {
"type": "BigNumber",
"hex": "2540be400"
},
"fallbackLinkPrice": {
"type": "BigNumber",
"hex": "44728f8c"
},
"maxPerformDataSize": 5000,
"flatFeeMicroLink": 10000,
"stalenessSeconds": 360000,
"registrar": "0x703C1d261a996755409c74d00871e7D6Af4d9896",
"transcoder": "0x0000000000000000000000000000000000000000",
"latestVersion": "2.3"
},
"POLYGON_ZKEVM_CARDONA": {
"paymentPremiumPPB": 500000000,
"blockCountPerTurn": "Not Applicable",
"maxCheckDataSize": 5000,
"checkGasLimit": 10000000,
"gasCeilingMultiplier": 2,
"minUpkeepSpend": {
"type": "BigNumber",
"hex": "0x16bcc41e90000"
},
"maxPerformGas": 5000000,
"fallbackGasPrice": {
"type": "BigNumber",
"hex": "5f5e100"
},
"fallbackLinkPrice": {
"type": "BigNumber",
"hex": "4343e8e0"
},
"maxPerformDataSize": 5000,
"flatFeeMicroLink": 10000,
"stalenessSeconds": 360000,
"registrar": "0x703C1d261a996755409c74d00871e7D6Af4d9896",
"transcoder": "0x0000000000000000000000000000000000000000",
"latestVersion": "2.3"
},
"ZKSYNC_MAINNET": {
"paymentPremiumPPB": 500000000,
"blockCountPerTurn": "Not Applicable",
"maxCheckDataSize": 5000,
"checkGasLimit": 10000000,
"gasCeilingMultiplier": 2,
"minUpkeepSpend": {
"type": "BigNumber",
"hex": "0x16bcc41e90000"
},
"maxPerformGas": 5000000,
"fallbackGasPrice": {
"type": "BigNumber",
"hex": "7270e00"
},
"fallbackLinkPrice": {
"type": "BigNumber",
"hex": "44728f8c"
},
"maxPerformDataSize": 5000,
"flatFeeMicroLink": 10000,
"stalenessSeconds": 360000,
"registrar": "0x7415C4E9758F3cA26F1a4a8F11d885eadEF68939",
"transcoder": "0x0000000000000000000000000000000000000000",
"latestVersion": "2.3"
},
"ZKSYNC_SEPOLIA": {
"paymentPremiumPPB": 300000000,
"blockCountPerTurn": "Not Applicable",
"maxCheckDataSize": 5000,
"checkGasLimit": 10000000,
"gasCeilingMultiplier": 2,
"minUpkeepSpend": {
"type": "BigNumber",
"hex": "0x16bcc41e90000"
},
"maxPerformGas": 5000000,
"fallbackGasPrice": {
"type": "BigNumber",
"hex": "17d7840"
},
"fallbackLinkPrice": {
"type": "BigNumber",
"hex": "4343e8e0"
},
"maxPerformDataSize": 5000,
"flatFeeMicroLink": 10000,
"stalenessSeconds": 360000,
"registrar": "0xC23751714a66B9824Fa6724A7B08635D480e88cD",
"transcoder": "0x0000000000000000000000000000000000000000",
"latestVersion": "2.3"
}
}
Loading
Loading