We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
SharingWishVault 是一个基于以太坊的智能合约,用于管理愿望分享和资金分配。它允许用户创建愿望资金库(Vault),接受捐赠,并通过管理员(Admin)审核后分配资金给指定的接收者(Claimer)。
SharingWishVault
Vault
Admin
Claimer
Vault 创建
ETH
ERC20
ID
资金管理
donate
lockTime
withdraw
资金分配
settle
claim
安全特性
Emergency Mode
ReentrancyGuard
function createVault(string calldata message, address token, uint256 lockDuration) external returns (uint256 vaultId)
token
lockDuration
Vault ID
function donate(uint256 vaultId, uint256 amount) external payable
function settle(uint256 vaultId, address claimer, uint256 amount) external
function claim(uint256 vaultId) external
function withdraw(uint256 vaultId, uint256 amount) external
function getClaimedAmount(uint256 vaultId, address claimer) external view returns (uint256)
claimedAmount
function getMaxClaimableAmount(uint256 vaultId, address claimer) external view returns (uint256)
maxClaimableAmount
function addAllowedToken(address token) external function removeAllowedToken(address token) external function isAllowedToken(address token) external view returns (bool)
function toggleEmergencyMode() external function emergencyWithdraw(uint256 vaultId, uint256 amount) external
graph TD A[User] -->|createVault| B(Create Vault) B -->|Return vaultId| C[Vault Created] D[Donor] -->|donate| E(Donate) E -->|Update totalAmount| F[Funds Deposited] G[Admin] -->|settle| H(Allocate Funds) H -->|Set maxClaimableAmount| I[Funds Allocated] J[Claimer] -->|claim| K(Request Claim) K -->|Check maxClaimableAmount| L{Has Claimable Amount?} L -->|Yes| M[Transfer to Claimer] L -->|No| N[Claim Failed] O[Creator] -->|After lockTime| P(withdraw) P -->|Check lockTime| Q{Lock Period Expired?} Q -->|Yes| R[Withdraw Funds] Q -->|No| S[Withdraw Failed] T[Admin] -->|Emergency| U(toggleEmergencyMode) U -->|Enable Emergency Mode| V[Pause Operations] V -->|emergencyWithdraw| W[Emergency Withdraw]
VaultCreated
FundsDonated
VaultSettled
FundsClaimed
FundsWithdrawn
EmergencyModeToggled
InvalidVaultId
EmergencyModeActive
EmergencyModeNotActive
InsufficientBalance
InvalidClaimer
NoFundsToClaim
LockPeriodNotExpired
ETHTransferFailed
ExceedsTotalAmount
官网sharing增加 wish list 页面, 让大家可以提出自己期望听到的
The text was updated successfully, but these errors were encountered:
yanyanho
0x-stan
sansx
cheng521521
yingjingyang
No branches or pull requests
SharingWishVault
功能概述
SharingWishVault
是一个基于以太坊的智能合约,用于管理愿望分享和资金分配。它允许用户创建愿望资金库(Vault
),接受捐赠,并通过管理员(Admin
)审核后分配资金给指定的接收者(Claimer
)。主要特性
Vault 创建
ETH
和指定的ERC20
代币ID
和锁定期资金管理
donate
)lockTime
)为 14 天withdraw
)未分配的资金资金分配
settle
)claim
)已分配的资金安全特性
Emergency Mode
)开关ReentrancyGuard
)保护合约接口
核心功能
token
)和锁定期(lockDuration
)Vault ID
ETH
和ERC20
代币Claimer
)查询功能
claimedAmount
)maxClaimableAmount
)管理功能
FLow
Events
VaultCreated
: Vault 创建事件FundsDonated
: 资金捐赠事件VaultSettled
: 资金分配事件FundsClaimed
: 资金领取事件FundsWithdrawn
: 资金提取事件EmergencyModeToggled
: 紧急模式切换事件Errors
InvalidVaultId
: 无效的 Vault IDEmergencyModeActive
: 紧急模式已激活EmergencyModeNotActive
: 紧急模式未激活InsufficientBalance
: 余额不足InvalidClaimer
: 无效的接收者地址NoFundsToClaim
: 无可领取资金LockPeriodNotExpired
: 锁定期未到ETHTransferFailed
: ETH 转账失败ExceedsTotalAmount
: 超出总金额前端需求
官网sharing增加 wish list 页面, 让大家可以提出自己期望听到的
The text was updated successfully, but these errors were encountered: