tokamak-network / tokamak-thanos

MIT License
7 stars 3 forks source link

Change the bridges function's visibility to external #231

Closed Zena-park closed 2 weeks ago

Zena-park commented 2 weeks ago

Since the bridges function has no internal calls, it is appropriate to modify public to external.

 function bridgeETH(uint256 _amount, uint32 _minGasLimit, bytes calldata _extraData) external payable onlyEOA { 
function bridgeETHTo(address _to, uint256 _amount, uint32 _minGasLimit, bytes calldata _extraData) external payable {
function bridgeERC20(
        address _localToken,
        address _remoteToken,
        uint256 _amount,
        uint32 _minGasLimit,
        bytes calldata _extraData
    )
        external
        onlyEOA
    {
 function bridgeERC20To(
        address _localToken,
        address _remoteToken,
        address _to,
        uint256 _amount,
        uint32 _minGasLimit,
        bytes calldata _extraData
    )
        external
    {
nguyenzung commented 2 weeks ago

Hi @Zena-park

I think we should keep it. There are 2 reasons

Zena-park commented 2 weeks ago

I don't think there will be much difference in gas.

However, I think it is better to use external when using it only in external calls according to the basic grammar.

Anyway, it is just a difference of opinion, not an error, so I will close the issue.