[Smart Contracts] Refactor minerStake() function in DioneStaking - remove address argument and use msg.sender

This commit is contained in:
ChronosX88 2020-11-12 18:20:27 +04:00
parent 0b37896af9
commit 4435868b42
Signed by: ChronosXYZ
GPG Key ID: 085A69A82C8C511A
2 changed files with 11 additions and 5 deletions

View File

@ -22,7 +22,7 @@ contract DioneStaking is Ownable, ReentrancyGuard {
} }
DioneToken public dione; DioneToken public dione;
// Agregator contract address. // Aggregator contract address.
address public aggregatorAddr; address public aggregatorAddr;
// Miner rewards in DIONE tokens. // Miner rewards in DIONE tokens.
uint256 public minerReward; uint256 public minerReward;
@ -106,8 +106,14 @@ contract DioneStaking is Ownable, ReentrancyGuard {
return _totalStake; return _totalStake;
} }
function minerStake(address _minerAddr) external view returns (uint256) { // disabled for security reason
MinerInfo storage miner = minerInfo[_minerAddr]; // function minerStake(address _minerAddr) external view returns (uint256) {
// MinerInfo storage miner = minerInfo[_minerAddr];
// return miner.amount;
// }
function minerStake() external view returns (uint256) {
MinerInfo storage miner = minerInfo[msg.sender];
return miner.amount; return miner.amount;
} }

View File

@ -1,7 +1,7 @@
{ {
"name": "p2p-oracle-smart-contracts", "name": "dione-smart-contracts",
"version": "0.0.1", "version": "0.0.1",
"description": "Smart contracts for p2p oracle network", "description": "Smart contracts for Dione network",
"main": "truffle-config.js", "main": "truffle-config.js",
"directories": { "directories": {
"test": "test" "test": "test"