Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
203 changes: 203 additions & 0 deletions .openzeppelin/unknown-97.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,203 @@
{
"manifestVersion": "3.2",
"admin": {
"address": "0xb9e81C1558E0b68DA5E6AacaAc9cC0000Ff5fEad",
"txHash": "0x161f2c35d41c5a534e6c6dca0163b059a84a9c3b0577f28865f4c1280c651e7f"
},
"proxies": [
{
"address": "0x103518297E47a12d8880E5962816a552E125c343",
"txHash": "0x85d65ebc2ad8dcb555064786a2dc40af45dcfc9573e72b194a38b1c482645d2b",
"kind": "transparent"
}
],
"impls": {
"1178e2f3c98fa4d053e4e12bfeebcc54fa1d8f12dbe3b7db069dc7c87ce06d67": {
"address": "0xCf23a807f94f8b6aaCCB27FADaEc02f341470f45",
"txHash": "0x3563f4969c4acbc6f0552b5383c07e6d0629c689db391b36657970ba57249a72",
"layout": {
"storage": [
{
"contract": "Initializable",
"label": "_initialized",
"type": "t_bool",
"src": "../@openzeppelin/contracts-upgradeable/proxy/Initializable.sol:25"
},
{
"contract": "Initializable",
"label": "_initializing",
"type": "t_bool",
"src": "../@openzeppelin/contracts-upgradeable/proxy/Initializable.sol:30"
},
{
"contract": "ContextUpgradeable",
"label": "__gap",
"type": "t_array(t_uint256)50_storage",
"src": "../@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:31"
},
{
"contract": "OwnableUpgradeable",
"label": "_owner",
"type": "t_address",
"src": "../@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:20"
},
{
"contract": "OwnableUpgradeable",
"label": "__gap",
"type": "t_array(t_uint256)49_storage",
"src": "../@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:74"
},
{
"contract": "RewardsDistributionRecipientUpgradeable",
"label": "rewardsDistribution",
"type": "t_address",
"src": "../project:/contracts/staking/RewardsDistributionRecipientUpgradeable.sol:9"
},
{
"contract": "ReentrancyGuardUpgradeable",
"label": "_status",
"type": "t_uint256",
"src": "../@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol:37"
},
{
"contract": "ReentrancyGuardUpgradeable",
"label": "__gap",
"type": "t_array(t_uint256)49_storage",
"src": "../@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol:67"
},
{
"contract": "FailsafeUpgradeable",
"label": "failsafeModeActive",
"type": "t_bool",
"src": "../project:/contracts/staking/FailsafeUpgradeable.sol:7"
},
{
"contract": "PausableUpgradeable",
"label": "_paused",
"type": "t_bool",
"src": "../@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol:28"
},
{
"contract": "PausableUpgradeable",
"label": "__gap",
"type": "t_array(t_uint256)49_storage",
"src": "../@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol:96"
},
{
"contract": "StakingRewardsUpgradeable",
"label": "rewardsToken",
"type": "t_contract(IERC20Upgradeable)627",
"src": "../project:/contracts/staking/StakingRewardsUpgradeable.sol:28"
},
{
"contract": "StakingRewardsUpgradeable",
"label": "stakingToken",
"type": "t_contract(IERC20Upgradeable)627",
"src": "../project:/contracts/staking/StakingRewardsUpgradeable.sol:29"
},
{
"contract": "StakingRewardsUpgradeable",
"label": "periodFinish",
"type": "t_uint256",
"src": "../project:/contracts/staking/StakingRewardsUpgradeable.sol:30"
},
{
"contract": "StakingRewardsUpgradeable",
"label": "rewardRate",
"type": "t_uint256",
"src": "../project:/contracts/staking/StakingRewardsUpgradeable.sol:31"
},
{
"contract": "StakingRewardsUpgradeable",
"label": "rewardsDuration",
"type": "t_uint256",
"src": "../project:/contracts/staking/StakingRewardsUpgradeable.sol:32"
},
{
"contract": "StakingRewardsUpgradeable",
"label": "minimumStakeTime",
"type": "t_uint256",
"src": "../project:/contracts/staking/StakingRewardsUpgradeable.sol:33"
},
{
"contract": "StakingRewardsUpgradeable",
"label": "lastUpdateTime",
"type": "t_uint256",
"src": "../project:/contracts/staking/StakingRewardsUpgradeable.sol:34"
},
{
"contract": "StakingRewardsUpgradeable",
"label": "rewardPerTokenStored",
"type": "t_uint256",
"src": "../project:/contracts/staking/StakingRewardsUpgradeable.sol:35"
},
{
"contract": "StakingRewardsUpgradeable",
"label": "feePercent",
"type": "t_uint256",
"src": "../project:/contracts/staking/StakingRewardsUpgradeable.sol:36"
},
{
"contract": "StakingRewardsUpgradeable",
"label": "userRewardPerTokenPaid",
"type": "t_mapping(t_address,t_uint256)",
"src": "../project:/contracts/staking/StakingRewardsUpgradeable.sol:40"
},
{
"contract": "StakingRewardsUpgradeable",
"label": "rewards",
"type": "t_mapping(t_address,t_uint256)",
"src": "../project:/contracts/staking/StakingRewardsUpgradeable.sol:41"
},
{
"contract": "StakingRewardsUpgradeable",
"label": "_totalSupply",
"type": "t_uint256",
"src": "../project:/contracts/staking/StakingRewardsUpgradeable.sol:43"
},
{
"contract": "StakingRewardsUpgradeable",
"label": "_balances",
"type": "t_mapping(t_address,t_uint256)",
"src": "../project:/contracts/staking/StakingRewardsUpgradeable.sol:44"
},
{
"contract": "StakingRewardsUpgradeable",
"label": "_stakeTimestamp",
"type": "t_mapping(t_address,t_uint256)",
"src": "../project:/contracts/staking/StakingRewardsUpgradeable.sol:45"
},
{
"contract": "StakingRewardsUpgradeable",
"label": "minimumStakeAmount",
"type": "t_uint256",
"src": "../project:/contracts/staking/StakingRewardsUpgradeable.sol:48"
}
],
"types": {
"t_contract(IERC20Upgradeable)627": {
"label": "contract IERC20Upgradeable"
},
"t_uint256": {
"label": "uint256"
},
"t_mapping(t_address,t_uint256)": {
"label": "mapping(address => uint256)"
},
"t_address": {
"label": "address"
},
"t_bool": {
"label": "bool"
},
"t_array(t_uint256)49_storage": {
"label": "uint256[49]"
},
"t_array(t_uint256)50_storage": {
"label": "uint256[50]"
}
}
}
}
}
}
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"[typescript]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
},
"solidity.defaultCompiler": "remote"
}
Binary file added assets/images/background/background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/common/gameLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions assets/images/common/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import mute from './mute.png'
import gameLogo from './gameLogo.png'
import notplay from './notplay.svg'
import play from './play.svg'
import sound from './sound.png'

