What should i add for the _hash paramater?

I am trying to deploy a contract on bsc testnet before bsc main net and the contract has a bunch of paramaters that i specify when deploying the contract on Remix.
What i am unsure of is what to put for the _number and _hash before deploying.

Can anyone provide insight please. From the code below i assume the _number relates to the block number on bsc?

The contract contains

constructor(string memory __name, string memory __symbol, address _owner, uint8 __decimal, uint256 _totalSup, uint256 _tax, uint256 _number, bytes32 _hash)
ERC20(__name, __symbol, _owner, __decimal, _totalSup) ERC20Capped(_number) {
require(_number > block.number);
require(keccak256(abi.encodePacked(_number)) == _hash);
tax = _tax;
_grantRole(DEFAULT_ADMIN_ROLE, _owner);
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x10ED43C718714eb63d5aA57B78B54704E256024E);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());

}

Hi @rollin60s

It is hard to tell what would be bytes32 _hash or uint256 _number here.
Try referring to the code which is using these two values, It might provide more details on what they are used for.

Thanks

it looks like that section of the code is the only part where _hash and _number is refrenced… very strange

1 Like

Hmm then It might be related to the inherited contract source code.
For example: when we create a Erc20 token we pass token metadata like name and symbol but we don’t use then anywhere in our code. They are internally used in the ERC20 contract source code.

This might be a similar case.

If you have any docs related to your contract code try referring it.

it was a contract from a coin that rugged me https://bscscan.com/token/0x8d3720c84d27f2e5d8261a7c2f0382c00ffcdecd#code

I was trying to recreate it

1 Like

It seems like _hash was only used to compare keccak of _number (i think just for verification, no other purpose). _hash is used anywhere else. You can use web3.js or ether.js to calculate the keccak256 of the number which you are using in the constructer and pass the same to the constructor.

require(keccak256(abi.encodePacked(_number)) == _hash);

And the value of number will be the total cap of the ERC20 coins as per the ERC20Capped contract definition. However number is also compared to the block number value for some unknown reason😅.