Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 7 additions & 2 deletions precompiles/bech32/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ This enables smart contracts to interact with Cosmos SDK modules that require be
#### hexToBech32

```solidity
function hexToBech32(address addr, string memory prefix) external returns (string memory bech32Address)
function hexToBech32(
address addr,
string memory prefix
) external returns (string memory bech32Address);
```

Converts an Ethereum hex address to bech32 format with the specified human-readable prefix (HRP).
Expand All @@ -39,7 +42,9 @@ Converts an Ethereum hex address to bech32 format with the specified human-reada
#### bech32ToHex

```solidity
function bech32ToHex(string memory bech32Address) external returns (address addr)
function bech32ToHex(
string memory bech32Address
) external returns (address addr);
```

Converts a bech32-formatted address to Ethereum hex format.
Expand Down
73 changes: 58 additions & 15 deletions precompiles/distribution/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ withdrawing, and funding.
#### setWithdrawAddress

```solidity
function setWithdrawAddress(address delegator, string memory withdrawerAddress) external returns (bool)
function setWithdrawAddress(
address delegator,
string memory withdrawerAddress
) external returns (bool);
```

Sets the address authorized to withdraw rewards for a delegator.
Expand All @@ -35,7 +38,10 @@ Sets the address authorized to withdraw rewards for a delegator.
#### withdrawDelegatorRewards

```solidity
function withdrawDelegatorRewards(address delegator, string memory validator) external returns (Coin[] memory)
function withdrawDelegatorRewards(
address delegator,
string memory validator
) external returns (Coin[] memory);
```

Withdraws pending rewards from a specific validator.
Expand All @@ -56,7 +62,9 @@ Withdraws pending rewards from a specific validator.
#### withdrawValidatorCommission

```solidity
function withdrawValidatorCommission(string memory validator) external returns (Coin[] memory)
function withdrawValidatorCommission(
string memory validator
) external returns (Coin[] memory);
```

Withdraws accumulated commission for a validator.
Expand All @@ -76,7 +84,10 @@ Withdraws accumulated commission for a validator.
#### claimRewards

```solidity
function claimRewards(address delegator, uint32 maxRetrieve) external returns (bool)
function claimRewards(
address delegator,
uint32 maxRetrieve
) external returns (bool);
```

Claims rewards from all validators at once (custom batch operation).
Expand All @@ -93,7 +104,10 @@ Claims rewards from all validators at once (custom batch operation).
#### fundCommunityPool

```solidity
function fundCommunityPool(address depositor, Coin[] memory coins) external returns (bool)
function fundCommunityPool(
address depositor,
Coin[] memory coins
) external returns (bool);
```

Deposits tokens into the community pool.
Expand All @@ -110,7 +124,10 @@ Deposits tokens into the community pool.
#### depositValidatorRewardsPool

```solidity
function depositValidatorRewardsPool(string memory validator, Coin[] memory coins) external returns (bool)
function depositValidatorRewardsPool(
string memory validator,
Coin[] memory coins
) external returns (bool);
```

Deposits tokens into a validator's rewards pool.
Expand All @@ -127,7 +144,12 @@ Deposits tokens into a validator's rewards pool.
#### delegationTotalRewards

```solidity
function delegationTotalRewards(address delegator) external view returns (DelegatorTotal[] memory, DecCoin[] memory)
function delegationTotalRewards(
address delegator
) external view returns (
DelegatorTotal[] memory,
DecCoin[] memory
);
```

Returns total rewards across all validators for a delegator.
Expand All @@ -146,7 +168,10 @@ Returns total rewards across all validators for a delegator.
#### delegationRewards

```solidity
function delegationRewards(address delegator, string memory validator) external view returns (DecCoin[] memory)
function delegationRewards(
address delegator,
string memory validator
) external view returns (DecCoin[] memory);
```

Returns rewards for a specific delegator-validator pair.
Expand All @@ -165,7 +190,9 @@ Returns rewards for a specific delegator-validator pair.
#### delegatorValidators

```solidity
function delegatorValidators(address delegator) external view returns (string[] memory)
function delegatorValidators(
address delegator
) external view returns (string[] memory);
```

