Skip to content

Conversation

@shunkakinoki
Copy link
Contributor

Polygon chain has alias for https://polygonscan.com/address/0x0000000000000000000000000000000000001010 as the native token address, (bytecode doesn't exist, but is a precompile for erc20 compatibility)

Copilot AI review requested due to automatic review settings January 26, 2026 14:49
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds support for recognizing Polygon's native token precompile address (0x0000000000000000000000000000000000001010) as a native token address in the IsNativeTokenAddress() method. This address is a Polygon-specific precompile that provides ERC20 compatibility for native token transfers without bytecode.

Changes:

  • Added Polygon native token address check to IsNativeTokenAddress() function in lib/prototyp/hash.go

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

h == "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE" ||
h == "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
h == "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee" ||
h == "0x0000000000000000000000000000000000001010"
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

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

Indentation is inconsistent with the rest of the function. The previous lines use a single tab character for indentation, but this line uses spaces. Change the leading whitespace to use a single tab character to match lines 144-146.

Suggested change
h == "0x0000000000000000000000000000000000001010"
h == "0x0000000000000000000000000000000000001010"

Copilot uses AI. Check for mistakes.
h == "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE" ||
h == "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
h == "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee" ||
h == "0x0000000000000000000000000000000000001010"
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

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

The new Polygon native token address check lacks test coverage. The lib/prototyp package has comprehensive test coverage for other functions (e.g., bigint_test.go has 242 lines, hash_test.go exists with tests for other Hash methods), but IsNativeTokenAddress has no tests. Add test cases that verify all four native token addresses are correctly recognized, including the newly added Polygon address 0x0000000000000000000000000000000000001010.

Copilot uses AI. Check for mistakes.
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.

2 participants