Skip to content

Commit

Permalink
fix(pg): Drop support for OKTC
Browse files Browse the repository at this point in the history
  • Loading branch information
RPate97 committed Mar 22, 2024
1 parent 7707f87 commit c8e5320
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 51 deletions.
6 changes: 6 additions & 0 deletions .changeset/tidy-seas-travel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@sphinx-labs/contracts': patch
'@sphinx-labs/plugins': patch
---

Drop support for OKTC
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ Please feel free to reach out to us in our [Discord](https://discord.gg/7Gc3DK33
- Fuse
- Evmos
- Kava
- OKT Chain
- Rootstock
- Blast

Expand Down
27 changes: 10 additions & 17 deletions packages/contracts/contracts/foundry/SphinxConstants.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ contract SphinxConstants {
address public constant safeSingletonAddress = 0xd9Db270c1B5E3Bd161E8c8503c55cEABeE709552;
address public constant sphinxModuleImplAddress = 0x8f4E4d51B8050B0ff713eff1F88f3dD8b5e8a530;

uint8 internal constant numSupportedNetworks = 44;
uint8 internal constant numSupportedNetworks = 43;

function getNetworkInfoArray() public pure returns (NetworkInfo[] memory) {
NetworkInfo[] memory all = new NetworkInfo[](numSupportedNetworks);
Expand Down Expand Up @@ -217,66 +217,60 @@ contract SphinxConstants {
networkType: NetworkType.Testnet
});
all[33] = NetworkInfo({
network: Network.oktc,
name: "oktc",
chainId: 66,
networkType: NetworkType.Mainnet
});
all[34] = NetworkInfo({
network: Network.scroll,
name: "scroll",
chainId: 534352,
networkType: NetworkType.Mainnet
});
all[35] = NetworkInfo({
all[34] = NetworkInfo({
network: Network.scroll_sepolia,
name: "scroll_sepolia",
chainId: 534351,
networkType: NetworkType.Testnet
});
all[36] = NetworkInfo({
all[35] = NetworkInfo({
network: Network.rootstock,
name: "rootstock",
chainId: 30,
networkType: NetworkType.Mainnet
});
all[37] = NetworkInfo({
all[36] = NetworkInfo({
network: Network.rootstock_testnet,
name: "rootstock_testnet",
chainId: 31,
networkType: NetworkType.Testnet
});
all[38] = NetworkInfo({
all[37] = NetworkInfo({
network: Network.zora,
name: "zora",
chainId: 7777777,
networkType: NetworkType.Mainnet
});
all[39] = NetworkInfo({
all[38] = NetworkInfo({
network: Network.zora_sepolia,
name: "zora_sepolia",
chainId: 999999999,
networkType: NetworkType.Testnet
});
all[40] = NetworkInfo({
all[39] = NetworkInfo({
network: Network.rari,
name: "rari",
chainId: 1380012617,
networkType: NetworkType.Mainnet
});
all[41] = NetworkInfo({
all[40] = NetworkInfo({
network: Network.rari_sepolia,
name: "rari_sepolia",
chainId: 1918988905,
networkType: NetworkType.Testnet
});
all[42] = NetworkInfo({
all[41] = NetworkInfo({
network: Network.blast_sepolia,
name: "blast_sepolia",
chainId: 168587773,
networkType: NetworkType.Testnet
});
all[43] = NetworkInfo({
all[42] = NetworkInfo({
network: Network.blast,
name: "blast",
chainId: 81457,
Expand Down Expand Up @@ -320,7 +314,6 @@ enum Network {
evmos_testnet,
kava,
kava_testnet,
oktc,
scroll,
scroll_sepolia,
rootstock,
Expand Down
18 changes: 0 additions & 18 deletions packages/contracts/src/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -918,24 +918,6 @@ export const SPHINX_NETWORKS: Array<SupportedNetwork> = [
useHigherMaxGasLimit: false,
eip2028: true,
},
{
name: 'oktc',
displayName: 'OKT Chain',
chainId: BigInt(66),
rpcUrl: () => process.env.OKTC_RPC_URL!,
blockexplorers: {},
currency: 'OKT',
dripSize: '1',
requiredEnvVariables: ['OKTC_RPC_URL'],
dripVersion: 3,
queryFilterBlockLimit: 500,
networkType: 'Mainnet',
legacyTx: true,
decimals: 18,
actionGasLimitBuffer: false,
useHigherMaxGasLimit: false,
eip2028: true,
},
{
name: 'scroll',
displayName: 'Scroll',
Expand Down
14 changes: 1 addition & 13 deletions packages/core/src/provider.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { JsonRpcProvider, TransactionRequest } from 'ethers'
import { JsonRpcProvider } from 'ethers'

export class SphinxJsonRpcProvider extends JsonRpcProvider {
constructor(url: string) {
Expand All @@ -12,16 +12,4 @@ export class SphinxJsonRpcProvider extends JsonRpcProvider {
cacheTimeout: -1,
})
}

// On OKT Chain, they appear to be running an out of date geth client which is not compatible with the current spec.
// For shame!
// See this issue for more info: https://github.com/NomicFoundation/hardhat/issues/4010
// So on OKT Chain we have to call eth_estimateGas ourselves to handle this....
estimateGas(_tx: TransactionRequest): Promise<bigint> {
if (_tx.chainId === 66) {
return this.send('eth_estimateGas', [_tx])
}

return super.estimateGas(_tx)
}
}
1 change: 0 additions & 1 deletion packages/core/test/convert.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ describe('Convert EthersJS Objects', () => {
9000: '0x2c2dee1b3fd4ec4917d6d7e92c99bc3dc09aaed0b611a165fa94fd522c243c14',
2222: '0xa141b7450032c794aa3d82a9f33e607d3d4f0d2da7112cd909a876d7f827a489',
2221: '0x178c0c2bff2f5cffa0bb592102d364ca822047580f95f44dfedd49dd6f840d46',
66: '0xf8611d9eccf87c6c42210debc1dda312b581df0338e53cd18c3accb93aac3fcb',
534352:
'0xe559cd3f406619335cd1f50a5ad8cab16b59f5e252823039e299a7f7f4547a18',
534351:
Expand Down
1 change: 0 additions & 1 deletion packages/plugins/foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ rootstock = "${ROOTSTOCK_RPC_URL}"
rootstock_testnet = "${ROOTSTOCK_TESTNET_RPC_URL}"
kava = "${KAVA_RPC_URL}"
kava_testnet = "${KAVA_TESTNET_RPC_URL}"
oktc = "${OKTC_RPC_URL}"
scroll = "${SCROLL_RPC_URL}"
moonriver = "${MOONRIVER_RPC_URL}"
gnosis_chiado = "${GNOSIS_CHIADO_RPC_URL}"
Expand Down

0 comments on commit c8e5320

Please sign in to comment.