Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: PIP-42 change token to POL #4

Merged
merged 96 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
4432f9b
feat: transition to POL
ZeroEkkusu Apr 8, 2024
b6e19be
feat(ValidatorShare): add legacy support
ZeroEkkusu Apr 10, 2024
344af89
fix: remove `topUpForFee` and `claimFee` legacy
ZeroEkkusu Apr 11, 2024
e763e11
fix: add check in `_transferToken`
ZeroEkkusu Apr 11, 2024
9ddfb10
chore: add pr note
ZeroEkkusu May 20, 2024
0c3026a
init legacytoken, migration
ethyla May 22, 2024
7e1fd77
fix: transfer function overload
ethyla May 26, 2024
93cac41
fix: existing tests
ethyla May 29, 2024
9c1df0c
fix: revert formating in sol files
ethyla May 29, 2024
eafb462
fix: allow stakemanager tests to run independently
ethyla May 29, 2024
08895bc
fix: test preparation
ethyla Jun 7, 2024
bed9c42
fix: contracts
ethyla Jun 7, 2024
5c148f9
feat: tests for validatorshare
ethyla Jun 7, 2024
13668cf
feat: tests for legacy staking
ethyla Jun 7, 2024
499d887
fix: move storage to prevent conflicts
ethyla Jun 7, 2024
49e288f
fix: remove unused function
ethyla Jun 8, 2024
b5558ed
fix: move imports
ethyla Jun 8, 2024
21f849e
feat: allow legacy config in test deployments
ethyla Jun 10, 2024
8d64c6e
feat: add initLegacy function
ethyla Jun 10, 2024
2517086
fix: remove unused function
ethyla Jun 12, 2024
5287f4e
fix: remove legacy parameter at claimFee
ethyla Jun 13, 2024
8ee1f45
fix: remove superfluous init functionality
ethyla Jun 13, 2024
a85d63d
fix: typos
ethyla Jun 17, 2024
3652d8b
feat: disable slashing
ethyla Jun 19, 2024
3b60b23
feat: reduce codesize
ethyla Jun 19, 2024
2bce548
fix: tests
ethyla Jun 19, 2024
94fd55f
fix: rename Migration contract
ethyla Jun 20, 2024
b7568fd
fix: inline _claimFee
ethyla Jun 20, 2024
ab70c89
fix: remove unused code
ethyla Jun 20, 2024
a9990cb
fix: inline migrate functions again
ethyla Jun 20, 2024
36a6106
fix: remove all notes
ethyla Jun 20, 2024
2685727
fix: disable slashing tests
ethyla Jun 24, 2024
f8b9a0c
fix: error on multi event failure
ethyla Jun 24, 2024
260ccac
fix: properly pass return value
ethyla Jun 25, 2024
e2c430c
ci: skip forge tests if none
DhairyaSethi Jun 25, 2024
e250752
new: buyVoucherWithPermit
DhairyaSethi Jun 25, 2024
74ed770
test: setup erc20permit for tests
DhairyaSethi Jun 25, 2024
4042da2
chore: _getOrCachePolToken
DhairyaSethi Jun 25, 2024
b802ba6
chore: init pol token
DhairyaSethi Jun 26, 2024
48d200d
chore(validatorShare): disableInitializer
DhairyaSethi Jul 2, 2024
56e66bc
fix: solidity-rlp to 2.0.8 from floating
DhairyaSethi Jul 2, 2024
e76df27
chore(ci): run tests on feat/fix branches
DhairyaSethi Jul 2, 2024
1763f1e
test: buyVoucherWithPermit
DhairyaSethi Jul 2, 2024
f477976
Merge pull request #6 from 0xPolygon/feat/permit
ethyla Jul 2, 2024
544a986
feat: rename legacy to pol
ethyla Jul 7, 2024
55e25fa
fix: tests after rename
ethyla Jul 7, 2024
c22c9a2
fix: topup with pol
ethyla Jul 7, 2024
00ba7e4
feat: simple forktest
ethyla Jul 8, 2024
b3e78a5
prepare forkTest
simonDos Jul 12, 2024
4b864a4
fix tests
simonDos Jul 12, 2024
e7cd12a
work on ci
simonDos Jul 14, 2024
98515a0
generate interfaces before foundry tests
simonDos Jul 15, 2024
4a5dde1
fix interface generation script
simonDos Jul 15, 2024
8759b4f
wip: deployer
ethyla Jul 15, 2024
f5cd0a6
update foundry config
simonDos Jul 15, 2024
a5fd7d6
add UpgradeStakeManager_Sepolia script
simonDos Jul 15, 2024
972b8a0
feat: upgradeStakeManager script
simonDos Jul 15, 2024
855f45e
version 0.4.0
simonDos Jul 15, 2024
ef55dac
feat: upgradeDepositManager script (plasma bridge)
simonDos Jul 15, 2024
c4dedd3
deploy: upgrade impls on sepolia
simonDos Jul 15, 2024
d36f6ab
fix: upgradeDepositManager script
simonDos Jul 16, 2024
9ec1c71
feat: burn matic dynamically
simonDos Jul 22, 2024
558dc87
feat: add mainnet pol upgrade script
ethyla Jul 18, 2024
84e9129
feat: improve mainnet deploy script
ethyla Jul 22, 2024
4b2c7b4
feat: use deploy script in upgrade forktest
ethyla Jul 22, 2024
49bae81
fix: remove fun para
ethyla Jul 22, 2024
8575015
clean
ethyla Jul 22, 2024
4b5c80d
test: extend upgrade forktest
ethyla Jul 22, 2024
069c2be
clean: fmt
ethyla Jul 23, 2024
09e064c
fix: ci coverage
ethyla Jul 23, 2024
32af2e7
fix: ci foundry
ethyla Jul 23, 2024
0f8c9c5
fix: generate interfaces first
ethyla Jul 23, 2024
15435e8
fix: build in script
ethyla Jul 23, 2024
6422d25
fix: ci build
ethyla Jul 23, 2024
22030b4
ci: add token
ethyla Jul 23, 2024
8eb7e37
ci: don't run on non pull branches
ethyla Jul 24, 2024
f6cc0d8
fix: ci and time
ethyla Jul 24, 2024
39abd88
fix: claimfee now sends pol
ethyla Jul 25, 2024
4ba8945
fix: unstake active validators
DhairyaSethi Aug 13, 2024
4b18cbf
chore: rename to avoid collision with `_unstake(valId,exitEpoch,pol)`…
DhairyaSethi Aug 13, 2024
364a8c2
chore: run ci on feat/* pr
DhairyaSethi Aug 13, 2024
f62c3c4
fix: still sending amount on migrate matic
ethyla Aug 19, 2024
08e71ff
fix: make disable init clearer
ethyla Aug 19, 2024
b025f59
fix: print correct depositManagerImpl address
ethyla Aug 19, 2024
993fe48
fix: make init function ordering clearer
ethyla Aug 19, 2024
e33a4b2
fix: disable slashing on validatorshare
ethyla Aug 19, 2024
76632fb
fix: restore init behaiviour
ethyla Aug 19, 2024
be3df7f
fix: consistency in encodeCall
ethyla Aug 19, 2024
bce1353
test: non-idempotentcy of forceUnstake
DhairyaSethi Aug 20, 2024
bd17618
test: make robust
DhairyaSethi Aug 20, 2024
97cb2ef
fix: move check internally to cover for dethroneAndUnstake
DhairyaSethi Aug 20, 2024
f4a5924
feat: improve readme
ethyla Aug 20, 2024
f0bdac8
fix: wrong interface
ethyla Aug 20, 2024
c795e76
Merge pull request #9 from 0xPolygon/fix/forceUnstake
simonDos Aug 22, 2024
064df8a
Merge branch 'feat/pol' into fix/polUpgradeReview
simonDos Aug 22, 2024
753a269
Merge pull request #10 from 0xPolygon/fix/polUpgradeReview
simonDos Aug 22, 2024
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
48 changes: 15 additions & 33 deletions contracts/staking/stakeManager/IStakeManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,23 @@ pragma solidity 0.5.17;

contract IStakeManager {
// validator replacement
function startAuction(
uint256 validatorId,
uint256 amount,
bool acceptDelegation,
bytes calldata signerPubkey
) external;
function startAuction(uint256 validatorId, uint256 amount, bool acceptDelegation, bytes calldata signerPubkey) external;

function confirmAuctionBid(uint256 validatorId, uint256 heimdallFee) external;

function transferFunds(
uint256 validatorId,
uint256 amount,
address delegator
) external returns (bool);
function transferFunds(uint256 validatorId, uint256 amount, address delegator) external returns (bool);

function delegationDeposit(
uint256 validatorId,
uint256 amount,
address delegator
) external returns (bool);
function delegationDeposit(uint256 validatorId, uint256 amount, address delegator) external returns (bool);

function unstake(uint256 validatorId) external;

function totalStakedFor(address addr) external view returns (uint256);

function stakeFor(
address user,
uint256 amount,
uint256 heimdallFee,
bool acceptDelegation,
bytes memory signerPubkey
) public;
function stakeFor(address user, uint256 amount, uint256 heimdallFee, bool acceptDelegation, bytes memory signerPubkey) public;

function checkSignatures(
uint256 blockInterval,
bytes32 voteHash,
bytes32 stateRoot,
address proposer,
uint[3][] calldata sigs
) external returns (uint256);
function checkSignatures(uint256 blockInterval, bytes32 voteHash, bytes32 stateRoot, address proposer, uint256[3][] calldata sigs)
external
returns (uint256);

function updateValidatorState(uint256 validatorId, int256 amount) public;

Expand All @@ -57,13 +34,13 @@ contract IStakeManager {

function withdrawalDelay() public view returns (uint256);

function delegatedAmount(uint256 validatorId) public view returns(uint256);
function delegatedAmount(uint256 validatorId) public view returns (uint256);

function decreaseValidatorDelegatedAmount(uint256 validatorId, uint256 amount) public;

function withdrawDelegatorsReward(uint256 validatorId) public returns(uint256);
function withdrawDelegatorsReward(uint256 validatorId) public returns (uint256);

function delegatorsReward(uint256 validatorId) public view returns(uint256);
function delegatorsReward(uint256 validatorId) public view returns (uint256);

function dethroneAndStake(
address auctionUser,
Expand All @@ -73,4 +50,9 @@ contract IStakeManager {
bool acceptDelegation,
bytes calldata signerPubkey
) external;

// @note MATIC POL conversion ⬇️

function transferFundsLegacy(uint256 validatorId, uint256 amount, address delegator) external returns (bool);
function delegationDepositLegacy(uint256 validatorId, uint256 amount, address delegator) external returns (bool);
}
Loading