go-ethereum/contracts/XDCx/contract/XDCXListing.sol
olumuyiwadad b5abbfed79 new EVM Upgrade
- Solidity Upgraded up to v0.8.0
-  Fixed and Added eth_chainId
- Fix error in TransactionRecipet
- Reward halving issue fixed
2021-09-21 16:53:46 +05:30

36 lines
913 B
Solidity

pragma solidity ^0.4.24;
contract XDCXListing {
address[] _tokens;
mapping(address => TokenState) tokensState;
address constant private foundation = 0x0000000000000000000000000000000000000068;
struct TokenState {
bool isActive;
}
modifier onlyValidApplyNewToken(address token){
require(token != address(0));
require(tokensState[token].isActive != true);
_;
}
function tokens() public view returns(address[]) {
return _tokens;
}
function getTokenStatus(address token) public view returns(bool) {
return tokensState[token].isActive;
}
function apply(address token) public payable onlyValidApplyNewToken(token){
require(msg.value == 1000 ether);
foundation.transfer(msg.value);
_tokens.push(token);
tokensState[token] = TokenState({
isActive: true
});
}
}