Skip to content

Commit

Permalink
Remove nearTokenId argument
Browse files Browse the repository at this point in the history
  • Loading branch information
karim-en committed May 30, 2024
1 parent e6f987b commit e2c3442
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions erc20-bridge-token/contracts/BridgeTokenFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,9 @@ contract BridgeTokenFactory is
}

function newBridgeToken(
string calldata nearTokenId,
bytes memory proofData,
uint64 proofBlockHeight
) external returns (address) {
require(!_isBridgeToken[_nearToEthToken[nearTokenId]], "ERR_TOKEN_EXIST");

ProofDecoder.ExecutionStatus memory status = _parseAndConsumeProof(
proofData,
proofBlockHeight
Expand All @@ -112,6 +109,8 @@ contract BridgeTokenFactory is
status.successValue
);

require(!_isBridgeToken[_nearToEthToken[result.token]], "ERR_TOKEN_EXIST");

address bridgeTokenProxy = address(
new ERC1967Proxy(
tokenImplementationAddress,
Expand All @@ -127,8 +126,8 @@ contract BridgeTokenFactory is
emit SetMetadata(bridgeTokenProxy, result.name, result.symbol, result.decimals);

_isBridgeToken[address(bridgeTokenProxy)] = true;
_ethToNearToken[address(bridgeTokenProxy)] = nearTokenId;
_nearToEthToken[nearTokenId] = address(bridgeTokenProxy);
_ethToNearToken[address(bridgeTokenProxy)] = result.token;
_nearToEthToken[result.token] = address(bridgeTokenProxy);

return bridgeTokenProxy;
}
Expand Down

0 comments on commit e2c3442

Please sign in to comment.