Closed
Description
Description
The majority of our ADOs do not currently make use of "actions" for permissioning and economic incentives.
Implementation
Generate a call_action
style method that should both check permissioning and call the economics contract as required:
fn call_action(ctx: ExecuteContext, action: &str) -> Result<Response, ContractError> {
ensure!(
is_context_permissioned(ctx.deps.storage, &ctx.info, &ctx.env, &ctx.amp_ctx, action)?,
ContractError::Unauthorized {}
);
let payee = if let Some(amp_ctx) = ctx.amp_ctx.clone() {
ctx.deps
.api
.addr_validate(amp_ctx.ctx.get_origin().as_str())?
} else {
ctx.info.sender.clone()
};
let fee_msg =
ADOContract::default().pay_fee(ctx.deps.storage, &ctx.deps.querier, action, payee)?;
Ok(Response::default().add_submessage(fee_msg))
}
Add this call to each contract that does not currently this it.
Acceptance Criteria
Actions implemented in all 1.0 contracts:
- Splitter
- Crowdfund
- CW721
- Auction
- Marketplace
- Timelock
- Lockdrop
- Merkle Airdrop
- CW20
- CW20 Staking
- CW20 Exchange
- Rate Limiting Withdrawals
Metadata
Metadata
Assignees
Labels
No labels