Lists all validators from which a delegator can claim rewards.
Expand All @@ -183,7 +210,9 @@ Lists all validators from which a delegator can claim rewards.
#### delegatorWithdrawAddress

```solidity
function delegatorWithdrawAddress(address delegator) external view returns (string memory)
function delegatorWithdrawAddress(
address delegator
) external view returns (string memory);
```

Returns the configured withdraw address for a delegator.
Expand All @@ -201,7 +230,7 @@ Returns the configured withdraw address for a delegator.
#### communityPool

```solidity
function communityPool() external view returns (DecCoin[] memory)
function communityPool() external view returns (DecCoin[] memory);
```

Returns the current balance of the community pool.
Expand All @@ -215,7 +244,9 @@ Returns the current balance of the community pool.
#### validatorCommission

```solidity
function validatorCommission(string memory validator) external view returns (DecCoin[] memory)
function validatorCommission(
string memory validator
) external view returns (DecCoin[] memory);
```

Returns accumulated commission for a validator.
Expand All @@ -233,7 +264,9 @@ Returns accumulated commission for a validator.
#### validatorDistributionInfo

```solidity
function validatorDistributionInfo(string memory validator) external view returns (DistInfo memory)
function validatorDistributionInfo(
string memory validator
) external view returns (DistInfo memory);
```

Returns comprehensive distribution information for a validator.
Expand All @@ -251,7 +284,9 @@ Returns comprehensive distribution information for a validator.
#### validatorOutstandingRewards

```solidity
function validatorOutstandingRewards(string memory validator) external view returns (DecCoin[] memory)
function validatorOutstandingRewards(
string memory validator
) external view returns (DecCoin[] memory);
```

Returns outstanding (undistributed) rewards for a validator.
Expand All @@ -269,7 +304,15 @@ Returns outstanding (undistributed) rewards for a validator.
#### validatorSlashes

```solidity
function validatorSlashes(string memory validator, uint64 startingHeight, uint64 endingHeight, PageRequest memory pageRequest) external view returns (ValidatorSlashEvent[] memory, PageResponse memory)
function validatorSlashes(
string memory validator,
uint64 startingHeight,
uint64 endingHeight,
PageRequest memory pageRequest
) external view returns (
ValidatorSlashEvent[] memory,
PageResponse memory
);
```

Returns slashing events for a validator within a height range.
Expand Down
45 changes: 39 additions & 6 deletions precompiles/staking/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,45 @@ The precompile uses standard gas configuration for storage operations.
## Events

```solidity
event CreateValidator(address indexed validatorAddress, uint256 value);
event EditValidator(address indexed validatorAddress, int256 commissionRate, int256 minSelfDelegation);
event Delegate(address indexed delegatorAddress, string indexed validatorAddress, uint256 amount, uint256 shares);
event Unbond(address indexed delegatorAddress, string indexed validatorAddress, uint256 amount, int64 completionTime);
event Redelegate(address indexed delegatorAddress, string indexed validatorSrcAddress, string indexed validatorDstAddress, uint256 amount, int64 completionTime);
event CancelUnbondingDelegation(address indexed delegatorAddress, string indexed validatorAddress, uint256 amount, uint256 creationHeight);
event CreateValidator(
address indexed validatorAddress,
uint256 value
);

event EditValidator(
address indexed validatorAddress,
int256 commissionRate,
int256 minSelfDelegation
);

event Delegate(
address indexed delegatorAddress,
string indexed validatorAddress,
uint256 amount,
uint256 shares
);

event Unbond(
address indexed delegatorAddress,
string indexed validatorAddress,
uint256 amount,
int64 completionTime
);

event Redelegate(
address indexed delegatorAddress,
string indexed validatorSrcAddress,
string indexed validatorDstAddress,
uint256 amount,
int64 completionTime
);

event CancelUnbondingDelegation(
address indexed delegatorAddress,
string indexed validatorAddress,
uint256 amount,
uint256 creationHeight
);
```

## Security Considerations
Expand Down
Loading