ccip icon indicating copy to clipboard operation
ccip copied to clipboard

getRouter func should be virtual

Open magiconch opened this issue 1 year ago • 3 comments

Motivation

CCIPReceiver Contract is an abstract contract, the getRouter function should be virtual.

Solution

function getRouter() public; => function getRouter() public virtual;

magiconch avatar Feb 26 '24 12:02 magiconch

Hi magiconch, can you explain the use-case so I better understand your proposed change?

makramkd avatar Feb 28 '24 14:02 makramkd

yep. This is my case. i can't override getRouter function because the CCIPReceiver Contract is an abstract contract

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

contract Ballot is CCIPReceiver {
    address public newRouter = address(0);
    constructor(address router) CCIPReceiver(router) {
    }

    function getRouter() public override view returns (address) {
        return newRouter;
    }

}

magiconch avatar Mar 03 '24 02:03 magiconch

Hi @makramkd , any feedback about this pr?

magiconch avatar Mar 26 '24 05:03 magiconch

This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar May 26 '24 00:05 github-actions[bot]

fixed in https://github.com/smartcontractkit/ccip/pull/926

RensR avatar May 28 '24 12:05 RensR