Skip to content

Commit f6d5c58

Browse files
committed
Update names
1 parent 4e67eec commit f6d5c58

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,5 @@ jobs:
4848

4949
- name: Run Forge tests
5050
run: |
51-
pnpm test
51+
pnpm test -- --gas-report
5252
id: test

abi/MagicSpendStakeManager.abi.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@
586586
"internalType": "address"
587587
},
588588
{
589-
"name": "asset",
589+
"name": "token",
590590
"type": "address",
591591
"indexed": true,
592592
"internalType": "address"
@@ -611,7 +611,7 @@
611611
"internalType": "address"
612612
},
613613
{
614-
"name": "asset",
614+
"name": "token",
615615
"type": "address",
616616
"indexed": true,
617617
"internalType": "address"
@@ -642,7 +642,7 @@
642642
"internalType": "address"
643643
},
644644
{
645-
"name": "asset",
645+
"name": "token",
646646
"type": "address",
647647
"indexed": true,
648648
"internalType": "address"
@@ -667,7 +667,7 @@
667667
"internalType": "address"
668668
},
669669
{
670-
"name": "asset",
670+
"name": "token",
671671
"type": "address",
672672
"indexed": true,
673673
"internalType": "address"

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
"description": "",
55
"main": "index.js",
66
"scripts": {
7-
"build": "forge clean && forge build",
7+
"build": "pnpm build:contracts && pnpm build:abi",
8+
"build:abi": "./generate-abi.sh",
9+
"build:contracts": "forge clean && forge build",
810
"test": "pnpm build && forge test"
911
},
1012
"keywords": [],

src/base/StakeManager.sol

+5-6
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,16 @@ abstract contract StakeManager is ReentrancyGuardUpgradeable {
3636
error InsufficientFunds();
3737

3838
/// Emitted when a stake is added
39-
event StakeLocked(address indexed account, address indexed asset, uint256 amount, uint256 unstakeDelaySec);
39+
event StakeLocked(address indexed account, address indexed token, uint256 amount, uint256 unstakeDelaySec);
4040

4141
/// Emitted when a stake is unlocked (starts the unstake process)
42-
event StakeUnlocked(address indexed account, address indexed asset, uint256 withdrawTime);
42+
event StakeUnlocked(address indexed account, address indexed token, uint256 withdrawTime);
4343

4444
/// Emitted when a stake is withdrawn
45-
event StakeWithdrawn(address indexed account, address indexed asset, uint256 amount);
45+
event StakeWithdrawn(address indexed account, address indexed token, uint256 amount);
4646

4747
/// Emitted when a stake is claimed
48-
event StakeClaimed(address indexed account, address indexed asset, uint256 amount);
48+
event StakeClaimed(address indexed account, address indexed token, uint256 amount);
4949

5050
/**
5151
* @param stake - Actual amount of ether staked for this entity.
@@ -58,8 +58,7 @@ abstract contract StakeManager is ReentrancyGuardUpgradeable {
5858
bool staked; // Indicates if the asset is currently staked
5959
}
6060

61-
/// maps account to asset to stake
62-
mapping(address => mapping(address => StakeInfo)) private stakes;
61+
mapping(address account => mapping(address token => StakeInfo stake)) private stakes;
6362

6463
uint32 public constant ONE_DAY = 60 * 60 * 24;
6564
uint32 public constant THREE_DAYS = ONE_DAY * 3;

0 commit comments

Comments
 (0)