odradev / odra

Odra framework
MIT License
62 stars 2 forks source link

`odra-cli` #481

Open zie1ony opened 4 months ago

zie1ony commented 4 months ago

Simplify a process of creating CLI layer for Odra contracts.

Insipiration:


trait CLITask {
    fn execute(&self);
}

#[odra::cli_task]
pub struct MintTokensTask {
    pub recipient: Address,
    pub amount: u64,
}

impl CLITask for MintTokensTask {
    fn execute(&self) {

    }
}

struct OdraCLI;

impl OdraCLI {
    fn add_task(&self, task: impl CLITask) {
        // task.execute();
    }
}

fn main_() {
    OdraCLI.with_task(MintTokensTask).parser()
}