Smart contracts powering Spectrum Protocol on Terra

Overview

Spectrum Core Contracts

This monorepository contains the source code for the core smart contracts implementing Spectrum Protocol on the Terra blockchain.

Development

Environment Setup

  • Rust v1.44.1+
  • wasm32-unknown-unknown target
  • Docker
  1. Install rustup via https://rustup.rs/

  2. Run the following:

rustup default stable
rustup target add wasm32-unknown-unknown
  1. Make sure Docker is installed

Unit / Integration Tests

Each contract contains Rust unit and integration tests embedded within the contract source directories. You can run:

cargo unit-test
cargo integration-test

Compiling

After making sure tests pass, you can compile each contract with the following:

RUSTFLAGS='-C link-arg=-s' cargo wasm
cp ../../target/wasm32-unknown-unknown/release/{contract_module}.wasm .
ls -l {contract_module}.wasm
sha256sum {contract_module}.wasm

Production

For production builds, run the following:

docker run --rm -v "$(pwd)":/code \
  --mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \
  --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
  cosmwasm/workspace-optimizer:0.11.5

This performs several optimizations which can significantly reduce the final size of the contract binaries, which will be available inside the artifacts/ directory.

License

Copyright 2020 Spectrum Protocol

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

See the License for the specific language governing permissions and limitations under the License.

You might also like...
Ticketed Discreet Log Contracts (DLCs) to enable instant buy-in for wager-like contracts on Bitcoin.
Ticketed Discreet Log Contracts (DLCs) to enable instant buy-in for wager-like contracts on Bitcoin.

dlctix Ticketed Discreet Log Contracts (DLCs) to enable instant buy-in for wager-like contracts on Bitcoin. This project is part of the Backdrop Build

Smart contracts for Ref Finance

Ref Finance Contracts This mono repo contains the source code for the smart contracts of Ref Finance on NEAR. Contracts Contract Reference Description

Skyward Finance smart-contracts

Build and Init ./build.sh near dev-deploy res/skyward.was export CONTRACT_ID=skyward.testnet near call $CONTRACT_ID new --account_id=$CONTRACT_ID Regi

Rust client to Opensea's APIs and Ethereum smart contracts

opensea.rs Rust bindings & CLI to the Opensea API and Contracts CLI Usage Run cargo r -- --help to get the top level help menu: opensea-cli 0.1.0 Choo

A framework for creating PoC's for Solana Smart Contracts in a painless and intuitive way

Solana PoC Framework DISCLAIMER: any illegal usage of this framework is heavily discouraged. Most projects on Solana offer a more than generous bug bo

A template to build smart contracts in Rust to run inside a Cosmos SDK module on all chains that enable it.

CosmWasm Starter Pack This is a template to build smart contracts in Rust to run inside a Cosmos SDK module on all chains that enable it. To understan

Create your personal token with rust smart contracts

Solana Rust Token 💰 This application written Rust using Anchor ⚓

This is a node implementation of Thippy, a Substrate parachain for smart contracts

Thippy ‒- A Smart Contracts Parachain This is a node implementation of Thippy, a Substrate parachain for smart contracts. Developing Smart Contracts f

Rust library for build smart contracts on Internet Computer, by the Spinner.Cash team.

Spinner Rust library for building smart contracts on the Internet Computer. More specifically it is used by Spinner.Cash, a decentralized layer-2 prot

