I noticed some smart contracts have there name,symbol, and supply set up like this example #1 and setup a defined constructor. Notice, they did not fill in the "string public symbol", "string public name", or "unit decimals", or "unit total supply".
Example #1:
contract PucksToken is ERC20Interface, Owned, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
constructor() public {
symbol = "0PUCKS";
name = "0 Pucks Token";
decimals = 18;
_totalSupply = 100000000000000000000000000;
balances[0x5A86f0cafD4ef3ba4f0344C138afcC84bd1ED222] = _totalSupply;
emit Transfer(address(0), 0x5A86f0cafD4ef3ba4f0344C138afcC84bd1ED222, _totalSupply);
And some set the smart contract like this and use the "string public constant" to define. Example #2:
contract BTClite is StandardToken, Ownable {
string public constant name = "BTC LITE";
string public constant symbol = "BTCL";
uint8 public constant decimals = 8;
uint256 public constant SUPPLY_CAP = 21000000 * (10 ** uint256(decimals));
address NULL_ADDRESS = address(0);
My question is when writing a smart contract, in example #1 is the defined "construct" code info sufficicent to define the terms of the contract and you do not have to fill in the information "string public constant"?
Basically why did example #1 not fill/input this information in below?
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
or are they both the same?