Skip to content
Verified contractPartial

AltiMates

Address0x62b767c080370b82ec8a96f0c7602aa6a4ae80c8
Balance

0 ETH

 

Transactions

1,361

 

Compiler

solc 0.5.0

 

Same code

Only this contract

 

Details

Compiler
solc 0.5.0+commit.1d4f565a
Language
solidity
Optimization
No
EVM version
byzantium
License
Not stated
Match
Partialcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
8,579,858
Creation transaction
0xa124f337b1…d665706c50

AltiMates.sol

pragma solidity ^0.5.0;


library Roles {
    struct Role {
        mapping (address => bool) bearer;
    }

    
    function add(Role storage role, address account) internal {
        require(!has(role, account), "Roles: account already has role");
        role.bearer[account] = true;
    }

    
    function remove(Role storage role, address account) internal {
        require(has(role, account), "Roles: account does not have role");
        role.bearer[account] = false;
    }

    
    function has(Role storage role, address account) internal view returns (bool) {
        require(account != address(0), "Roles: account is the zero address");
        return role.bearer[account];
    }
}

contract WhitelistAdminRole {
    using Roles for Roles.Role;

    event WhitelistAdminAdded(address indexed account);
    event WhitelistAdminRemoved(address indexed account);

    Roles.Role private _whitelistAdmins;

    constructor () internal {
        _addWhitelistAdmin(msg.sender);
    }

    modifier onlyWhitelistAdmin() {
        require(isWhitelistAdmin(msg.sender), "WhitelistAdminRole: caller does not have the WhitelistAdmin role");
        _;
    }

    function isWhitelistAdmin(address account) public view returns (bool) {
        return _whitelistAdmins.has(account);
    }

    function addWhitelistAdmin(address account) public onlyWhitelistAdmin {
        _addWhitelistAdmin(account);
    }

    function renounceWhitelistAdmin() public {
        _removeWhitelistAdmin(msg.sender);
    }

    function _addWhitelistAdmin(address account) internal {
        _whitelistAdmins.add(account);
        emit WhitelistAdminAdded(account);
    }

    function _removeWhitelistAdmin(address account) internal {
        _whitelistAdmins.remove(account);
        emit WhitelistAdminRemoved(account);
    }
}

contract AltiMates is WhitelistAdminRole {

  struct ATContract {
    string refNo;
    string stock;
    uint256 startDate;
    uint256 endDate;
    uint256 spotPrice;
    uint256 spRate;
    uint256 koRate;
    uint256 kiRate;
  }

  mapping(address => ATContract) public contracts;

  constructor() public {
  }

  function subscribe(address from, string calldata _refNo, string calldata _stock, uint256 _startDate, uint256 _endDate,
    uint256 _spotPrice, uint256 _spRate, uint256 _koRate, uint256 _kiRate) external onlyWhitelistAdmin {
    ATContract memory ctr  = ATContract(_refNo, _stock, _startDate, _endDate, _spotPrice, _spRate, _koRate, _kiRate);
    contracts[from] = ctr;
  }
}
Compiler settingsShow
{
  "libraries": {},
  "optimizer": {
    "runs": 200,
    "enabled": false
  },
  "evmVersion": "byzantium",
  "remappings": []
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.