Coder Social home page Coder Social logo

upgradeable-proxy's People

Contributors

theblockstalk 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

Watchers

 avatar  avatar  avatar

upgradeable-proxy's Issues

VM Exception While Processing Revert.

Hello, I am having trouble replicating your work, which overall is great.

I am using Truffle5 and Solc 0.4.23;

I am following along using a basic uint256 operations contract:

`
pragma solidity ^0.4.23;

import "../upgradeable/upgradeable.sol";

contract CalculatorV5 is Upgradeable {
uint256 internal _count;

constructor(uint256 count)public {
    _count = count;
}

function increment(uint256 amount)
    public
    returns (bool)
{
    require(amount > 0, "amount must be positive");
    _count = _count + amount;
    return true;
}

function getCount()
    external
    view
    returns(uint256)
{
    return _count;
}

}

For test using a .js type of tests (vs .sol):

const UpgradeableProxy = artifacts.require('./upgradeable.sol')
const CalculatorV5 = artifacts.require('./CalculatorV5.sol');
const CalculatorV6 = artifacts.require('./CalculatorV6.sol')
contract('Calculator', (accounts) => {
    beforeEach(async () => {     
        calcV5 = await CalculatorV5.new(100);    
        uproxy = await UpgradeableProxy.new(calcV5.address);
        calcV5Proxy =  await CalculatorV5.at(uproxy.address);
        await calcV5Proxy.initialize();
    });
   it('calc v5 should equal 100',async () => {
        let value = await calcV5Proxy.getCount({from:accounts[1]});
       // also tried  let value = await calcV5Proxy.getCount();
     // as well as  let value = await calcV5Proxy.getCount.call();
        assert.equal(value, 100);
    });

When I run it the before each works perfectly, emits the event Initalized, but fails on the test with this vague response:

Contract: Calculator
calc v5 should equal 100:
Error: Returned error: VM Exception while processing transaction: revert

Please let me know if you need more information. Thanks!

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.