Vyper.

Trang chủ

Chào mừng đến với Diễn đàn Cộng đồng Vyper

Bài viết

2
  • 0x8744...6532.
    Apr 20, 2023
    Hỏi đáp Chuyên Gia

    How to deploy a factory contract in vyper?

    I have a contract in vyper that looks as such: I'm a comment! SPDX-License-Identifier: MIT @version ^0.3.7 If remix isn't updated use version: ^0.2.16 myFavoriteNumber: uint256 struct Person: favoriteNumber: uint256 name: String[100] Static Array/List listOfPeople: public(Person[5]) listOfPeopleIndex: uint256 nameToFavoriteNumber: HashMap[String[100], uint256] @external def store(_favoriteNumber: uint256): self.myFavoriteNumber = _favoriteNumber @external @view def retrieve() -> uint256: return self.myFavoriteNumber @external def addPerson(_name: String[100], _favoriteNumber: uint256): newPerson: Person = Person({favoriteNumber: _favoriteNumber, name: _name}) self.listOfPeople[self.listOfPeopleIndex] = newPerson self.listOfPeopleIndex += 1 self.nameToFavoriteNumber[_name] = _favoriteNumber And I'd like another contract to be able to deploy this contract. In solidity this is as easy as an import. But how do I do this in vyper? In solidity, I'd do: // SPDX-License-Identifier: MIT pragma solidity ^0.8.19; import "./SimpleStorage.sol"; contract StorageFactory { SimpleStorage[] public listOfSimpleStorageContracts; function createSimpleStorageContract() public { SimpleStorage simpleStorageContractVariable = new SimpleStorage(); // SimpleStorage simpleStorage = new SimpleStorage(); listOfSimpleStorageContracts.push(simpleStorageContractVariable); } } `

    • #Vyper
    1
    1
  • BalanceBeads.
    Mar 09, 2023
    Hỏi đáp Chuyên Gia

    Social links to Vyper

    Can we know more what it is Vyper, what it does? Can we get some social links? Thank you.

    • #Vyper
    2
    2
    Câu trả lời hay nhất

Vyper is a relatively new, pythonic programming language used to write smart contracts. Vyper targets Ethereum Virtual Machine making it virtually impossible for developers to code misleading programs.

2Bài viết3Câu trả lời
Sui.X.Peera.

Kiếm phần của bạn từ 1000 Sui

Tích lũy điểm danh tiếng và nhận phần thưởng khi giúp cộng đồng Sui phát triển.

Các thẻ hàng đầu
  • #Vyper
  • #Smart Contract
  • #EVM
  • #Remix IDE
  • #Vyper compiler
  • Vyper by Example
  • Built-in Functions
  • NatSpec Metadata
Chúng tôi sử dụng cookie để đảm bảo bạn có trải nghiệm tốt nhất trên trang web của chúng tôi.
Thêm thông tin