Skip to content
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

feat: support non-18 decimals chains #75

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
4 changes: 2 additions & 2 deletions src/createRollupPrepareTransactionRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ export async function createRollupPrepareTransactionRequest({
}

// custom fee token is only allowed to have 18 decimals
if ((await fetchDecimals({ address: params.nativeToken, publicClient })) !== 18) {
if ((await fetchDecimals({ address: params.nativeToken, publicClient })) > 36) {
throw new Error(
`"params.nativeToken" can only be configured with a token that uses 18 decimals.`,
`"params.nativeToken" can only be configured with a token that uses 36 decimals or less.`,
);
}
}
Expand Down
32 changes: 16 additions & 16 deletions src/generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/**
* [__View Contract on Arbitrum Sepolia Blockscout__](https://sepolia-explorer.arbitrum.io/address/0x000000000000000000000000000000000000006c)
* [__View Contract on Arbitrum Sepolia Arbiscan__](https://sepolia.arbiscan.io/address/0x000000000000000000000000000000000000006c)
*/
export const arbGasInfoABI = [
{
Expand Down Expand Up @@ -154,14 +154,14 @@ export const arbGasInfoABI = [
] as const;

/**
* [__View Contract on Arbitrum Sepolia Blockscout__](https://sepolia-explorer.arbitrum.io/address/0x000000000000000000000000000000000000006c)
* [__View Contract on Arbitrum Sepolia Arbiscan__](https://sepolia.arbiscan.io/address/0x000000000000000000000000000000000000006c)
*/
export const arbGasInfoAddress = {
421614: '0x000000000000000000000000000000000000006C',
} as const;

/**
* [__View Contract on Arbitrum Sepolia Blockscout__](https://sepolia-explorer.arbitrum.io/address/0x000000000000000000000000000000000000006c)
* [__View Contract on Arbitrum Sepolia Arbiscan__](https://sepolia.arbiscan.io/address/0x000000000000000000000000000000000000006c)
*/
export const arbGasInfoConfig = { address: arbGasInfoAddress, abi: arbGasInfoABI } as const;

Expand All @@ -170,7 +170,7 @@ export const arbGasInfoConfig = { address: arbGasInfoAddress, abi: arbGasInfoABI
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/**
* [__View Contract on Arbitrum Sepolia Blockscout__](https://sepolia-explorer.arbitrum.io/address/0x0000000000000000000000000000000000000070)
* [__View Contract on Arbitrum Sepolia Arbiscan__](https://sepolia.arbiscan.io/address/0x0000000000000000000000000000000000000070)
*/
export const arbOwnerABI = [
{
Expand Down Expand Up @@ -357,14 +357,14 @@ export const arbOwnerABI = [
] as const;

/**
* [__View Contract on Arbitrum Sepolia Blockscout__](https://sepolia-explorer.arbitrum.io/address/0x0000000000000000000000000000000000000070)
* [__View Contract on Arbitrum Sepolia Arbiscan__](https://sepolia.arbiscan.io/address/0x0000000000000000000000000000000000000070)
*/
export const arbOwnerAddress = {
421614: '0x0000000000000000000000000000000000000070',
} as const;

/**
* [__View Contract on Arbitrum Sepolia Blockscout__](https://sepolia-explorer.arbitrum.io/address/0x0000000000000000000000000000000000000070)
* [__View Contract on Arbitrum Sepolia Arbiscan__](https://sepolia.arbiscan.io/address/0x0000000000000000000000000000000000000070)
*/
export const arbOwnerConfig = { address: arbOwnerAddress, abi: arbOwnerABI } as const;

Expand All @@ -373,7 +373,7 @@ export const arbOwnerConfig = { address: arbOwnerAddress, abi: arbOwnerABI } as
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/**
* [__View Contract on Arbitrum Sepolia Blockscout__](https://sepolia-explorer.arbitrum.io/address/0x000000000000000000000000000000000000006b)
* [__View Contract on Arbitrum Sepolia Arbiscan__](https://sepolia.arbiscan.io/address/0x000000000000000000000000000000000000006b)
*/
export const arbOwnerPublicABI = [
{
Expand Down Expand Up @@ -407,14 +407,14 @@ export const arbOwnerPublicABI = [
] as const;

/**
* [__View Contract on Arbitrum Sepolia Blockscout__](https://sepolia-explorer.arbitrum.io/address/0x000000000000000000000000000000000000006b)
* [__View Contract on Arbitrum Sepolia Arbiscan__](https://sepolia.arbiscan.io/address/0x000000000000000000000000000000000000006b)
*/
export const arbOwnerPublicAddress = {
421614: '0x000000000000000000000000000000000000006b',
} as const;

/**
* [__View Contract on Arbitrum Sepolia Blockscout__](https://sepolia-explorer.arbitrum.io/address/0x000000000000000000000000000000000000006b)
* [__View Contract on Arbitrum Sepolia Arbiscan__](https://sepolia.arbiscan.io/address/0x000000000000000000000000000000000000006b)
*/
export const arbOwnerPublicConfig = {
address: arbOwnerPublicAddress,
Expand Down Expand Up @@ -552,7 +552,7 @@ export const erc20ABI = [
* -
* - [__View Contract on Arbitrum One Arbiscan__](https://arbiscan.io/address/0x9CAd81628aB7D8e239F1A5B497313341578c5F71)
* - [__View Contract on Arbitrum Nova Arbiscan__](https://nova.arbiscan.io/address/0x9CAd81628aB7D8e239F1A5B497313341578c5F71)
* - [__View Contract on Arbitrum Sepolia Blockscout__](https://sepolia-explorer.arbitrum.io/address/0x06E341073b2749e0Bb9912461351f716DeCDa9b0)
* - [__View Contract on Arbitrum Sepolia Arbiscan__](https://sepolia.arbiscan.io/address/0x8D51a43c1915d96B49A96f6a4369FF1e270ae16E)
* - [__View Contract on Sepolia Etherscan__](https://sepolia.etherscan.io/address/0xfbd0b034e6305788007f6e0123cc5eae701a5751)
*/
export const rollupCreatorABI = [
Expand Down Expand Up @@ -749,7 +749,7 @@ export const rollupCreatorABI = [
* -
* - [__View Contract on Arbitrum One Arbiscan__](https://arbiscan.io/address/0x9CAd81628aB7D8e239F1A5B497313341578c5F71)
* - [__View Contract on Arbitrum Nova Arbiscan__](https://nova.arbiscan.io/address/0x9CAd81628aB7D8e239F1A5B497313341578c5F71)
* - [__View Contract on Arbitrum Sepolia Blockscout__](https://sepolia-explorer.arbitrum.io/address/0x06E341073b2749e0Bb9912461351f716DeCDa9b0)
* - [__View Contract on Arbitrum Sepolia Arbiscan__](https://sepolia.arbiscan.io/address/0x8D51a43c1915d96B49A96f6a4369FF1e270ae16E)
* - [__View Contract on Sepolia Etherscan__](https://sepolia.etherscan.io/address/0xfbd0b034e6305788007f6e0123cc5eae701a5751)
*/
export const rollupCreatorAddress = {
Expand All @@ -760,7 +760,7 @@ export const rollupCreatorAddress = {
42170: '0x9CAd81628aB7D8e239F1A5B497313341578c5F71',
333333: '0x0000000000000000000000000000000000000000',
412346: '0x3BaF9f08bAD68869eEdEa90F2Cc546Bd80F1A651',
421614: '0x06E341073b2749e0Bb9912461351f716DeCDa9b0',
421614: '0x8D51a43c1915d96B49A96f6a4369FF1e270ae16E',
11155111: '0xfBD0B034e6305788007f6e0123cc5EaE701a5751',
} as const;

Expand All @@ -770,7 +770,7 @@ export const rollupCreatorAddress = {
* -
* - [__View Contract on Arbitrum One Arbiscan__](https://arbiscan.io/address/0x9CAd81628aB7D8e239F1A5B497313341578c5F71)
* - [__View Contract on Arbitrum Nova Arbiscan__](https://nova.arbiscan.io/address/0x9CAd81628aB7D8e239F1A5B497313341578c5F71)
* - [__View Contract on Arbitrum Sepolia Blockscout__](https://sepolia-explorer.arbitrum.io/address/0x06E341073b2749e0Bb9912461351f716DeCDa9b0)
* - [__View Contract on Arbitrum Sepolia Arbiscan__](https://sepolia.arbiscan.io/address/0x8D51a43c1915d96B49A96f6a4369FF1e270ae16E)
* - [__View Contract on Sepolia Etherscan__](https://sepolia.etherscan.io/address/0xfbd0b034e6305788007f6e0123cc5eae701a5751)
*/
export const rollupCreatorConfig = {
Expand All @@ -788,7 +788,7 @@ export const rollupCreatorConfig = {
* -
* - [__View Contract on Arbitrum One Arbiscan__](https://arbiscan.io/address/0x2f5624dc8800dfA0A82AC03509Ef8bb8E7Ac000e)
* - [__View Contract on Arbitrum Nova Arbiscan__](https://nova.arbiscan.io/address/0x8B9D9490a68B1F16ac8A21DdAE5Fd7aB9d708c14)
* - [__View Contract on Arbitrum Sepolia Blockscout__](https://sepolia-explorer.arbitrum.io/address/0x56C486D3786fA26cc61473C499A36Eb9CC1FbD8E)
* - [__View Contract on Arbitrum Sepolia Arbiscan__](https://sepolia.arbiscan.io/address/0x56C486D3786fA26cc61473C499A36Eb9CC1FbD8E)
* - [__View Contract on Sepolia Etherscan__](https://sepolia.etherscan.io/address/0x7edb2dfBeEf9417e0454A80c51EE0C034e45a570)
*/
export const tokenBridgeCreatorABI = [
Expand Down Expand Up @@ -832,7 +832,7 @@ export const tokenBridgeCreatorABI = [
* -
* - [__View Contract on Arbitrum One Arbiscan__](https://arbiscan.io/address/0x2f5624dc8800dfA0A82AC03509Ef8bb8E7Ac000e)
* - [__View Contract on Arbitrum Nova Arbiscan__](https://nova.arbiscan.io/address/0x8B9D9490a68B1F16ac8A21DdAE5Fd7aB9d708c14)
* - [__View Contract on Arbitrum Sepolia Blockscout__](https://sepolia-explorer.arbitrum.io/address/0x56C486D3786fA26cc61473C499A36Eb9CC1FbD8E)
* - [__View Contract on Arbitrum Sepolia Arbiscan__](https://sepolia.arbiscan.io/address/0x56C486D3786fA26cc61473C499A36Eb9CC1FbD8E)
* - [__View Contract on Sepolia Etherscan__](https://sepolia.etherscan.io/address/0x7edb2dfBeEf9417e0454A80c51EE0C034e45a570)
*/
export const tokenBridgeCreatorAddress = {
Expand All @@ -853,7 +853,7 @@ export const tokenBridgeCreatorAddress = {
* -
* - [__View Contract on Arbitrum One Arbiscan__](https://arbiscan.io/address/0x2f5624dc8800dfA0A82AC03509Ef8bb8E7Ac000e)
* - [__View Contract on Arbitrum Nova Arbiscan__](https://nova.arbiscan.io/address/0x8B9D9490a68B1F16ac8A21DdAE5Fd7aB9d708c14)
* - [__View Contract on Arbitrum Sepolia Blockscout__](https://sepolia-explorer.arbitrum.io/address/0x56C486D3786fA26cc61473C499A36Eb9CC1FbD8E)
* - [__View Contract on Arbitrum Sepolia Arbiscan__](https://sepolia.arbiscan.io/address/0x56C486D3786fA26cc61473C499A36Eb9CC1FbD8E)
* - [__View Contract on Sepolia Etherscan__](https://sepolia.etherscan.io/address/0x7edb2dfBeEf9417e0454A80c51EE0C034e45a570)
*/
export const tokenBridgeCreatorConfig = {
Expand Down
2 changes: 1 addition & 1 deletion wagmi.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ const contracts: ContractConfig[] = [
// testnet
[sepolia.id]: '0xfbd0b034e6305788007f6e0123cc5eae701a5751',
[holesky.id]: '0xB512078282F462Ba104231ad856464Ceb0a7747e',
[arbitrumSepolia.id]: '0x06E341073b2749e0Bb9912461351f716DeCDa9b0',
[arbitrumSepolia.id]: '0x8D51a43c1915d96B49A96f6a4369FF1e270ae16E',
// local nitro-testnode (on "release" branch with --tokenbridge --l3node --l3-token-bridge flags)
[nitroTestnodeL1.id]: '0x596eabe0291d4cdafac7ef53d16c92bf6922b5e0',
[nitroTestnodeL2.id]: '0x3BaF9f08bAD68869eEdEa90F2Cc546Bd80F1A651',
Expand Down
Loading