export const commonImage = {
mute,
gameLogo,
notplay,
play,
sound,
}
Binary file added assets/images/common/mute.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/images/common/notplay.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/images/common/play.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/common/sound.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions contracts/staking/Failsafe.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
pragma solidity ^0.6.2;

import "./Owned.sol";

abstract contract Failsafe is Owned {
bool public failsafeModeActive = false;

constructor() internal {
require(owner != address(0), "Owner must be set");
}

function enableFailsafeMode() public virtual onlyOwner {
failsafeModeActive = true;
emit FailsafeModeEnabled();
}

event FailsafeModeEnabled();

modifier normalMode {
require(
!failsafeModeActive,
"This action cannot be performed while the contract is in Failsafe Mode"
);
_;
}

modifier failsafeMode {
require(
failsafeModeActive,
"This action can only be performed while the contract is in Failsafe Mode"
);
_;
}
}
40 changes: 40 additions & 0 deletions contracts/staking/FailsafeUpgradeable.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
pragma solidity ^0.6.2;

import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";

abstract contract FailsafeUpgradeable is Initializable, OwnableUpgradeable {
bool public failsafeModeActive;

function __Failsafe_init() internal initializer {
__Ownable_init();
__Failsafe_init_unchained();
}

function __Failsafe_init_unchained() internal initializer {
failsafeModeActive = false;
}

function enableFailsafeMode() public virtual onlyOwner {
failsafeModeActive = true;
emit FailsafeModeEnabled();
}

event FailsafeModeEnabled();

modifier normalMode {
require(
!failsafeModeActive,
"This action cannot be performed while the contract is in Failsafe Mode"
);
_;
}

modifier failsafeMode {
require(
failsafeModeActive,
"This action can only be performed while the contract is in Failsafe Mode"
);
_;
}
}
43 changes: 43 additions & 0 deletions contracts/staking/Owned.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
pragma solidity ^0.6.2;

// https://docs.synthetix.io/contracts/source/contracts/owned
contract Owned {
address public owner;
address public nominatedOwner;

constructor(address _owner) public {
require(_owner != address(0), "Owner address cannot be 0");
owner = _owner;
emit OwnerChanged(address(0), _owner);
}

function nominateNewOwner(address _owner) external onlyOwner {
nominatedOwner = _owner;
emit OwnerNominated(_owner);
}

function acceptOwnership() external {
require(
msg.sender == nominatedOwner,
"You must be nominated before you can accept ownership"
);
emit OwnerChanged(owner, nominatedOwner);
owner = nominatedOwner;
nominatedOwner = address(0);
}

modifier onlyOwner {
_onlyOwner();
_;
}

function _onlyOwner() private view {
require(
msg.sender == owner,
"Only the contract owner may perform this action"
);
}

event OwnerNominated(address newOwner);
event OwnerChanged(address oldOwner, address newOwner);
}
26 changes: 26 additions & 0 deletions contracts/staking/RewardsDistributionRecipient.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
pragma solidity ^0.6.2;

// Inheritance
import "./Owned.sol";

// https://docs.synthetix.io/contracts/source/contracts/rewardsdistributionrecipient
abstract contract RewardsDistributionRecipient is Owned {
address public rewardsDistribution;

function notifyRewardAmount(uint256 reward) external virtual;

modifier onlyRewardsDistribution() {
require(
msg.sender == rewardsDistribution,
"Caller is not RewardsDistribution contract"
);
_;
}

function setRewardsDistribution(address _rewardsDistribution)
external
onlyOwner
{
rewardsDistribution = _rewardsDistribution;
}
}
Loading