Comments
  • not able to withdraw

    not able to withdraw

    Hello SPEC devs & admins,

    I had been trying to perform some transactions with my terra station wallet on SPEC. I've tried various other types of transactions on SPEC as well such as unstake gov tokens, and they've all failed as well (Oct 1, 2021). I've also tested that my terra wallet works without error, by performing some small exchange transactions using the desktop terra wallet.

    In any case, here's the withdraw transaction that I'm interested in performing but was unable due to failure. Here's my system info.

    I have macos Mojave; chromium version 88.0.4324.150 (x86_64); using the terra station chrome plugin. Trying to withdraw Spec-UST LP. I've clicked on that box for that LP, clicked withdraw tab, clicked MAX, clicked withdraw (pink) button; then it asks me to confirm transaction, then I press the pink 'confirm' button, which causes Terra station plugin to popup, where it asks me to confirm with password, which I did, and Terra station chrome extenstion looked like it worked, but then on the Spectrum page, it shows error. Furthermore, I've clicked on the referenced hash string, and on the https://finder.extraterrestrial.money/columbus-5/tx/... page it says status failed, with error msg: " failed to execute message; message index: 0: Error parsing into type spectrum_protocol::spec_farm::ExecuteMsg: unknown variant ..., expected one of receive, register_asset, unbond, update_config, withdraw: execute wasm contract failed". I can send you the transaction hash in private if needed.

    I also went to desktop terra station wallet and looked at the history tab on the sidebar, and it showed all the same errors as the finder.extraterrestrial.money page

    The last time I was able to successfully perform transactions on SPEC protocol was September 24th, 2021, before switching to columbus 5.

    Here you can see some of the failures https://finder.terra.money/columbus-5/address/terra1s5eczhe0h0jutf46re52x5z4r03c8hupacxmdr

    opened by holajoyce 4
  • VKRUST LP

    VKRUST LP

    I'm not sure if this is a Spectrum issue or a Valkyrie issue. Because VKR no longer compounds, I removed my liquidity. However, I removed it as VKR-UST LP and was going to deposit it back on Valkyrie.

    However, there is no option to deposit the LP on VKR, just the individual VKR + UST and now I have no way to convert the LP to the individual tokens. I know this is probably a question for Valkyrie, but your customer support is infinitely better, and I'm open to any suggestions.

    opened by Cryptograk 3
  • Unable to unstake gov tokens from MINE-UST LP

    Unable to unstake gov tokens from MINE-UST LP

    When I try to unstake governance token from MINE-UST LP it gives the following error: "rpc error: code = InvalidArgument desc = failed to execute message; message index: 1: dispatch: Error parsing into type pylon_token::gov_msg::ExecuteMsg: unknown variant withdraw_voting_tokens, expected one of receive, update_config, poll, staking, airdrop: execute wasm contract failed: invalid request"

    image

    opened by ArtZab0 1
  • Welcome Spectrum Finance to Terra!

    Welcome Spectrum Finance to Terra!

    Hello there! Glad I get to bet the first to write this. Looking forward to the audit as well as future participation in this project.

    Would love to get to know the team better as well as ambitions, roadmap, etc.

    Is there plans for a discord community?

    Cheers 😎

    opened by Cle4ncuts 1
Releases(2021-07-04)
Owner
Spectrum Protocol
The First and Innovative yield optimizer on Terra Ecosystem, auto-compound and auto-stake your Mirror, Anchor, and Pylon farm rewards.
Spectrum Protocol
This monorepository contains the source code for the smart contracts implementing bAsset Protocol on the Terra blockchain.

Crll bAsset Contracts This monorepository contains the source code for the smart contracts implementing bAsset Protocol on the Terra blockchain. You c

null 3 Mar 29, 2024
My code for the terra.academy course on CosmWasm smart contracts

CosmWasm Starter Pack This is a template to build smart contracts in Rust to run inside a Cosmos SDK module on all chains that enable it. To understan

Alex Incerti 0 Nov 7, 2021
Terra Trophies is a copy of Ethereum's POAP project for Terra

Terra Trophies Terra Trophies is a copy of Ethereum's POAP project for Terra. It allows anyone to create digital badges for participants of events, or

larry.{ust,sol,thor} 18 Dec 7, 2022
Minimal Substrate node configured for smart contracts via pallet-contracts.

substrate-contracts-node This repository contains Substrate's node-template configured to include Substrate's pallet-contracts ‒ a smart contract modu

Parity Technologies 73 Dec 30, 2022
Helpful functions and macros for developing smart contracts on NEAR Protocol.

near-contract-tools Helpful functions and macros for developing smart contracts on NEAR Protocol. This package is a collection of common tools and pat

Jacob 27 Dec 17, 2022
Helpful functions and macros for developing smart contracts on NEAR Protocol.

near-contract-tools Helpful functions and macros for developing smart contracts on NEAR Protocol. This package is a collection of common tools and pat

NEARFoundation 9 Aug 3, 2022
Smart Contract for Terra Name Service

TERRA NAME SERVICE CONTRACTS Terra Name Service is to create easy-to-remember names for your Terra address like ‘dokwon.ust’ instead of ‘terra1...whez

null 12 Nov 23, 2022
Opendp - The core library of differential privacy algorithms powering the OpenDP Project.

OpenDP The OpenDP Library is a modular collection of statistical algorithms that adhere to the definition of differential privacy. It can be used to b

OpenDP 176 Dec 27, 2022
Blue Terra is a decentralized protocol for the global democratization of stable and accessible property rights.

??️ The official Blue Terra KYC program. Blue Terra holders interact with this program to activate the leases embedded in their NFTs.

Blue Terra 1 Jan 31, 2022
evm2near compiles Solidity contracts into NEAR WebAssembly contracts.

EVM → NEAR evm2near is a project for compiling EVM bytecode into wasm bytecode, with the particular goal of having that wasm artifact be executable on

Aurora 125 Dec 3, 2022