How to Set Price in Solidity for ERC721 Contract?

I am following a series of Youtube videos to create my own NFTs and a minting dapp. The creator was kind enough to provide all the boiler plate codes and I’d just have to modify them to my needs. However, he made the codes for Polygon and ETH, I’d like to deploy my smart contract to BSC.
Part of the code looks like this:

contract NFT is ERC721Enumerable, Ownable {
  using Strings for uint256;

  string baseURI;
  string public baseExtension = ".json";
  uint256 public cost = 0.05 ether;
  uint256 public maxSupply = 10000;
  uint256 public maxMintAmount = 20;
  bool public paused = false;
  bool public revealed = false;
  string public notRevealedUri;

He set the cost to 0.05 ether, how do I change it for BNB? Someone told me I can use the units “jager” instead of “wei, gwei, ether” etc, but eth has 18 decimals, and BNB has 8 decimals…I’m confused on how to modify this so it can work for the BSC network.

Any help would be greatly appreciated!

Never mind, I found the answer lol. It’s such a silly newbie mistake. The amount in ether in solidity is the same as BNB. So 0.05 ether is 0.05 BNB. In case another newb out there needed a reminder, I’m gonna leave this post here!

2 Likes