pragma solidity ^0.8.22;


// ----------------------------------------------------------------------------

// ERC Token Standard #20 Interface

// ----------------------------------------------------------------------------

interface ERC20Interface {

    function totalSupply() external view returns (uint256);

    function balanceOf(address tokenOwner) external view returns (uint256 balance);

    function allowance(address tokenOwner, address spender) external view returns (uint256 remaining);

    function transfer(address to, uint256 tokens) external returns (bool success);

    function approve(address spender, uint256 tokens) external returns (bool success);

    function transferFrom(address from, address to, uint256 tokens) external returns (bool success);


    event Transfer(address indexed from, address indexed to, uint256 tokens);

    event Approval(address indexed tokenOwner, address indexed spender, uint256 tokens);

}


// ----------------------------------------------------------------------------

// Safe Math Library

// ----------------------------------------------------------------------------

library SafeMath {

    function safeAdd(uint256 a, uint256 b) internal pure returns (uint256 c) {

        c = a + b;

        require(c >= a, "SafeMath: addition overflow");

    }


    function safeSub(uint256 a, uint256 b) internal pure returns (uint256 c) {

        require(b <= a, "SafeMath: subtraction overflow");

        c = a - b;

    }


    function safeMul(uint256 a, uint256 b) internal pure returns (uint256 c) {

        c = a * b;

        require(a == 0 || c / a == b, "SafeMath: multiplication overflow");

    }


    function safeDiv(uint256 a, uint256 b) internal pure returns (uint256 c) {

        require(b > 0, "SafeMath: division by zero");

        c = a / b;

    }

}


contract SAVIOR is ERC20Interface, Ownable {

    using SafeMath for uint256;


    string public name;

    string public symbol;

    uint8 public decimals; // 18 decimals is the strongly suggested default, avoid changing it


    uint256 public totalSupply;


    mapping(address => uint256) private balances;

    mapping(address => mapping(address => uint256)) private allowances;


    constructor() Ownable(msg.sender) {
    name = "Savior Coin";
    symbol = "SAVIOR";
    decimals = 18;
    totalSupply = 8000000066000000000000000000;
    balances[msg.sender] = totalSupply;
    emit Transfer(address(0), msg.sender, totalSupply);
}


    function balanceOf(address tokenOwner) public view override returns (uint256) {

        return balances[tokenOwner];

    }


    function transfer(address to, uint256 tokens) public override returns (bool) {

        require(to != address(0), "SAVIOR: transfer to the zero address");

        require(tokens <= balances[msg.sender], "SAVIOR: transfer amount exceeds balance");


        balances[msg.sender] = balances[msg.sender].safeSub(tokens);

        balances[to] = balances[to].safeAdd(tokens);


        emit Transfer(msg.sender, to, tokens);

        return true;

    }


    function allowance(address tokenOwner, address spender) public view override returns (uint256) {

        return allowances[tokenOwner][spender];

    }


    function approve(address spender, uint256 tokens) public override returns (bool) {

        allowances[msg.sender][spender] = tokens;

        emit Approval(msg.sender, spender, tokens);

        return true;

    }


    function transferFrom(address from, address to, uint256 tokens) public override returns (bool) {

        require(from != address(0), "SAVIOR: transfer from the zero address");

        require(to != address(0), "SAVIOR: transfer to the zero address");

        require(tokens <= balances[from], "SAVIOR: transfer amount exceeds balance");

        require(tokens <= allowances[from][msg.sender], "SAVIOR: transfer amount exceeds allowance");


        balances[from] = balances[from].safeSub(tokens);

        balances[to] = balances[to].safeAdd(tokens);

        allowances[from][msg.sender] = allowances[from][msg.sender].safeSub(tokens);


        emit Transfer(from, to, tokens);

        return true;

    }


}
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"tokenOwner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokens","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokens","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"tokenOwner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"tokens","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenOwner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokens","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokens","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]