Skip to content

feat: added config for h contract deployment#331

Open
yashvanthbl137-crypto wants to merge 2 commits intomasterfrom
CGARD-454-add-h-config
Open

feat: added config for h contract deployment#331
yashvanthbl137-crypto wants to merge 2 commits intomasterfrom
CGARD-454-add-h-config

Conversation

@yashvanthbl137-crypto
Copy link
Contributor

added config for h contract deployment (hardhat, chainIds, chainConfig, GitHub workflows).

Humanity Protocol (H)

Deployed on local pointing to Humanity Protocol Testnet (th, chain 7080969):

{
  "walletImplementation": "0x2178dA1b5e53340b49a29E420D9BFB647D6E1ef2",
  "walletFactory": "0x17369D73DA373DA6e46478ff49703b0A3FBF804C",
  "forwarderImplementation": "0x57F40EBFA83Ef50281c16360c931ccab3D280942",
  "forwarderFactory": "0xBD578c7EA545Eb8874d48EB6F46f2E54F9B4df7a"
}
{
  "batcher": "0x0496cbF96E3472D64366c87bd51cf278d21867b6"
}

All five contracts verified on humanity-testnet.explorer.alchemy.com.

Special Configuration:

  • Chain IDs: H (6985385), H_TESTNET (7080969)
  • RPC: Alchemy public endpoints
  • Explorer: Blockscout-based
  • Gas: Custom handling for Arbitrum Orbit chain gas estimation issues
    • Uses deploymentGasOverrides to bypass 100B estimation limit
    • Actual deployment uses reasonable 30M gas limit
    • Enables deployment with minimal funding (~0.05 H)

Ticket: CGARD-454

@yashvanthbl137-crypto
Copy link
Contributor Author

Screenshot 2026-03-16 at 2 20 37 PM Screenshot 2026-03-16 at 2 21 04 PM

Comment on lines +160 to +172
// Humanity: Skip balance check due to unreliable gas estimation
const skipBalanceCheck =
Number(chainId) === 6985385 || Number(chainId) === 7080969;

if (skipBalanceCheck) {
console.log('⚠️ Skipping balance check for Humanity');
console.log(' Estimated deployment cost: ~0.01-0.02 H');
} else {
await checkSufficientBalance(
deployerAddress,
estimatedCost,
'all V4 contracts'
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it unreliable? Can you add some details? Removing gas estimation like this is not ideal.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Copy link
Contributor Author

@yashvanthbl137-crypto yashvanthbl137-crypto Mar 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

During local testing on Humanity testnet, estimateGas() consistently failed with "contract creation code storage out of gas". However, when we bypassed estimation and used explicit gas parameters (30M gas limit, 2 Gwei), the actual deployments succeeded.

solution:

chainConfig.ts (line 347): Set gasLimit: 100B to bypass the estimation check (deploy.ts line 58: gasLimit > 10B)
deploy.ts (lines 35-39): Override with realistic values before deployment: 30M gas limit, 2 Gwei maxFee
Skip balance check since it would calculate based on the 100B placeholder
Precedent: This follows the same pattern as Mantle (chainConfig.ts lines 161-170), which also uses gasLimit: 100B for similar issues.

script: |
const tag = process.env.GITHUB_REF_NAME;
const regex = /v.*\-(eth|hteth|matic|tmatic|bsc|tbsc|arbeth|tarbeth|opeth|topeth|zketh|tzketh|baseeth|tbaseeth|bera|tbera|tavaxc|avaxc|toas|oas|tcoredao|coredao|tflr|flr|tsgb|sgb|txdc|xdc|twemix|wemix|tmon|mon|tstt|stt|tsoneium|soneium|world|tworld|tctc|ctc|tapechain|apechain|tphrs|phrs|thypeevm|hypeevm|tsonic|sonic|seievm|tseievm|kaia|tkaia|irys|tirys|tlineaeth|lineaeth|ip|tip|plasma|tplasma|kavaevm|tkavaevm|plume|tplume|zksyncera|tzksyncera|tog|og|flow|tflow|megaeth|tmegaeth|hbarevm|thbarevm|fluenteth|tfluenteth|mantle|tmantle|dogeos|tdogeos|opBNB|topBNB|jovayeth|tjovayeth|okb|tokb|ftm|morpheth|tmorpheth|arcusdc|tarcusdc|chiliz|tchiliz|unichain|tunichain|hpp|thpp|hoodeth|thoodeth)$/;
const regex = /v.*\-(eth|hteth|matic|tmatic|bsc|tbsc|arbeth|tarbeth|opeth|topeth|zketh|tzketh|baseeth|tbaseeth|bera|tbera|tavaxc|avaxc|toas|oas|tcoredao|coredao|tflr|flr|tsgb|sgb|txdc|xdc|twemix|wemix|tmon|mon|tstt|stt|tsoneium|soneium|world|tworld|tctc|ctc|tapechain|apechain|tphrs|phrs|thypeevm|hypeevm|tsonic|sonic|seievm|tseievm|kaia|tkaia|irys|tirys|tlineaeth|lineaeth|ip|tip|plasma|tplasma|kavaevm|tkavaevm|plume|tplume|zksyncera|tzksyncera|tog|og|flow|tflow|megaeth|tmegaeth|hbarevm|thbarevm|fluenteth|tfluenteth|mantle|tmantle|dogeos|tdogeos|opBNB|topBNB|jovayeth|tjovayeth|okb|tokb|ftm|morpheth|tmorpheth|arcusdc|tarcusdc|chiliz|tchiliz|unichain|tunichain|hpp|thpp|h|th|hoodeth|thoodeth)$/;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

h as a regex matcher with no strict start and end? wow, that's a heck of a regex. i wonder what else it be matching? based on the current list it will probably match 10 other symbols.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants