-
Notifications
You must be signed in to change notification settings - Fork 0
/
CardCore.sol
68 lines (56 loc) · 1.83 KB
/
CardCore.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
pragma solidity ^0.4.19;
import "./CardForge.sol";
contract CardCore is CardForge {
// This is the CORE of ProjectEther. The breakdown of each contracts
// functionality is as follows:
//
// Libraries utilized: SafeMath
// (https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol)
//
// - CardBase: This contract stores the fundamental instruments necessary to
// run ProjectEther. Included are storage elements and basic functionality of
// cards.
//
// - CardBattle:
//
// - CardForge: This contract contains all the advanced functionality and
// permission related elements. Included are features for card packs, sale of
// card packs, and admin perms.
//
// - CardMarketplace:
//
// - CardMaster: This file manages all the creator and admin permissions and
// constraints for child contract functions.
//
// - CardOwnership: This provides the methods required for basic non-fungible
// token transactions, following the draft ERC-721 spec.
// (https://github.com/ethereum/EIPs/issues/721)
address public newContractAddress;
function CardCore() public {
// Starts paused.
paused = true;
// Creator of contract set to creator address.
creatorAddress = msg.sender;
}
function setNewContractAddress(address _otherAddress) external onlyCreator whenPaused {
newContractAddress = _otherAddress;
ContractUpgrade(_otherAddress);
}
function getCard(uint256 _id)
external
view
returns (
uint256 cardId,
uint256 value,
uint256 rarity
){
Card storage cardTemp = cards[_id];
cardId = uint256(cardTemp.cardId);
value = uint256(cardTemp.value);
rarity = uint256(cardTemp.rarity);
}
function unpause() public onlyCreator whenPaused {
require(newContractAddress == address(0));
super.unpause();
}
}