mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-20 13:44:31 +00:00
- Solidity Upgraded up to v0.8.0 - Fixed and Added eth_chainId - Fix error in TransactionRecipet - Reward halving issue fixed
36 lines
913 B
Solidity
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
|
|
});
|
|
}
|
|
}
|