Giter VIP home page Giter VIP logo

decentragram's People

Contributors

xternet 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

decentragram's Issues

Unable to run React app

Module not found: Error: Can't resolve 'http' in '/home/[email protected]/Downloads/decentragram/node_modules/web3-providers-http/lib'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "http": require.resolve("stream-http") }'
- install 'stream-http'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "http": false }

issue to compile contract

Invalid type for argument in function call. Invalid implicit conversion from address to address payable requested.
`pragma solidity >=0.5.0;

contract Decentragram {
string public name;
uint256 public imageCount = 0;
mapping(uint256 => Image) public images;

struct Image {
    uint256 id;
    string hash;
    string description;
    uint256 tipAmount;
    address payable author;
}

event ImageCreated(
    uint256 id,
    string hash,
    string description,
    uint256 tipAmount,
    address payable author
);

event ImageTipped(
    uint256 id,
    string hash,
    string description,
    uint256 tipAmount,
    address payable author
);

constructor() public {
    name = "Decentragram";
}

function uploadImage(string memory _imgHash, string memory _description)
    public
{
    // Make sure the image hash exists
    require(bytes(_imgHash).length > 0);
    // Make sure image description exists
    require(bytes(_description).length > 0);
    // Make sure uploader address exists
    require(msg.sender != address(0));

    // Increment image id
    imageCount++;

    // Add Image to the contract
    images[imageCount] = Image(
        imageCount,
        _imgHash,
        _description,
        0,
        msg.sender
    );
    // Trigger an event
    **emit ImageCreated(imageCount, _imgHash, _description, 0, msg.sender);**

//the error is just because msg.sender is address and we can't pass an address to address payable
}

function tipImageOwner(uint256 _id) public payable {
    // Make sure the id is valid
    require(_id > 0 && _id <= imageCount);
    // Fetch the image
    Image memory _image = images[_id];
    // Fetch the author
    address payable _author = _image.author;
    // Pay the author by sending them Ether
    address(_author).transfer(msg.value);

//"send" and "transfer" are only available for objects of type "address payable", not "address".

    // Increment the tip amount
    _image.tipAmount = _image.tipAmount + msg.value;
    // Update the image
    images[_id] = _image;
    // Trigger an event
    emit ImageTipped(
        _id,
        _image.hash,
        _image.description,
        _image.tipAmount,
        _author
    );
}

}
`

tips

is it possible to change the tip using our custom bep20/ erc20 contract / token instead of eth/BNB?

Images wont load

When I upload and run the website it only displays the most recently uploaded image, and none of the other previously uploaded images. Even if it has the most tips it just shows a tiny icon for a image not the actual image uploaded. I figured it would be in app.js to configure but I cannot find a way as of now.

issure regarding ipfs

While uploading image i am receiving error saying project id required.
is it necessary to create account in infura ipfs as it asks for credit card details.

First Truffle Test In Tutorial Fails

I get this error

Compiling your contracts...

Everything is up to date, there is nothing to compile.

Contract: Decentragram
1) "before all" hook in "Contract: Decentragram"

0 passing (38ms)
1 failing

  1. Contract: Decentragram
    "before all" hook in "Contract: Decentragram":
    Error: Decentragram has not been deployed to detected network (network/artifact mismatch)
    at Object.checkNetworkArtifactMatch (/usr/local/lib/node_modules/truffle/build/webpack:/packages/contract/lib/utils/index.js:249:1)
    at Function.deployed (/usr/local/lib/node_modules/truffle/build/webpack:/packages/contract/lib/contract/constructorMethods.js:84:1)
    at process._tickCallback (internal/process/next_tick.js:68:7)

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.