Giter Club home page Giter Club logo

dipper-protocol's People

Contributors

cpucorecore avatar hot13500 avatar hot3246624 avatar iavl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

iavl jese1987 dydix

dipper-protocol's Issues

dipcli support calldata arrays interacting with contract

Hello, could dipcli support array parameters, this is very useful.

solidity code:

function f(address[] memory addrs)

dipcli commands line:

dipcli vm call --from=xxxx \
...
--args="[$(dipcli keys show jack -a),$(dipcli keys show bob -a)]" \
--gas=9531375 -b block

The query logic will panic When the VM executes reverted

sun:contracts/ (master) $ dipcli q vm call dip18dmyzdjl37lvl3jn2c5hzdnnflwwtzh4g5lsn6 dip1qv6qtq99996aea0fw09qeu9y0v48w3n5208khk qm ./receiver.abi --amount 0pdip --args=''
panic: UnmarshalJSON cannot decode empty bytes

goroutine 1 [running]:
github.com/tendermint/go-amino.(*Codec).MustUnmarshalJSON(...)
/Users/sun/go/pkg/mod/github.com/tendermint/[email protected]/amino.go:445
github.com/Dipper-Labs/Dipper-Protocol/app/v0/vm/client/cli.GetCmdQueryCall.func1(0xc001346840, 0xc0001abf80, 0x4, 0x7, 0x0, 0x0)
/Users/sun/go/src/github.com/Dipper-Labs/Dipper-Protocol/app/v0/vm/client/cli/query.go:356 +0xaf5
github.com/spf13/cobra.(*Command).execute(0xc001346840, 0xc0001abf10, 0x7, 0x7, 0xc001346840, 0xc0001abf10)
/Users/sun/go/pkg/mod/github.com/spf13/[email protected]/command.go:838 +0x47c
github.com/spf13/cobra.(*Command).ExecuteC(0xc0003b02c0, 0x47f69e5, 0xc0003b02c0, 0x4c6c238)
/Users/sun/go/pkg/mod/github.com/spf13/[email protected]/command.go:943 +0x336
github.com/spf13/cobra.(*Command).Execute(...)
/Users/sun/go/pkg/mod/github.com/spf13/[email protected]/command.go:883
github.com/tendermint/tendermint/libs/cli.Executor.Execute(0xc0003b02c0, 0x4e66b38, 0x3, 0xc0013007a0)
/Users/sun/go/pkg/mod/github.com/!dipper-!labs/[email protected]/libs/cli/setup.go:89 +0x3c
main.main()
/Users/sun/go/src/github.com/Dipper-Labs/Dipper-Protocol/cmd/dipcli/main.go:65 +0x3bd

could dipper contract support fallback function ?

Hi!

A contract can have exactly one unnamed function. This function cannot have arguments, cannot return anything and has to have external visibility. It is executed on a call to the contract if none of the other functions match the given function identifier (or if no data was supplied at all).

Furthermore, this function is executed whenever the contract receives plain DIP (without data). To receive DIP and add it to the total balance of the contract, the fallback function must be marked payable. If no such function exists, the contract cannot receive DIP through regular transactions and throws an exception.

Like any function, the fallback function can execute complex operations as long as there is enough gas passed on to it.

In the current version, transferring funds directly to the contract will not trigger the execution of the smart contract code.

In some scenarios, such as auctions or crowdfunding scenarios, fallback function may provide convenience for developers and users. For example, users can transfer DIP directly to contract through wallets and interact with dapps without using browser plug-ins.

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.