dev-resources.site
for different kinds of informations.
Try Vyper in Truffle v5.
Published at
12/19/2018
Categories
ethereum
vyper
truffle
Author
sot528
Author
6 person written this
sot528
open
Truffle v5 supported Vyper.
I made Docker image to try it easialy.(Dockerfile)
How to use
docker run -it sot528/truffle-vyper-test
In the container
It unboxed vyper-example-box. So you can use below.
$ truffle test
Using network 'test'.
Contract: VyperStorage
โ ...should store the value 89. (114ms)
1 passing (129ms)
It works.
You can try anything via editing ./contracts/VyperStorage.vy
and truffle compile
.
stored_data: uint256
@public
def set(new_value : uint256):
self.stored_data = new_value
@public
@constant
def get() -> uint256:
return self.stored_data
The test file is ./test/vyperStorage.js
.
const VyperStorage = artifacts.require("VyperStorage");
contract("VyperStorage", () => {
it("...should store the value 89.", async () => {
const storage = await VyperStorage.deployed();
// Set value of 89
await storage.set(89);
// Get stored value
const storedData = await storage.get();
assert.equal(storedData, 89, "The value 89 was not stored.");
});
});
If you see the error below, then you should remove all of the files in build
.
Error parsing /code/contracts/VyperStorage.vy: ParsedContract.sol:1:1: ParserError: Expected pragma, import directive or contract/interface/library definition.
stored_data: uint256
^---------^
Compilation failed. See above.
Truffle v5.0.0 (core: 5.0.0)
vyper Article's
24 articles in total
Vyper - Write your First Python Smart Contract (Series)
read article
vyperๆบๅฅฝ็ฉ็
read article
How to use 'initializes' and 'exports' in vyper: Modular Vyper code arrangement.
read article
A Simple Vyper smart contract to fetch the price of BTC using Chainlink and Apeworx.
read article
Vyper beginner's tutorial: Variables.
read article
Mastering Vyper Functions(part1 )
read article
How to compile, deploy and interact with smart contracts using Apeworx(ape) and VS Code.
read article
Vyper: For loops and Arrays.
read article
Mastering functions in Vyper(part2)
read article
Vyper Beginner's tutorial: Syntax and Structure.
read article
How to interact with Smart Contracts using Python and Django.
read article
How to Interact with Smart Contracts locally using web3.py
read article
Writing Smart Contracts using Vyper, Remix IDE and deploying them on BNB Smart Chain.
read article
Create your own Uniswap DeFi Application๐ฆ! From scratch using Vyper & Python๐
read article
Challenge #2: ๐ช Multi Token Vendor | Speedrun Ethereum With Vyper
read article
Introduction to EVM Smart Contract development
read article
Challenge #1: ๐ฅฉ Decentralized Staking App | Speedrun Ethereum With Vyper ๐
read article
Challenge #0: ๐ผ๏ธ Simple NFT Example | Speedrun Ethereum With Vyper ๐
read article
Understanding Chainlink VRF: A Tool for Random Number Generation on the Blockchain
read article
Constant Product Market Maker (CAMM): The standard in Decentralized Finance
read article
Compiling and testing Vyper contract using Foundry
read article
Usando constant e immutable para reduzir o custo de gรกs
read article
ERC20 Token with Vyper and Brownie
read article
Try Vyper in Truffle v5.
currently reading
Featured ones: