Git Product home page Git Product logo

decenterlized-lottery-with-foundry's Introduction

Hi ๐Ÿ‘‹, I'm Usman Farooq

abossofmyself 0xsiddique

I'm a Solidity Smart Contract developer and Security Researcher.


  • ๐Ÿ”ญ Iโ€™m currently working on Ethereum Smart Contracts

  • ๐Ÿ‘ฏ Iโ€™m looking to collaborate on Open Source projects

  • ๐Ÿ‘จโ€๐Ÿ’ป All of my projects are available here

  • ๐Ÿ’ฌ Ask me about Smart Contracts (Solidity) and Blockchain

  • ๐Ÿ“ซ To reach me DM on Twitter

Blockchains

ethereum binance

Programming Lanugages

solidity python

Smart Contract Frameworks

foundry brownie

Off-Chain

mongoDB

decenterlized-lottery-with-foundry's People

Contributors

usmanfarooq91 avatar

Watchers

 avatar

decenterlized-lottery-with-foundry's Issues

How would you write an integration test for Integrations.s.sol?

Came across your repo and I am stuck on the problem:
There are three contracts -
import {CreateSubscription, FundSubscription, AddConsumer} from "../../script/Interactions.s.sol";
This is my soln to the CreateSubscription

function testCreateSubscriptionReturnsSubId() public {
        //Arrange
        CreateSubscription createSubscription = new CreateSubscription();
        uint64 testSubId = createSubscription.createSubscription(
            vrfCoordinator,
            deployerKey
        );
        //Act
        vm.recordLogs();
        VRFCoordinatorV2Mock(vrfCoordinator).createSubscription();
        Vm.Log[] memory entries = vm.getRecordedLogs();
        bytes32 subId = entries[0].topics[1];
        console.log("subId:", uint64(uint160(uint256(subId))));
        console.log("testSubId: ", testSubId);

        //Assert
        assert(testSubId == (uint64(uint160(uint256(subId))) - 1));
        //The mock gives the next subscriptionID! see the working below:
        //function createSubscription() external override returns (uint64 _subId) {
        //s_currentSubId++;
    }

Is that a valid approach?
Also, how do the test for the other two?
Thanks for your time.

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.