Safe, simple, flexible building-blocks for smart-contract systems.
Execute transactions & sequences of transactions by proxy
This contract implements a very useful utility called a proxy. It is deployed as a standalone contract, and can then be used by the owner to execute code.
A user would pass in the bytecode for the contract as well as the calldata for the function they want to execute.
The proxy will create a contract using the bytecode. It will then delegatecall the function and arguments specified in the calldata. Loading in this code is more efficient than jumping to it.
This can be very useful for securing complex applications. Because
msg.value properties, internal functions can be set
to only accept calls coming from the proxy through an ownership model like
ds-auth. In this manner as long as
the proxy is not compromised, the internal system is protected from outsider
access. Should the owner of the internal calls ever need to be changed, this is
as simple as updating the owner of
ds-proxy rather than manualy updating each
individual internal function call, making it much more secure and adaptable.
Due to restrictions in the EVM instruction set such as being unable to be nested
dynamically sized types and arguments, 1 transaction could be done at a time.
ds-proxy takes in bytecode of a contract, rather than relying on a
pre-deployed contract, customized script contracts can be used. These script
contracts share a very a important property in that they enable a sequence of
actions to be executed atomically (all or nothing). This prevents having to
manually rollback writes to contracts when a single transaction fails in a set
Deploy DSProxyFactory. (Optional - DSProxy can be deployed directly)
dapp create DSProxyFactory
Call the build function in DSProxyFactory to create a proxy for you. (Optional)
seth send <DSProxyFactoryAddr> "build()(address)"
Create a contract and compile using solc.
dapp build MyCustomContract
Get the calldata for the function and arguments you want to execute
seth calldata "<functionName>(<argType1>,<argType2>...<argTypeN>)(<returnArgType>)" <arg1> <arg2> <argN>
Pass the contract bytecode and calldata to the execute function inside the deployed DSProxy.
seth send <DSProxyAddr> "execute(bytes,bytes)(bytes32)" <ContractByteCode> <CallData>
We believe that the free software movement is the most important cultural predecessor to the modern-day renaissance in decentralized technologies.
To catalyze the growth of this ecosystem, and to empower hackers to participate, we’re building a comprehensive suite of blockchain-oriented developer tools in the spirit of the Unix philosophy.
Dapp is all you need to start developing for Ethereum. It creates new dapps, runs Solidity unit tests, debugs, deploys, launches testnets, and more.
Seth is a handy tool for slicing and dicing transactions, querying the blockchain, converting between data formats, performing remote calls, and other everyday tasks.
Hevm is our own EVM
implementation with a nimble terminal-based Solidity debugger.
It’s used for
We also maintain Dappsys, an audited collection of smart contract building blocks designed to complement each other. They include;
ds-token— a generic EIP-20 coin;
ds-group— a multisig;
ds-guard— a flexible authority rule;
ds-proxy— a transaction proxy; and
ds-cache— a store of expiring values.
Using these proven parts lets us focus on the novel features of the systems we develop. We share Dappsys to benefit the smart contract ecosystem.