I need to create a ERC721 contract where ERC721 constructor properties (name, symbol) are not provided directly but they are calculated from the new constructor parameters. I am trying like this but it does not work
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract MyToken is ERC721 {
constructor(
string someparameter
) {
// transform "someparameter into two variables with string manipulation,
// let's say "somparameterName" and "someparameterSymbol"
...
super(somparameterName, someparameterSymbol)
}
}
Is this possible?
It seems like it only allows using ERC721(_name, _symbol)
after constructor(string someparameter)
and before the body of the constructor ({...}
)
Thanks