All Projects → makerdao → tx-manager

makerdao / tx-manager

Licence: AGPL-3.0 license
Solidity contract to make multiple calls in one Ethereum transaction. Used by Maker keepers.

Programming Languages

Makefile
30231 projects

Projects that are alternatives of or similar to tx-manager

offchain-oracle
Liquidity-weighted dex price oracle for offchain price discovery
Stars: ✭ 163 (+146.97%)
Mutual labels:  ethereum-contract
vue-web3
🐙 Web3 blockchain bindings for Vue.js (inspired by Vuefire and Drizzle)
Stars: ✭ 63 (-4.55%)
Mutual labels:  ethereum-contract
ehr-blockchain
Electronic Health Record (EHR) and Electronic Medical Record (EMR) systems. However, they still face some issues regarding the security of medical records, user ownership of data, data integrity etc. The solution to these issues could be the use of a novel technology, i.e., Blockchain. This technology offers to provide a secure, temper-proof pl…
Stars: ✭ 41 (-37.88%)
Mutual labels:  ethereum-contract
fund-protocol
A blockchain protocol for tokenized hedge funds
Stars: ✭ 85 (+28.79%)
Mutual labels:  ethereum-contract
cheezyverse
Cheeze Wizards is the world's first battle royale on the blockchain (with cheese!)
Stars: ✭ 38 (-42.42%)
Mutual labels:  ethereum-contract
Simple-Game-ERC-721-Token-Template
🔮 Very Simple ERC-721 Smart Contract Template to create your own ERC-721 Tokens on the Ethereum Blockchain, with many customizable Options 🔮
Stars: ✭ 83 (+25.76%)
Mutual labels:  ethereum-contract
Angular Truffle Starter Dapp
Angular CLI + Truffle Starter Dapp; write, compile & deploy smart contracts on Ethereum blockchains
Stars: ✭ 174 (+163.64%)
Mutual labels:  ethereum-contract
ProveIt
Implements proof of historical data possession on the Ethereum blockchain
Stars: ✭ 37 (-43.94%)
Mutual labels:  ethereum-contract
wrc20-examples
This repository contains examples of WRC20 tokens written in different languages.
Stars: ✭ 12 (-81.82%)
Mutual labels:  ethereum-contract
eth-self-token-example
在本地网络发布一个名叫 YuTou 的 token
Stars: ✭ 8 (-87.88%)
Mutual labels:  ethereum-contract
ddash
DDASH - Ethereum Operating System for Knowledge Creation and Sharing
Stars: ✭ 26 (-60.61%)
Mutual labels:  ethereum-contract
web3jdemo
功能强大的web3j以太坊用例,支持批量生成钱包,批量不同账户转账,查询余额等,监控,定时任务,交易mint等方法,持续更新中... ...
Stars: ✭ 262 (+296.97%)
Mutual labels:  ethereum-contract
Poolz-Back
smart contracts using solidity for erc20 tokens to eth and erc20 to erc20
Stars: ✭ 15 (-77.27%)
Mutual labels:  ethereum-contract
HeritableWallet
Personal "bank account" contract on Ethereum with inheritance setup feature
Stars: ✭ 23 (-65.15%)
Mutual labels:  ethereum-contract
solidity-itMapsLib
Iterable maps library for Ethereum Solidity
Stars: ✭ 19 (-71.21%)
Mutual labels:  ethereum-contract
Ethereum Graph Debugger
Ethereum solidity graph plain debugger. To have the whole picture when debugging.
Stars: ✭ 177 (+168.18%)
Mutual labels:  ethereum-contract
solidity-contracts
📦 Resources for the Ethereum Smart Contract Development tutorial series.
Stars: ✭ 64 (-3.03%)
Mutual labels:  ethereum-contract
amm-arbitrageur
An arbitrage bot between Uniswap AMMs
Stars: ✭ 1,102 (+1569.7%)
Mutual labels:  ethereum-contract
angle-core
Smart contracts for the Core Module and the governance of the Angle Protocol
Stars: ✭ 56 (-15.15%)
Mutual labels:  ethereum-contract
ethereum-dapp-ipfs-node.js-mongodb
以太坊开发DApp实战教程——用区块链、星际文件系统(IPFS)、Node.js和MongoDB来构建电商平台
Stars: ✭ 46 (-30.3%)
Mutual labels:  ethereum-contract

Overview

This repository contains a transaction manager contract, allowing its owner to make multiple contract calls in one Ethereum transaction. This saves time, but what's most important it allows things like multi-step arbitrage to be executed in one transaction.

This transaction manager also helps to deal with ERC20 token transfers. If we haven't done anything to solve this issue, the transaction manager contract would have to own all funds (ERC20 tokens) any of the calls made by it may need. In our approach, requested ERC20 tokens all transferred from the caller to the transaction manager contract before the first call is made and returned to the caller after the last call.

The transaction manager needs to be approved to access ERC20 tokens. Because of that, we only allow the transaction manager to be used only by its owner.

Contract deployment

The TxManager contract takes no parameters.

Use Dapp (https://github.com/dapphub/dapp) to build and deploy the contract:

dapp build
ETH_GAS=2000000 dapp create TxManager

Contract usage

The contract has only one public function:

function execute(address[] tokens, bytes script) { … }

The tokens parameter is an array of ERC20 token addresses. For each of them, the maximum available allowance will be transferred from the caller to the contract before the first call. Remaining balances of each of these tokens will be returned to the caller after the last call.

The script parameter is a byte array representing the sequence of contract calls to be made. It consists of multiple call records concatenated together, whereas each record is built as follows:

+-----------------+---------------------+-----------------------...------+
|     address     |   calldata length   |         calldata               |
|                 |                     |                                |
|   (20 bytes)    |      (32 bytes)     |                                |
+-----------------+---------------------+-----------------------...------+

For example, if you want to make one call to 0x11111222223333344444333332222211111122222, the script may look like this 111112222233333444443333322222111111222220000000000000000000000000000000000000000000000000000000000000024a39f1c6c0000000000000000000000000000000000000000000000000000000000000064, the last part of it being calldata encoded with:

$ seth calldata 'cork(uint256)' 100
0xa39f1c6c0000000000000000000000000000000000000000000000000000000000000064

The script parameter should be a concatenation of records of all calls to be made.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].