This repository contains the smart contracts for AthletiFi, developed on the Polygon network.
- Solidity: The primary language for Ethereum smart contracts.
- Truffle: A development environment for compiling, testing, and deploying Ethereum smart contracts.
- OpenZeppelin: A library for secure smart contract development.
-
Clone the Repository:
git clone https://github.com/AthletiFi/smart-contracts.git cd smart-contracts
-
Install Dependencies:
yarn install
-
Compile Contracts:
truffle compile
Automated test using yarn:
yarn test
-
Start Truffle Console:
truffle develop
This command starts a local Ethereum blockchain and provides you with a set of available accounts and their private keys. It also opens a Truffle console where you can run Truffle commands directly.
-
Compile Contracts (if you haven't already):
Inside the Truffle console:
compile
-
Migrate Contracts:
Deploy your contracts to the local development network:
migrate --reset
-
Run Tests:
test
-
Exit the Truffle Console:
To leave the Truffle console, type:
.exit
Remember, when using truffle develop
, you don't need to prefix commands with truffle
inside the Truffle console.
Note: If you ever want to use an external Ganache or Geth instance for deployment while using the Truffle console, you can do so by running migrate --network development
. This will use the "development" configuration in truffle-config.js
.
Another Note: If you would like to use the built-in development blockchain without entering the Truffle console, you can run truffle develop --log
. You would then need to run truffle commands in a separate terminal window and add the --network develop
flag to each command.
After deploying your contracts, you can interact with them directly in the Truffle development console:
For example, to get the owner of the VSASummer23NFT
contract:
const nft = await VSASummer23NFT.deployed();
const owner = await nft.owner();
console.log(owner);
Once you're done, you can exit the console by typing .exit
.
For deployment and minting instructions, see Deploying to Polygon.
If you wish to contribute to the development of these smart contracts, please submit a pull request or open an issue to discuss the changes.
This software is licensed under the BSD 3-Clause License. For full license details, see the LICENSE file in this repository.