03 - Code
03 - Code
interface IERC20 {
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
uint public decimal=0; //we will talk about this at the end
mapping(address=>mapping(address=>uint)) allowed;
bool stopAllFunctions;
constructor(){
founder=msg.sender;
totalSupply=1000;
balances[founder]=totalSupply;
}
modifier freezeStatus(){
_;
modifier emergencyStatus(){
require(stopAllFunctions==false,"Emergency declared");
_;
return balances[account];
balances[msg.sender]-=amount;
balances[recipient]+=amount;
emit Transfer(msg.sender,recipient,amount);
return true;
return allowed[owner][spender];
//writing a cheque
allowed[msg.sender][spender]=amount;
emit Approval(msg.sender,spender,amount);
return true;
balances[sender]-=amount;
balances[recipient]+=amount;
return true;
balances[founder]-=value;
totalSupply-=totalSupply;
isFreeze[freezingAddress]=true;
isFreeze[unfreezingAddress]=false;
}
stopAllFunctions=true;