When bridging a token from mainnet to Starknet, we check if a collection has a baseURI or individual URIs.
The baseURI check always fails because calls are incorrectly encoded.
In src/token/TokenUtil.sol
, line 150, encoded calls to check for baseURI are created with:
Because the standard method is baseURI(), with uppercase URI, the internal function TokenUtils::_callBaseUri always fails to retrieve a base uri.
Note: the above Foundry test was run against an ETH mainnet fork:
forge test --fork-url https://mainnet.infura.io/v3/{key} --match-test callBaseUri -vvv
Tokens are bridged to Starknet with individual token URIs even if they have a common base URI. For example, it will send a request to Starknet containing:
https://www.miladymaker.net/milady/json/0
And so forth, instead of the inteded baseURI by itself:
The function is implemented incorrectly, deviating from the behavior expected in the comments:
However, funds are not at risk and metadata is still bridged (though inefficiently), so I mark this as a LOW.
Foundry
Encode the call with "_baseURI()", note the uppercase URI.
Likelyhood: Medium, no token using OZ version 2.X and 3.X will work. Impact: Low, Valid standard token won’t be mint with the URI but owner can use ERC721UriImpl function on the deployed token.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.