-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
108 additions
and
1 deletion.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
[package] | ||
name = "phoenix-vesting" | ||
version = { workspace = true } | ||
authors = ["Jakub <[email protected]>", "Kaloyan <[email protected]>"] | ||
repository = { workspace = true } | ||
edition = { workspace = true } | ||
license = { workspace = true } | ||
|
||
[lib] | ||
crate-type = ["cdylib"] | ||
|
||
[features] | ||
testutils = ["soroban-sdk/testutils"] | ||
|
||
[dependencies] | ||
decimal = { workspace = true } | ||
curve = { workspace = true } | ||
phoenix = { workspace = true } | ||
soroban-sdk = { workspace = true } | ||
|
||
[dev_dependencies] | ||
soroban-sdk = { workspace = true, features = ["testutils"] } | ||
pretty_assertions = { workspace = true } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
default: all | ||
|
||
all: lint build test | ||
|
||
test: build | ||
cargo test | ||
|
||
build: | ||
cargo build --target wasm32-unknown-unknown --release | ||
|
||
lint: fmt clippy | ||
|
||
fmt: | ||
cargo fmt --all | ||
|
||
clippy: build | ||
cargo clippy --all-targets -- -D warnings | ||
|
||
clean: | ||
cargo clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# VESTING | ||
|
||
TODO! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
use soroban_sdk::{contract, contractimpl, contractmeta, Address, Env, Vec}; | ||
|
||
use curve::Curve; | ||
|
||
// Metadata that is added on to the WASM custom section | ||
contractmeta!(key = "Description", val = "Phoenix Protocol Vesting"); | ||
|
||
#[contract] | ||
pub struct Vesting; | ||
|
||
pub trait VestingTrait { | ||
// Sets the token contract addresses for this pool | ||
fn initialize(env: Env, admin: Address); | ||
|
||
fn create_vesting_accounts(env: Env, accounts: Vec<Address>); | ||
|
||
fn transfer_token(env: Env, from: Address, to: Address, amount: i128); | ||
|
||
fn transfer_vesting(env: Env, from: Address, to: Address, amount: i128, curve: Curve); | ||
|
||
fn burn(env: Env, amount: i128); | ||
|
||
fn mint(env: Env, sender: Address, to: Address, amount: i128); | ||
|
||
fn update_minter(env: Env, sender: Address, new_minter: Address); | ||
|
||
// fn send(env: Env, ) | ||
} | ||
|
||
#[contractimpl] | ||
impl VestingTrait for Vesting {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#![no_std] | ||
mod contract; | ||
mod storage; | ||
|
||
pub mod token_contract { | ||
// The import will code generate: | ||
// - A ContractClient type that can be used to invoke functions on the contract. | ||
// - Any types in the contract that were annotated with #[contracttype]. | ||
soroban_sdk::contractimport!( | ||
file = "../../target/wasm32-unknown-unknown/release/soroban_token_contract.wasm" | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
use soroban_sdk::String; | ||
|
||
pub struct VestingTokenInfo { | ||
pub name: String, | ||
pub symbol: String, | ||
pub decimals: u8, | ||
} |