Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: addressed ackee's report #312

Merged
merged 16 commits into from
Jan 6, 2025
Prev Previous commit
Next Next commit
try to preserve tokenManager bytecode
  • Loading branch information
Foivos committed Dec 20, 2024
commit 3435efa4e8ef08d29474a32e3add80a8215cfd2d
1 change: 0 additions & 1 deletion contracts/interfaces/ITokenManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { IFlowLimit } from './IFlowLimit.sol';
interface ITokenManager is IBaseTokenManager, IOperator, IFlowLimit, IImplementation {
error TokenLinkerZeroAddress();
error NotService(address caller);
error ZeroTokenAddress();
error NotSupported();

/**
Expand Down
8 changes: 3 additions & 5 deletions contracts/token-manager/TokenManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ contract TokenManager is ITokenManager, Operator, FlowLimit, Implementation, Mul
}

/**
* @notice Reads the token address from the proxy.
* @dev This function is not supported when directly called on the implementation.
* It must be called by the proxy. It is included here so that the interace shows this function as existing, for better UX.
* @notice Reads the token address from the proxy.
* @dev This function is not supported when directly called on the implementation. It
* must be called by the proxy.
* @return tokenAddress_ The address of the token.
*/
function tokenAddress() external view virtual returns (address) {
Expand All @@ -69,7 +69,6 @@ contract TokenManager is ITokenManager, Operator, FlowLimit, Implementation, Mul
/**
* @notice A function that returns the token id.
* @dev This will only work when implementation is called by a proxy, which stores the tokenId as an immutable.
* It is included here so that the interace shows this function as existing, for better UX.
* @return bytes32 The interchain token ID.
*/
function interchainTokenId() public pure returns (bytes32) {
Expand All @@ -91,7 +90,6 @@ contract TokenManager is ITokenManager, Operator, FlowLimit, Implementation, Mul
*/
function getTokenAddressFromParams(bytes calldata params_) external pure returns (address tokenAddress_) {
(, tokenAddress_) = abi.decode(params_, (bytes, address));
if (tokenAddress_ == address(0)) revert ZeroTokenAddress();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion test/TokenManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ describe('Token Manager', () => {
const proxyBytecodeHash = keccak256(proxyBytecode);

const expected = {
london: '0x3b336208cc75ca67bdd39bdeed72871ce795e6e9cd28e20f811599ea51973ebf',
london: '0x8080880884e00735cc1a34bdf5c1ea6c023db60a01cfa1e951ca41ecf5fd8836',
}[getEVMVersion()];

expect(proxyBytecodeHash).to.be.equal(expected);
Expand Down
Loading