[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;
|
||||
// Agregator contract address.
|
||||
// Aggregator contract address.
|
||||
address public aggregatorAddr;
|
||||
// Miner rewards in DIONE tokens.
|
||||
uint256 public minerReward;
|
||||
@ -106,8 +106,14 @@ contract DioneStaking is Ownable, ReentrancyGuard {
|
||||
return _totalStake;
|
||||
}
|
||||
|
||||
function minerStake(address _minerAddr) external view returns (uint256) {
|
||||
MinerInfo storage miner = minerInfo[_minerAddr];
|
||||
// disabled for security reason
|
||||
// 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;
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "p2p-oracle-smart-contracts",
|
||||
"name": "dione-smart-contracts",
|
||||
"version": "0.0.1",
|
||||
"description": "Smart contracts for p2p oracle network",
|
||||
"description": "Smart contracts for Dione network",
|
||||
"main": "truffle-config.js",
|
||||
"directories": {
|
||||
"test": "test"
|
||||
|
Loading…
Reference in New Issue
Block a user