[Smart Contracts] Refactor minerStake() function in DioneStaking - remove address argument and use msg.sender
This commit is contained in:
parent
0b37896af9
commit
4435868b42
@ -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;
|
||||||
}
|
}
|
||||||
|
|
@ -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"
|
||||||
|
Loading…
Reference in New Issue
Block a user