Giter Club home page Giter Club logo

nftx-protocol-v2's People

Contributors

0xkiwi avatar alexgausman avatar capsicle1 avatar dependabot[bot] avatar tomwade avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nftx-protocol-v2's Issues

Is this project active?

Hi all.

I want to help, but I want to know if this project is active. Is this project active?

NFTXLPStaking is not upgrade safe

I run npx hardhat run scripts/deploy.js --network rinkeby and got this error

Error: Contract NFTXLPStaking is not upgrade safe
contracts\solidity\util\Address.sol:167: Use of delegatecall is not allowed

What should I fix?

Unable to "mint" vault tokens received via flashloan.

I am able to receive vault tokens via flashloan & redeem an NFT from the vault but I am unable to put the NFT back in the vault (to receive vault tokens) which I assumed was done by calling mint on the vault token contract, due to reentrancy.

Here is a contrived example using some boilerplate from tests:

To reproduce:

First request a flashloan from the vault:

bytes memory data = abi.encode(Action.NORMAL);
nftx.flashLoan(address(this), SOME_ADDRESS, SOME_AMOUNT, data);

Then in the callback:

 function onFlashLoan(
        address user,
        address token,
        uint256 value,
        uint256 fee,
        bytes calldata data
    ) external returns (bytes32) {

   uint256[] memory ids;
   nftx.redeem(1, ids);
}

Then in onERC721Received:

function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external override returns (bytes4) {

        // try to immediately return the nft back to the vault
     
        uint256[] memory tokenIds = new uint256[](1);
        tokenIds[0] = tokenId;

        IERC721(msg.sender).setApprovalForAll(address(nftx), true);

        uint256[] memory amounts;

        // Error: VM Exception while processing transaction: reverted with reason string �y� ReentrancyGuard: reentrant call'
        nftx.mint(tokenIds, amounts); 

        return 0x150b7a02;
    }

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.