GithubHelp home page GithubHelp logo

fuel-contract-deployment's Introduction


Deploying a Contract on Fuel Network

image

##Install Dependencies ----

sudo apt update
sudo apt upgrade -y
sudo apt-get install curl screen -y 

image

Installing RUST

curl --proto '=https' --tlsv1.3 https://sh.rustup.rs -sSf | sh
source $HOME/.cargo/env
rustc --version

image

rustup install stable
rustup update stable
rustup default stable

image

Install GIT

image

sudo apt install git -y 

Install Fuel Toolchain

image

curl https://install.fuel.network | sh

press y then enter

image

Setting PATH

image

source /root/.bashrc

Setting FUELUP

fuelup toolchain install latest
fuelup self update
fuelup update && fuelup default latest

Creating PROJECT

image

mkdir fuel-project && cd fuel-project
forc new counter-contract

Editing Contract

image

nano counter-contract/src/main.sw

Clear/delete everything and paste below code

contract;
 
storage {
    counter: u64 = 0,
}
 
abi Counter {
    #[storage(read, write)]
    fn increment();
 
    #[storage(read)]
    fn count() -> u64;
}
 
impl Counter for Contract {
    #[storage(read)]
    fn count() -> u64 {
        storage.counter.read()
    }
 
    #[storage(read, write)]
    fn increment() {
        let incremented = storage.counter.read() + 1;
        storage.counter.write(incremented);
    }
}

Save and exit with Ctrl X + y and click ENTER


Build Contract

image

cd counter-contract
forc build 

image

Deploying Contract

Remember, you will need your FUEL wallet here, i will be importing mine, if you don't have wallet, Install from here

image

Importing wallet

image

forc wallet import 

image

and copy and paste on terminal

image

Note: password are always invincible


Create Account

forc wallet account new

image

Import account and input password

Check Address

forc wallet accounts

Deploy Contract

image

forc deploy --testnet 

Enter 0 as Index and click y

image

CONTRACT DEPLOYED


EXPLORER

FUEL EXPLORER


fuel-contract-deployment's People

Contributors

mztacat avatar

Stargazers

Amiralinft1 avatar Ali avatar AmirRezaeian avatar  avatar Vinny avatar  avatar  avatar  avatar  avatar  avatar Temitope Olusanya avatar  avatar  avatar Kayne  avatar  avatar  avatar sheggzie avatar Kubilay Bıyıkoğlu avatar bisgtrongboy avatar Kaspy avatar thejoyboy avatar  avatar  avatar rachid avatar Josep avatar  avatar  avatar  avatar  avatar  avatar  avatar Ruan Farais Gaia avatar  avatar Karthikeyan Velusamy avatar maleek435 avatar Prasad Reddy avatar  avatar  avatar vittawac avatar Ultraviolet avatar bsvbox avatar  avatar  avatar Victor Aloaye avatar  avatar ibeh christopher avatar FrostyFlakes avatar Mukesh avatar Agat Golik avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar bpnthp avatar  avatar  avatar TEAMSMALLZ avatar Cjryme avatar Chander avatar Ody avatar  avatar Omeje, Kingsley Amaobi avatar Success avatar  avatar  avatar benjoz76 avatar Kindy avatar  avatar maxsii avatar  avatar  avatar Denis avatar Afolabi Alex  avatar  avatar  avatar Mayoress avatar killmongernft avatar Nabajyoti avatar epikuri avatar smmroms avatar  avatar IRe avatar Opeyemi Rowland avatar  avatar asumpta0910 avatar  avatar  avatar Omeiza avatar Dom avatar Qudus Salaudeen avatar  avatar Bugs avatar neyshaa avatar Hmusky avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.