diff --git a/CHANGELOG.md b/CHANGELOG.md index 37f12c4cd..ebb4c91df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -76,11 +76,12 @@ needed to include double quotes around the hexadecimal string. - [#2156](https://github.com/NibiruChain/nibiru/pull/2156) - test(evm-e2e): add E2E test using the Nibiru Oracle's ChainLink impl - [#2157](https://github.com/NibiruChain/nibiru/pull/2157) - fix(evm): Fix unit inconsistency related to AuthInfo.Fee and txData.Fee using effective fee - [#2160](https://github.com/NibiruChain/nibiru/pull/2160) - fix(evm-precompile): use bank.MsgServer Send in precompile IFunToken.bankMsgSend +- [#2161](https://github.com/NibiruChain/nibiru/pull/2161) - fix(evm): added tx logs events to the funtoken related txs - [#2162](https://github.com/NibiruChain/nibiru/pull/2162) - test(testutil): try retrying for 'panic: pebbledb: closed' - [#2167](https://github.com/NibiruChain/nibiru/pull/2167) - refactor(evm): removed blockGasUsed transient variable - [#2168](https://github.com/NibiruChain/nibiru/pull/2168) - chore(evm-solidity): Move unrelated docs, gen-embeds, and add Solidity docs - [#2165](https://github.com/NibiruChain/nibiru/pull/2165) - fix(evm): use Singleton StateDB pattern for EVM txs - +- [#2169](https://github.com/NibiruChain/nibiru/pull/2169) - fix(evm): Better handling erc20 metadata #### Nibiru EVM | Before Audit 2 - 2024-12-06 The codebase went through a third-party [Code4rena diff --git a/eth/rpc/backend/backend_suite_test.go b/eth/rpc/backend/backend_suite_test.go index dec06920f..16637a86c 100644 --- a/eth/rpc/backend/backend_suite_test.go +++ b/eth/rpc/backend/backend_suite_test.go @@ -252,7 +252,7 @@ func (s *BackendSuite) buildContractCallTx( nonce uint64, gasLimit uint64, ) gethcore.Transaction { - // recipient := crypto.CreateAddress(s.fundedAccEthAddr, 29381) + //recipient := crypto.CreateAddress(s.fundedAccEthAddr, 29381) transferAmount := big.NewInt(100) packedArgs, err := embeds.SmartContract_TestERC20.ABI.Pack( diff --git a/eth/rpc/backend/gas_used_test.go b/eth/rpc/backend/gas_used_test.go index 0ad3ed0c3..8362d599f 100644 --- a/eth/rpc/backend/gas_used_test.go +++ b/eth/rpc/backend/gas_used_test.go @@ -76,10 +76,10 @@ func (s *BackendSuite) TestGasUsedFunTokens() { erc20Addr, err := eth.NewEIP55AddrFromStr(testContractAddress.String()) s.Require().NoError(err) - _, err = s.backend.GetTransactionCount(s.fundedAccEthAddr, rpc.EthPendingBlockNumber) - s.Require().NoError(err) + nonce := s.getCurrentNonce(s.node.EthAddress) + balanceBefore := s.getUnibiBalance(s.fundedAccEthAddr) - txResp, err := s.network.BroadcastMsgs(s.node.Address, &evm.MsgCreateFunToken{ + txResp, err := s.network.BroadcastMsgs(s.node.Address, &nonce, &evm.MsgCreateFunToken{ Sender: s.node.Address.String(), FromErc20: &erc20Addr, }) @@ -96,15 +96,11 @@ func (s *BackendSuite) TestGasUsedFunTokens() { ) s.Require().NoError(err) - nonce, err := s.backend.GetTransactionCount(s.fundedAccEthAddr, rpc.EthPendingBlockNumber) - s.Require().NoError(err) - - balanceBefore := s.getUnibiBalance(s.fundedAccEthAddr) - + nonce = s.getCurrentNonce(s.fundedAccEthAddr) txHash1 := SendTransaction( s, &gethcore.LegacyTx{ - Nonce: uint64(*nonce), + Nonce: nonce, To: &precompile.PrecompileAddr_FunToken, Data: packedArgsPass, Gas: 1_500_000, @@ -123,7 +119,7 @@ func (s *BackendSuite) TestGasUsedFunTokens() { txHash2 := SendTransaction( // should fail due to invalid recipient address s, &gethcore.LegacyTx{ - Nonce: uint64(*nonce + 1), + Nonce: nonce + 1, To: &precompile.PrecompileAddr_FunToken, Data: packedArgsFail, Gas: 1_500_000, @@ -134,7 +130,7 @@ func (s *BackendSuite) TestGasUsedFunTokens() { txHash3 := SendTransaction( s, &gethcore.LegacyTx{ - Nonce: uint64(*nonce + 2), + Nonce: nonce + 2, To: &precompile.PrecompileAddr_FunToken, Data: packedArgsPass, Gas: 1_500_000, diff --git a/eth/rpc/backend/tx_logs_test.go b/eth/rpc/backend/tx_logs_test.go new file mode 100644 index 000000000..6bd1132cf --- /dev/null +++ b/eth/rpc/backend/tx_logs_test.go @@ -0,0 +1,299 @@ +package backend_test + +import ( + "fmt" + "math/big" + + tmrpctypes "github.com/cometbft/cometbft/rpc/core/types" + sdk "github.com/cosmos/cosmos-sdk/types" + gethcommon "github.com/ethereum/go-ethereum/common" + gethcore "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + + "github.com/NibiruChain/nibiru/v2/eth" + "github.com/NibiruChain/nibiru/v2/eth/rpc/backend" + "github.com/NibiruChain/nibiru/v2/x/common/testutil" + "github.com/NibiruChain/nibiru/v2/x/evm" + "github.com/NibiruChain/nibiru/v2/x/evm/embeds" + "github.com/NibiruChain/nibiru/v2/x/evm/evmtest" + "github.com/NibiruChain/nibiru/v2/x/evm/precompile" +) + +// TestEthLogs checks that eth txs as well as funtoken txs produce tx_logs events and update tx index properly. +// To check that, we send a series of transactions: +// - 1: simple eth transfer +// - 2: deploying erc20 contract +// - 3. creating funtoken from erc20 +// - 4: creating funtoken from coin +// - 5. converting coin to erc20 +// - 6. converting erc20 born token to coin via precompile +// Each tx should emit some tx logs and emit proper tx index within ethereum tx event. +func (s *BackendSuite) TestLogs() { + // Test is broadcasting txs. Lock to avoid nonce conflicts. + testMutex.Lock() + defer testMutex.Unlock() + + // Start with fresh block + s.Require().NoError(s.network.WaitForNextBlock()) + + s.T().Log("TX1: Send simple nibi transfer") + randomEthAddr := evmtest.NewEthPrivAcc().EthAddr + txHashFirst := s.SendNibiViaEthTransfer(randomEthAddr, amountToSend, false) + + s.T().Log("TX2: Deploy ERC20 contract") + _, erc20ContractAddr := s.DeployTestContract(false) + erc20Addr, _ := eth.NewEIP55AddrFromStr(erc20ContractAddr.String()) + + s.T().Log("TX3: Create FunToken from ERC20") + nonce := s.getCurrentNonce(eth.NibiruAddrToEthAddr(s.node.Address)) + txResp, err := s.network.BroadcastMsgs(s.node.Address, &nonce, &evm.MsgCreateFunToken{ + Sender: s.node.Address.String(), + FromErc20: &erc20Addr, + }) + s.Require().NoError(err) + s.Require().NotNil(txResp) + s.Require().Equal( + uint32(0), + txResp.Code, + fmt.Sprintf("Failed to create FunToken from ERC20. RawLog: %s", txResp.RawLog), + ) + + s.T().Log("TX4: Create FunToken from unibi coin") + nonce++ + erc20FromCoinAddr := crypto.CreateAddress(evm.EVM_MODULE_ADDRESS, s.getCurrentNonce(evm.EVM_MODULE_ADDRESS)+1) + + txResp, err = s.network.BroadcastMsgs(s.node.Address, &nonce, &evm.MsgCreateFunToken{ + Sender: s.node.Address.String(), + FromBankDenom: evm.EVMBankDenom, + }) + s.Require().NoError(err) + s.Require().NotNil(txResp) + s.Require().Equal( + uint32(0), + txResp.Code, + fmt.Sprintf("Failed to create FunToken from unibi coin. RawLog: %s", txResp.RawLog), + ) + + s.T().Log("TX5: Convert coin to EVM") + nonce++ + txResp, err = s.network.BroadcastMsgs(s.node.Address, &nonce, &evm.MsgConvertCoinToEvm{ + Sender: s.node.Address.String(), + BankCoin: sdk.NewCoin(evm.EVMBankDenom, sdk.NewInt(1)), + ToEthAddr: eth.EIP55Addr{ + Address: s.fundedAccEthAddr, + }, + }) + s.Require().NoError(err) + s.Require().NotNil(txResp) + s.Require().Equal( + uint32(0), + txResp.Code, + fmt.Sprintf("Failed converting coin to evm. RawLog: %s", txResp.RawLog), + ) + + s.T().Log("TX6: Send erc20 token to coin using precompile") + randomNibiAddress := testutil.AccAddress() + packedArgsPass, err := embeds.SmartContract_FunToken.ABI.Pack( + "sendToBank", + erc20Addr.Address, + big.NewInt(1), + randomNibiAddress.String(), + ) + s.Require().NoError(err) + txHashLast := SendTransaction( + s, + &gethcore.LegacyTx{ + Nonce: s.getCurrentNonce(s.fundedAccEthAddr), + To: &precompile.PrecompileAddr_FunToken, + Data: packedArgsPass, + Gas: 1_500_000, + GasPrice: big.NewInt(1), + }, + false, + ) + + // Wait for all txs to be included in a block + blockNumFirstTx, _, _ := WaitForReceipt(s, txHashFirst) + blockNumLastTx, _, _ := WaitForReceipt(s, txHashLast) + s.Require().NotNil(blockNumFirstTx) + s.Require().NotNil(blockNumLastTx) + + // Check tx logs for each tx + type logsCheck struct { + txInfo string + logs []*gethcore.Log + expectEthTx bool + } + checks := []logsCheck{ + { + txInfo: "TX1 - simple eth transfer, should have empty logs", + logs: nil, + expectEthTx: true, + }, + { + txInfo: "TX2 - deploying erc20 contract, should have logs", + logs: []*gethcore.Log{ + // minting initial balance to the account + { + Address: erc20ContractAddr, + Topics: []gethcommon.Hash{ + crypto.Keccak256Hash([]byte("Transfer(address,address,uint256)")), + gethcommon.Address{}.Hash(), + s.fundedAccEthAddr.Hash(), + }, + }, + }, + expectEthTx: true, + }, + { + txInfo: "TX3 - create FunToken from ERC20, no eth tx, no logs", + logs: nil, + expectEthTx: false, + }, + { + txInfo: "TX4 - create FunToken from unibi coin, no eth tx, logs for contract deployment", + logs: []*gethcore.Log{ + // contract ownership to evm module + { + Address: erc20FromCoinAddr, + Topics: []gethcommon.Hash{ + crypto.Keccak256Hash([]byte("OwnershipTransferred(address,address)")), + gethcommon.Address{}.Hash(), + evm.EVM_MODULE_ADDRESS.Hash(), + }, + }, + }, + expectEthTx: false, + }, + { + txInfo: "TX5 - Convert coin to EVM, no eth tx, logs for minting tokens to the account", + logs: []*gethcore.Log{ + // minting to the account + { + Address: erc20FromCoinAddr, + Topics: []gethcommon.Hash{ + crypto.Keccak256Hash([]byte("Transfer(address,address,uint256)")), + gethcommon.Address{}.Hash(), + s.fundedAccEthAddr.Hash(), + }, + }, + }, + expectEthTx: false, + }, + { + txInfo: "TX6 - Send erc20 token to coin using precompile, eth tx, logs for transferring tokens to evm module", + logs: []*gethcore.Log{ + // transfer from account to evm module + { + Address: erc20ContractAddr, + Topics: []gethcommon.Hash{ + crypto.Keccak256Hash([]byte("Transfer(address,address,uint256)")), + s.fundedAccEthAddr.Hash(), + evm.EVM_MODULE_ADDRESS.Hash(), + }, + }, + }, + expectEthTx: true, + }, + } + + // Getting block results. Note: txs could be included in more than one block + blockNumber := blockNumFirstTx.Int64() + blockRes, err := s.backend.TendermintBlockResultByNumber(&blockNumber) + s.Require().NoError(err) + s.Require().NotNil(blockRes) + txIndex := 0 + ethTxIndex := 0 + for idx, check := range checks { + if txIndex+1 > len(blockRes.TxsResults) { + blockNumber++ + if blockNumber > blockNumLastTx.Int64() { + s.Fail("TX %d not found in block results", idx) + } + txIndex = 0 + ethTxIndex = 0 + blockRes, err = s.backend.TendermintBlockResultByNumber(&blockNumber) + s.Require().NoError(err) + s.Require().NotNil(blockRes) + } + s.assertTxLogsAndTxIndex(blockRes, txIndex, ethTxIndex, check.logs, check.expectEthTx, check.txInfo) + txIndex++ + if check.expectEthTx { + ethTxIndex++ + } + } +} + +// assertTxLogsAndTxIndex gets tx results from the block and checks tx logs and tx index. +func (s *BackendSuite) assertTxLogsAndTxIndex( + blockRes *tmrpctypes.ResultBlockResults, + txIndex int, + ethTxIndex int, + expectedTxLogs []*gethcore.Log, + expectedEthTx bool, + txInfo string, +) { + txResults := blockRes.TxsResults[txIndex] + s.Require().Equal(uint32(0x0), txResults.Code, "tx failed, %s. RawLog: %s", txInfo, txResults.Log) + + events := blockRes.TxsResults[txIndex].Events + + foundEthTx := false + for _, event := range events { + if event.Type == evm.TypeUrlEventTxLog { + logs, err := backend.ParseTxLogsFromEvent(event) + s.Require().NoError(err) + if len(expectedTxLogs) > 0 { + s.Require().GreaterOrEqual(len(logs), len(expectedTxLogs)) + s.assertTxLogsMatch(expectedTxLogs, logs, txInfo) + } else { + s.Require().Nil(logs) + } + } + if event.Type == evm.TypeUrlEventEthereumTx { + foundEthTx = true + if !expectedEthTx { + s.Fail("unexpected EventEthereumTx event for non-eth tx, %s", txInfo) + } + ethereumTx, err := evm.EventEthereumTxFromABCIEvent(event) + s.Require().NoError(err) + s.Require().Equal( + fmt.Sprintf("%d", ethTxIndex), + ethereumTx.Index, + "tx index mismatch, %s", txInfo, + ) + } + } + if expectedEthTx && !foundEthTx { + s.Fail("expected EventEthereumTx event not found, %s", txInfo) + } +} + +// assertTxLogsMatch checks that actual tx logs include the expected logs +func (s *BackendSuite) assertTxLogsMatch( + expectedLogs []*gethcore.Log, + actualLogs []*gethcore.Log, + txInfo string, +) { + for idx, expectedLog := range expectedLogs { + actualLog := actualLogs[idx] + s.Require().Equal( + expectedLog.Address, + actualLog.Address, fmt.Sprintf("log contract address mismatch, log index %d, %s", idx, txInfo), + ) + + s.Require().Equal( + len(expectedLog.Topics), + len(actualLog.Topics), + fmt.Sprintf("topics length mismatch, log index %d, %s", idx, txInfo), + ) + + for idx, topic := range expectedLog.Topics { + s.Require().Equal( + topic, + actualLog.Topics[idx], + fmt.Sprintf("topic mismatch, log index %d, %s", idx, txInfo), + ) + } + } +} diff --git a/eth/rpc/backend/utils_test.go b/eth/rpc/backend/utils_test.go index 94fc90fe4..083d24361 100644 --- a/eth/rpc/backend/utils_test.go +++ b/eth/rpc/backend/utils_test.go @@ -4,12 +4,16 @@ import ( "fmt" "github.com/cometbft/cometbft/proto/tendermint/crypto" + gethcommon "github.com/ethereum/go-ethereum/common" + gethcore "github.com/ethereum/go-ethereum/core/types" + + gethcrypto "github.com/ethereum/go-ethereum/crypto" "github.com/NibiruChain/nibiru/v2/eth/rpc/backend" ) func (s *BackendSuite) TestGetLogsFromBlockResults() { - blockWithTx := transferTxBlockNumber.Int64() + blockWithTx := deployContractBlockNumber.Int64() blockResults, err := s.backend.TendermintBlockResultByNumber(&blockWithTx) s.Require().NoError(err) s.Require().NotNil(blockResults) @@ -18,8 +22,16 @@ func (s *BackendSuite) TestGetLogsFromBlockResults() { s.Require().NoError(err) s.Require().NotNil(logs) - // TODO: ON: the structured event eth.evm.v1.EventTxLog is not emitted properly, so the logs are not retrieved - // Add proper checks after implementing + s.assertTxLogsMatch([]*gethcore.Log{ + { + Address: testContractAddress, + Topics: []gethcommon.Hash{ + gethcrypto.Keccak256Hash([]byte("Transfer(address,address,uint256)")), + gethcommon.Address{}.Hash(), + s.fundedAccEthAddr.Hash(), + }, + }, + }, logs[0], "deploy contract tx") } func (s *BackendSuite) TestGetHexProofs() { diff --git a/x/common/testutil/testnetwork/tx.go b/x/common/testutil/testnetwork/tx.go index a368c8a86..279381a2a 100644 --- a/x/common/testutil/testnetwork/tx.go +++ b/x/common/testutil/testnetwork/tx.go @@ -126,7 +126,9 @@ func (network *Network) ExecTxCmd( } func (chain *Network) BroadcastMsgs( - from sdk.AccAddress, msgs ...sdk.Msg, + from sdk.AccAddress, + accountSequence *uint64, + msgs ...sdk.Msg, ) (*sdk.TxResponse, error) { cfg := chain.Config kb, info, err := chain.keyBaseAndInfoForAddr(from) @@ -142,13 +144,18 @@ func (chain *Network) BroadcastMsgs( } txBuilder.SetFeeAmount(sdk.NewCoins(sdk.NewCoin(cfg.BondDenom, math.NewInt(1000)))) - txBuilder.SetGasLimit(uint64(1 * common.TO_MICRO)) + txBuilder.SetGasLimit(uint64(10 * common.TO_MICRO)) acc, err := cfg.AccountRetriever.GetAccount(chain.Validators[0].ClientCtx, from) if err != nil { return nil, err } - + var sequence uint64 + if accountSequence != nil { + sequence = *accountSequence + } else { + sequence = acc.GetSequence() + } txFactory := tx.Factory{} txFactory = txFactory. WithChainID(cfg.ChainID). @@ -156,7 +163,7 @@ func (chain *Network) BroadcastMsgs( WithTxConfig(cfg.TxConfig). WithAccountRetriever(cfg.AccountRetriever). WithAccountNumber(acc.GetAccountNumber()). - WithSequence(acc.GetSequence()) + WithSequence(sequence) err = tx.Sign(txFactory, info.Name, txBuilder, true) if err != nil { diff --git a/x/common/testutil/testnetwork/tx_test.go b/x/common/testutil/testnetwork/tx_test.go index 7912b8cea..267140460 100644 --- a/x/common/testutil/testnetwork/tx_test.go +++ b/x/common/testutil/testnetwork/tx_test.go @@ -16,7 +16,7 @@ func (s *TestSuite) TestSendTx() { fromAddr := s.network.Validators[0].Address toAddr := testutil.AccAddress() sendCoin := sdk.NewCoin(denoms.NIBI, math.NewInt(42)) - txResp, err := s.network.BroadcastMsgs(fromAddr, &banktypes.MsgSend{ + txResp, err := s.network.BroadcastMsgs(fromAddr, nil, &banktypes.MsgSend{ FromAddress: fromAddr.String(), ToAddress: toAddr.String(), Amount: sdk.NewCoins(sendCoin), diff --git a/x/evm/embeds/artifacts/contracts/MKR.sol/DSAuth.json b/x/evm/embeds/artifacts/contracts/MKR.sol/DSAuth.json new file mode 100644 index 000000000..77faf7af4 --- /dev/null +++ b/x/evm/embeds/artifacts/contracts/MKR.sol/DSAuth.json @@ -0,0 +1,97 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "DSAuth", + "sourceName": "contracts/MKR.sol", + "abi": [ + { + "constant": false, + "inputs": [ + { + "name": "owner_", + "type": "address" + } + ], + "name": "setOwner", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "authority_", + "type": "address" + } + ], + "name": "setAuthority", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "owner", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "authority", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "authority", + "type": "address" + } + ], + "name": "LogSetAuthority", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "owner", + "type": "address" + } + ], + "name": "LogSetOwner", + "type": "event" + } + ], + "bytecode": "0x6060604052341561000f57600080fd5b33600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055503373ffffffffffffffffffffffffffffffffffffffff167fce241d7ca1f669fee44b6fc00b8eba2df3bb514eed0f6f668f8f89096e81ed9460405160405180910390a261061b806100a26000396000f300606060405260043610610062576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806313af4035146100675780637a9e5e4b146100a05780638da5cb5b146100d9578063bf7e214f1461012e575b600080fd5b341561007257600080fd5b61009e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610183565b005b34156100ab57600080fd5b6100d7600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610265565b005b34156100e457600080fd5b6100ec610345565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561013957600080fd5b61014161036b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101b1336000357fffffffff0000000000000000000000000000000000000000000000000000000016610390565b15156101bc57600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fce241d7ca1f669fee44b6fc00b8eba2df3bb514eed0f6f668f8f89096e81ed9460405160405180910390a250565b610293336000357fffffffff0000000000000000000000000000000000000000000000000000000016610390565b151561029e57600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f1abebea81bfa2637f28358c371278fb15ede7ea8dd28d2e03b112ff6d936ada460405160405180910390a250565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156103cf57600190506105e9565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561042e57600190506105e9565b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561048d57600090506105e9565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b70096138430856000604051602001526040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020019350505050602060405180830381600087803b15156105cb57600080fd5b6102c65a03f115156105dc57600080fd5b5050506040518051905090505b929150505600a165627a7a723058203965e1ecd0781e359ae067027585ec9c736c2bd7a138b809a89be282e0b69b330029", + "deployedBytecode": "0x606060405260043610610062576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806313af4035146100675780637a9e5e4b146100a05780638da5cb5b146100d9578063bf7e214f1461012e575b600080fd5b341561007257600080fd5b61009e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610183565b005b34156100ab57600080fd5b6100d7600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610265565b005b34156100e457600080fd5b6100ec610345565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561013957600080fd5b61014161036b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101b1336000357fffffffff0000000000000000000000000000000000000000000000000000000016610390565b15156101bc57600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fce241d7ca1f669fee44b6fc00b8eba2df3bb514eed0f6f668f8f89096e81ed9460405160405180910390a250565b610293336000357fffffffff0000000000000000000000000000000000000000000000000000000016610390565b151561029e57600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f1abebea81bfa2637f28358c371278fb15ede7ea8dd28d2e03b112ff6d936ada460405160405180910390a250565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156103cf57600190506105e9565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561042e57600190506105e9565b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561048d57600090506105e9565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b70096138430856000604051602001526040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020019350505050602060405180830381600087803b15156105cb57600080fd5b6102c65a03f115156105dc57600080fd5b5050506040518051905090505b929150505600a165627a7a723058203965e1ecd0781e359ae067027585ec9c736c2bd7a138b809a89be282e0b69b330029", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/x/evm/embeds/artifacts/contracts/MKR.sol/DSAuthEvents.json b/x/evm/embeds/artifacts/contracts/MKR.sol/DSAuthEvents.json new file mode 100644 index 000000000..f38110226 --- /dev/null +++ b/x/evm/embeds/artifacts/contracts/MKR.sol/DSAuthEvents.json @@ -0,0 +1,35 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "DSAuthEvents", + "sourceName": "contracts/MKR.sol", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "authority", + "type": "address" + } + ], + "name": "LogSetAuthority", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "owner", + "type": "address" + } + ], + "name": "LogSetOwner", + "type": "event" + } + ], + "bytecode": "0x60606040523415600e57600080fd5b603580601b6000396000f3006060604052600080fd00a165627a7a72305820482fd205f6d62e7b66ff2e3194cd5a5def77e9460f305ec3bf11ef374fed685d0029", + "deployedBytecode": "0x6060604052600080fd00a165627a7a72305820482fd205f6d62e7b66ff2e3194cd5a5def77e9460f305ec3bf11ef374fed685d0029", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/x/evm/embeds/artifacts/contracts/MKR.sol/DSAuthority.json b/x/evm/embeds/artifacts/contracts/MKR.sol/DSAuthority.json new file mode 100644 index 000000000..9459aa0d9 --- /dev/null +++ b/x/evm/embeds/artifacts/contracts/MKR.sol/DSAuthority.json @@ -0,0 +1,38 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "DSAuthority", + "sourceName": "contracts/MKR.sol", + "abi": [ + { + "constant": true, + "inputs": [ + { + "name": "src", + "type": "address" + }, + { + "name": "dst", + "type": "address" + }, + { + "name": "sig", + "type": "bytes4" + } + ], + "name": "canCall", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + } + ], + "bytecode": "0x", + "deployedBytecode": "0x", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/x/evm/embeds/artifacts/contracts/MKR.sol/DSMath.json b/x/evm/embeds/artifacts/contracts/MKR.sol/DSMath.json new file mode 100644 index 000000000..c279b56f3 --- /dev/null +++ b/x/evm/embeds/artifacts/contracts/MKR.sol/DSMath.json @@ -0,0 +1,10 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "DSMath", + "sourceName": "contracts/MKR.sol", + "abi": [], + "bytecode": "0x60606040523415600e57600080fd5b603580601b6000396000f3006060604052600080fd00a165627a7a72305820d191478102eb59e59dbf8bd1168a079984302f4f957092ac877d210db1a13e420029", + "deployedBytecode": "0x6060604052600080fd00a165627a7a72305820d191478102eb59e59dbf8bd1168a079984302f4f957092ac877d210db1a13e420029", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/x/evm/embeds/artifacts/contracts/MKR.sol/DSNote.json b/x/evm/embeds/artifacts/contracts/MKR.sol/DSNote.json new file mode 100644 index 000000000..eceb35851 --- /dev/null +++ b/x/evm/embeds/artifacts/contracts/MKR.sol/DSNote.json @@ -0,0 +1,48 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "DSNote", + "sourceName": "contracts/MKR.sol", + "abi": [ + { + "anonymous": true, + "inputs": [ + { + "indexed": true, + "name": "sig", + "type": "bytes4" + }, + { + "indexed": true, + "name": "guy", + "type": "address" + }, + { + "indexed": true, + "name": "foo", + "type": "bytes32" + }, + { + "indexed": true, + "name": "bar", + "type": "bytes32" + }, + { + "indexed": false, + "name": "wad", + "type": "uint256" + }, + { + "indexed": false, + "name": "fax", + "type": "bytes" + } + ], + "name": "LogNote", + "type": "event" + } + ], + "bytecode": "0x60606040523415600e57600080fd5b603580601b6000396000f3006060604052600080fd00a165627a7a72305820867630c0f37bb81d4b5f15a3e77b04ada6667969a96ddaeea40a5d9bbff0f0b10029", + "deployedBytecode": "0x6060604052600080fd00a165627a7a72305820867630c0f37bb81d4b5f15a3e77b04ada6667969a96ddaeea40a5d9bbff0f0b10029", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/x/evm/embeds/artifacts/contracts/MKR.sol/DSStop.json b/x/evm/embeds/artifacts/contracts/MKR.sol/DSStop.json new file mode 100644 index 000000000..acb5f2fcc --- /dev/null +++ b/x/evm/embeds/artifacts/contracts/MKR.sol/DSStop.json @@ -0,0 +1,160 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "DSStop", + "sourceName": "contracts/MKR.sol", + "abi": [ + { + "constant": false, + "inputs": [], + "name": "stop", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "owner_", + "type": "address" + } + ], + "name": "setOwner", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "stopped", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "authority_", + "type": "address" + } + ], + "name": "setAuthority", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "owner", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "start", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "authority", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "authority", + "type": "address" + } + ], + "name": "LogSetAuthority", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "owner", + "type": "address" + } + ], + "name": "LogSetOwner", + "type": "event" + }, + { + "anonymous": true, + "inputs": [ + { + "indexed": true, + "name": "sig", + "type": "bytes4" + }, + { + "indexed": true, + "name": "guy", + "type": "address" + }, + { + "indexed": true, + "name": "foo", + "type": "bytes32" + }, + { + "indexed": true, + "name": "bar", + "type": "bytes32" + }, + { + "indexed": false, + "name": "wad", + "type": "uint256" + }, + { + "indexed": false, + "name": "fax", + "type": "bytes" + } + ], + "name": "LogNote", + "type": "event" + } + ], + "bytecode": "0x606060405233600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055503373ffffffffffffffffffffffffffffffffffffffff167fce241d7ca1f669fee44b6fc00b8eba2df3bb514eed0f6f668f8f89096e81ed9460405160405180910390a26108ab806100976000396000f300606060405260043610610083576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806307da68f51461008857806313af40351461009d57806375f12b21146100d65780637a9e5e4b146101035780638da5cb5b1461013c578063be9a655514610191578063bf7e214f146101a6575b600080fd5b341561009357600080fd5b61009b6101fb565b005b34156100a857600080fd5b6100d4600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506102fd565b005b34156100e157600080fd5b6100e96103df565b604051808215151515815260200191505060405180910390f35b341561010e57600080fd5b61013a600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506103f2565b005b341561014757600080fd5b61014f6104d2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561019c57600080fd5b6101a46104f8565b005b34156101b157600080fd5b6101b96105fb565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610229336000357fffffffff0000000000000000000000000000000000000000000000000000000016610620565b151561023457600080fd5b60008060043591506024359050806000191682600019163373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163460003660405180848152602001806020018281038252848482818152602001925080828437820191505094505050505060405180910390a460018060146101000a81548160ff0219169083151502179055505050565b61032b336000357fffffffff0000000000000000000000000000000000000000000000000000000016610620565b151561033657600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fce241d7ca1f669fee44b6fc00b8eba2df3bb514eed0f6f668f8f89096e81ed9460405160405180910390a250565b600160149054906101000a900460ff1681565b610420336000357fffffffff0000000000000000000000000000000000000000000000000000000016610620565b151561042b57600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f1abebea81bfa2637f28358c371278fb15ede7ea8dd28d2e03b112ff6d936ada460405160405180910390a250565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610526336000357fffffffff0000000000000000000000000000000000000000000000000000000016610620565b151561053157600080fd5b60008060043591506024359050806000191682600019163373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163460003660405180848152602001806020018281038252848482818152602001925080828437820191505094505050505060405180910390a46000600160146101000a81548160ff0219169083151502179055505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561065f5760019050610879565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156106be5760019050610879565b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561071d5760009050610879565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b70096138430856000604051602001526040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020019350505050602060405180830381600087803b151561085b57600080fd5b6102c65a03f1151561086c57600080fd5b5050506040518051905090505b929150505600a165627a7a72305820e4fb0b3e5634e485d10a52d17139437a37577ad47f9e3b45b7069415d65b10cb0029", + "deployedBytecode": "0x606060405260043610610083576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806307da68f51461008857806313af40351461009d57806375f12b21146100d65780637a9e5e4b146101035780638da5cb5b1461013c578063be9a655514610191578063bf7e214f146101a6575b600080fd5b341561009357600080fd5b61009b6101fb565b005b34156100a857600080fd5b6100d4600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506102fd565b005b34156100e157600080fd5b6100e96103df565b604051808215151515815260200191505060405180910390f35b341561010e57600080fd5b61013a600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506103f2565b005b341561014757600080fd5b61014f6104d2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561019c57600080fd5b6101a46104f8565b005b34156101b157600080fd5b6101b96105fb565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610229336000357fffffffff0000000000000000000000000000000000000000000000000000000016610620565b151561023457600080fd5b60008060043591506024359050806000191682600019163373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163460003660405180848152602001806020018281038252848482818152602001925080828437820191505094505050505060405180910390a460018060146101000a81548160ff0219169083151502179055505050565b61032b336000357fffffffff0000000000000000000000000000000000000000000000000000000016610620565b151561033657600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fce241d7ca1f669fee44b6fc00b8eba2df3bb514eed0f6f668f8f89096e81ed9460405160405180910390a250565b600160149054906101000a900460ff1681565b610420336000357fffffffff0000000000000000000000000000000000000000000000000000000016610620565b151561042b57600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f1abebea81bfa2637f28358c371278fb15ede7ea8dd28d2e03b112ff6d936ada460405160405180910390a250565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610526336000357fffffffff0000000000000000000000000000000000000000000000000000000016610620565b151561053157600080fd5b60008060043591506024359050806000191682600019163373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163460003660405180848152602001806020018281038252848482818152602001925080828437820191505094505050505060405180910390a46000600160146101000a81548160ff0219169083151502179055505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561065f5760019050610879565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156106be5760019050610879565b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561071d5760009050610879565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b70096138430856000604051602001526040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020019350505050602060405180830381600087803b151561085b57600080fd5b6102c65a03f1151561086c57600080fd5b5050506040518051905090505b929150505600a165627a7a72305820e4fb0b3e5634e485d10a52d17139437a37577ad47f9e3b45b7069415d65b10cb0029", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/x/evm/embeds/artifacts/contracts/MKR.sol/DSThing.json b/x/evm/embeds/artifacts/contracts/MKR.sol/DSThing.json new file mode 100644 index 000000000..0039cca35 --- /dev/null +++ b/x/evm/embeds/artifacts/contracts/MKR.sol/DSThing.json @@ -0,0 +1,128 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "DSThing", + "sourceName": "contracts/MKR.sol", + "abi": [ + { + "constant": false, + "inputs": [ + { + "name": "owner_", + "type": "address" + } + ], + "name": "setOwner", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "authority_", + "type": "address" + } + ], + "name": "setAuthority", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "owner", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "authority", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "anonymous": true, + "inputs": [ + { + "indexed": true, + "name": "sig", + "type": "bytes4" + }, + { + "indexed": true, + "name": "guy", + "type": "address" + }, + { + "indexed": true, + "name": "foo", + "type": "bytes32" + }, + { + "indexed": true, + "name": "bar", + "type": "bytes32" + }, + { + "indexed": false, + "name": "wad", + "type": "uint256" + }, + { + "indexed": false, + "name": "fax", + "type": "bytes" + } + ], + "name": "LogNote", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "authority", + "type": "address" + } + ], + "name": "LogSetAuthority", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "owner", + "type": "address" + } + ], + "name": "LogSetOwner", + "type": "event" + } + ], + "bytecode": "0x606060405233600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055503373ffffffffffffffffffffffffffffffffffffffff167fce241d7ca1f669fee44b6fc00b8eba2df3bb514eed0f6f668f8f89096e81ed9460405160405180910390a261061b806100976000396000f300606060405260043610610062576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806313af4035146100675780637a9e5e4b146100a05780638da5cb5b146100d9578063bf7e214f1461012e575b600080fd5b341561007257600080fd5b61009e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610183565b005b34156100ab57600080fd5b6100d7600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610265565b005b34156100e457600080fd5b6100ec610345565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561013957600080fd5b61014161036b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101b1336000357fffffffff0000000000000000000000000000000000000000000000000000000016610390565b15156101bc57600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fce241d7ca1f669fee44b6fc00b8eba2df3bb514eed0f6f668f8f89096e81ed9460405160405180910390a250565b610293336000357fffffffff0000000000000000000000000000000000000000000000000000000016610390565b151561029e57600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f1abebea81bfa2637f28358c371278fb15ede7ea8dd28d2e03b112ff6d936ada460405160405180910390a250565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156103cf57600190506105e9565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561042e57600190506105e9565b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561048d57600090506105e9565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b70096138430856000604051602001526040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020019350505050602060405180830381600087803b15156105cb57600080fd5b6102c65a03f115156105dc57600080fd5b5050506040518051905090505b929150505600a165627a7a7230582036876a0f4dc663a0b514bca9f895503a8780cb8105eb4d09213927eb8af442fd0029", + "deployedBytecode": "0x606060405260043610610062576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806313af4035146100675780637a9e5e4b146100a05780638da5cb5b146100d9578063bf7e214f1461012e575b600080fd5b341561007257600080fd5b61009e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610183565b005b34156100ab57600080fd5b6100d7600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610265565b005b34156100e457600080fd5b6100ec610345565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561013957600080fd5b61014161036b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101b1336000357fffffffff0000000000000000000000000000000000000000000000000000000016610390565b15156101bc57600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fce241d7ca1f669fee44b6fc00b8eba2df3bb514eed0f6f668f8f89096e81ed9460405160405180910390a250565b610293336000357fffffffff0000000000000000000000000000000000000000000000000000000016610390565b151561029e57600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f1abebea81bfa2637f28358c371278fb15ede7ea8dd28d2e03b112ff6d936ada460405160405180910390a250565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156103cf57600190506105e9565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561042e57600190506105e9565b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561048d57600090506105e9565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b70096138430856000604051602001526040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020019350505050602060405180830381600087803b15156105cb57600080fd5b6102c65a03f115156105dc57600080fd5b5050506040518051905090505b929150505600a165627a7a7230582036876a0f4dc663a0b514bca9f895503a8780cb8105eb4d09213927eb8af442fd0029", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/x/evm/embeds/artifacts/contracts/MKR.sol/DSToken.json b/x/evm/embeds/artifacts/contracts/MKR.sol/DSToken.json new file mode 100644 index 000000000..081026c47 --- /dev/null +++ b/x/evm/embeds/artifacts/contracts/MKR.sol/DSToken.json @@ -0,0 +1,575 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "DSToken", + "sourceName": "contracts/MKR.sol", + "abi": [ + { + "constant": true, + "inputs": [], + "name": "name", + "outputs": [ + { + "name": "", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "stop", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "guy", + "type": "address" + }, + { + "name": "wad", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "owner_", + "type": "address" + } + ], + "name": "setOwner", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "src", + "type": "address" + }, + { + "name": "dst", + "type": "address" + }, + { + "name": "wad", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "decimals", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "guy", + "type": "address" + }, + { + "name": "wad", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "wad", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "name_", + "type": "bytes32" + } + ], + "name": "setName", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "src", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "stopped", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "authority_", + "type": "address" + } + ], + "name": "setAuthority", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "owner", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "symbol", + "outputs": [ + { + "name": "", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "guy", + "type": "address" + }, + { + "name": "wad", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "wad", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "dst", + "type": "address" + }, + { + "name": "wad", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "dst", + "type": "address" + }, + { + "name": "wad", + "type": "uint256" + } + ], + "name": "push", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "src", + "type": "address" + }, + { + "name": "dst", + "type": "address" + }, + { + "name": "wad", + "type": "uint256" + } + ], + "name": "move", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "start", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "authority", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "guy", + "type": "address" + } + ], + "name": "approve", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "src", + "type": "address" + }, + { + "name": "guy", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "src", + "type": "address" + }, + { + "name": "wad", + "type": "uint256" + } + ], + "name": "pull", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "name": "symbol_", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "guy", + "type": "address" + }, + { + "indexed": false, + "name": "wad", + "type": "uint256" + } + ], + "name": "Mint", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "guy", + "type": "address" + }, + { + "indexed": false, + "name": "wad", + "type": "uint256" + } + ], + "name": "Burn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "authority", + "type": "address" + } + ], + "name": "LogSetAuthority", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "owner", + "type": "address" + } + ], + "name": "LogSetOwner", + "type": "event" + }, + { + "anonymous": true, + "inputs": [ + { + "indexed": true, + "name": "sig", + "type": "bytes4" + }, + { + "indexed": true, + "name": "guy", + "type": "address" + }, + { + "indexed": true, + "name": "foo", + "type": "bytes32" + }, + { + "indexed": true, + "name": "bar", + "type": "bytes32" + }, + { + "indexed": false, + "name": "wad", + "type": "uint256" + }, + { + "indexed": false, + "name": "fax", + "type": "bytes" + } + ], + "name": "LogNote", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "from", + "type": "address" + }, + { + "indexed": true, + "name": "to", + "type": "address" + }, + { + "indexed": false, + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + } + ], + "bytecode": "0x606060405260126006556000600790600019169055341561001f57600080fd5b604051602080611a9383398101604052808051906020019091905050600080600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550806000819055505033600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055503373ffffffffffffffffffffffffffffffffffffffff167fce241d7ca1f669fee44b6fc00b8eba2df3bb514eed0f6f668f8f89096e81ed9460405160405180910390a280600581600019169055505061196b806101286000396000f300606060405260043610610149576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461014e57806307da68f51461017f578063095ea7b31461019457806313af4035146101ee57806318160ddd1461022757806323b872dd14610250578063313ce567146102c957806340c10f19146102f257806342966c68146103345780635ac801fe1461035757806370a082311461037e57806375f12b21146103cb5780637a9e5e4b146103f85780638da5cb5b1461043157806395d89b41146104865780639dc29fac146104b7578063a0712d68146104f9578063a9059cbb1461051c578063b753a98c14610576578063bb35783b146105b8578063be9a655514610619578063bf7e214f1461062e578063daea85c514610683578063dd62ed3e146106d4578063f2d5d56b14610740575b600080fd5b341561015957600080fd5b610161610782565b60405180826000191660001916815260200191505060405180910390f35b341561018a57600080fd5b610192610788565b005b341561019f57600080fd5b6101d4600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061088b565b604051808215151515815260200191505060405180910390f35b34156101f957600080fd5b610225600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506108bb565b005b341561023257600080fd5b61023a61099d565b6040518082815260200191505060405180910390f35b341561025b57600080fd5b6102af600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506109a6565b604051808215151515815260200191505060405180910390f35b34156102d457600080fd5b6102dc610d30565b6040518082815260200191505060405180910390f35b34156102fd57600080fd5b610332600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610d36565b005b341561033f57600080fd5b6103556004808035906020019091905050610e7b565b005b341561036257600080fd5b61037c600480803560001916906020019091905050610e88565b005b341561038957600080fd5b6103b5600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ecf565b6040518082815260200191505060405180910390f35b34156103d657600080fd5b6103de610f18565b604051808215151515815260200191505060405180910390f35b341561040357600080fd5b61042f600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610f2b565b005b341561043c57600080fd5b61044461100d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561049157600080fd5b610499611033565b60405180826000191660001916815260200191505060405180910390f35b34156104c257600080fd5b6104f7600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611039565b005b341561050457600080fd5b61051a6004808035906020019091905050611362565b005b341561052757600080fd5b61055c600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061136f565b604051808215151515815260200191505060405180910390f35b341561058157600080fd5b6105b6600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611384565b005b34156105c357600080fd5b610617600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611394565b005b341561062457600080fd5b61062c6113a5565b005b341561063957600080fd5b6106416114a8565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561068e57600080fd5b6106ba600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506114ce565b604051808215151515815260200191505060405180910390f35b34156106df57600080fd5b61072a600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061151d565b6040518082815260200191505060405180910390f35b341561074b57600080fd5b610780600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506115a4565b005b60075481565b6107b6336000357fffffffff00000000000000000000000000000000000000000000000000000000166115b4565b15156107c157600080fd5b60008060043591506024359050806000191682600019163373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163460003660405180848152602001806020018281038252848482818152602001925080828437820191505094505050505060405180910390a46001600460146101000a81548160ff0219169083151502179055505050565b6000600460149054906101000a900460ff161515156108a957600080fd5b6108b38383611815565b905092915050565b6108e9336000357fffffffff00000000000000000000000000000000000000000000000000000000166115b4565b15156108f457600080fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fce241d7ca1f669fee44b6fc00b8eba2df3bb514eed0f6f668f8f89096e81ed9460405160405180910390a250565b60008054905090565b6000600460149054906101000a900460ff161515156109c457600080fd5b3373ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015610a9c57507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b15610ba857610b27600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611907565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b610bf1600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611907565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c7d600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611923565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60065481565b610d64336000357fffffffff00000000000000000000000000000000000000000000000000000000166115b4565b1515610d6f57600080fd5b600460149054906101000a900460ff16151515610d8b57600080fd5b610dd4600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482611923565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e2360005482611923565b6000819055508173ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885826040518082815260200191505060405180910390a25050565b610e853382611039565b50565b610eb6336000357fffffffff00000000000000000000000000000000000000000000000000000000166115b4565b1515610ec157600080fd5b806007816000191690555050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600460149054906101000a900460ff1681565b610f59336000357fffffffff00000000000000000000000000000000000000000000000000000000166115b4565b1515610f6457600080fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f1abebea81bfa2637f28358c371278fb15ede7ea8dd28d2e03b112ff6d936ada460405160405180910390a250565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60055481565b611067336000357fffffffff00000000000000000000000000000000000000000000000000000000166115b4565b151561107257600080fd5b600460149054906101000a900460ff1615151561108e57600080fd5b3373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561116657507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b15611272576111f1600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482611907565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6112bb600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482611907565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061130a60005482611907565b6000819055508173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a25050565b61136c3382610d36565b50565b600061137c3384846109a6565b905092915050565b61138f3383836109a6565b505050565b61139f8383836109a6565b50505050565b6113d3336000357fffffffff00000000000000000000000000000000000000000000000000000000166115b4565b15156113de57600080fd5b60008060043591506024359050806000191682600019163373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163460003660405180848152602001806020018281038252848482818152602001925080828437820191505094505050505060405180910390a46000600460146101000a81548160ff0219169083151502179055505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600460149054906101000a900460ff161515156114ec57600080fd5b611516827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff611815565b9050919050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6115af8233836109a6565b505050565b60003073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156115f3576001905061180f565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611652576001905061180f565b600073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156116b2576000905061180f565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b70096138430856000604051602001526040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020019350505050602060405180830381600087803b15156117f157600080fd5b6102c65a03f1151561180257600080fd5b5050506040518051905090505b92915050565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000828284039150811115151561191d57600080fd5b92915050565b6000828284019150811015151561193957600080fd5b929150505600a165627a7a72305820310251b2c6d2735c8890ac55f0b00cbaa61f36e72e80928c01ce0ef6ee0a34010029", + "deployedBytecode": "0x606060405260043610610149576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461014e57806307da68f51461017f578063095ea7b31461019457806313af4035146101ee57806318160ddd1461022757806323b872dd14610250578063313ce567146102c957806340c10f19146102f257806342966c68146103345780635ac801fe1461035757806370a082311461037e57806375f12b21146103cb5780637a9e5e4b146103f85780638da5cb5b1461043157806395d89b41146104865780639dc29fac146104b7578063a0712d68146104f9578063a9059cbb1461051c578063b753a98c14610576578063bb35783b146105b8578063be9a655514610619578063bf7e214f1461062e578063daea85c514610683578063dd62ed3e146106d4578063f2d5d56b14610740575b600080fd5b341561015957600080fd5b610161610782565b60405180826000191660001916815260200191505060405180910390f35b341561018a57600080fd5b610192610788565b005b341561019f57600080fd5b6101d4600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061088b565b604051808215151515815260200191505060405180910390f35b34156101f957600080fd5b610225600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506108bb565b005b341561023257600080fd5b61023a61099d565b6040518082815260200191505060405180910390f35b341561025b57600080fd5b6102af600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506109a6565b604051808215151515815260200191505060405180910390f35b34156102d457600080fd5b6102dc610d30565b6040518082815260200191505060405180910390f35b34156102fd57600080fd5b610332600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610d36565b005b341561033f57600080fd5b6103556004808035906020019091905050610e7b565b005b341561036257600080fd5b61037c600480803560001916906020019091905050610e88565b005b341561038957600080fd5b6103b5600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ecf565b6040518082815260200191505060405180910390f35b34156103d657600080fd5b6103de610f18565b604051808215151515815260200191505060405180910390f35b341561040357600080fd5b61042f600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610f2b565b005b341561043c57600080fd5b61044461100d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561049157600080fd5b610499611033565b60405180826000191660001916815260200191505060405180910390f35b34156104c257600080fd5b6104f7600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611039565b005b341561050457600080fd5b61051a6004808035906020019091905050611362565b005b341561052757600080fd5b61055c600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061136f565b604051808215151515815260200191505060405180910390f35b341561058157600080fd5b6105b6600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611384565b005b34156105c357600080fd5b610617600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611394565b005b341561062457600080fd5b61062c6113a5565b005b341561063957600080fd5b6106416114a8565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561068e57600080fd5b6106ba600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506114ce565b604051808215151515815260200191505060405180910390f35b34156106df57600080fd5b61072a600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061151d565b6040518082815260200191505060405180910390f35b341561074b57600080fd5b610780600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506115a4565b005b60075481565b6107b6336000357fffffffff00000000000000000000000000000000000000000000000000000000166115b4565b15156107c157600080fd5b60008060043591506024359050806000191682600019163373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163460003660405180848152602001806020018281038252848482818152602001925080828437820191505094505050505060405180910390a46001600460146101000a81548160ff0219169083151502179055505050565b6000600460149054906101000a900460ff161515156108a957600080fd5b6108b38383611815565b905092915050565b6108e9336000357fffffffff00000000000000000000000000000000000000000000000000000000166115b4565b15156108f457600080fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fce241d7ca1f669fee44b6fc00b8eba2df3bb514eed0f6f668f8f89096e81ed9460405160405180910390a250565b60008054905090565b6000600460149054906101000a900460ff161515156109c457600080fd5b3373ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015610a9c57507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b15610ba857610b27600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611907565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b610bf1600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611907565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c7d600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611923565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60065481565b610d64336000357fffffffff00000000000000000000000000000000000000000000000000000000166115b4565b1515610d6f57600080fd5b600460149054906101000a900460ff16151515610d8b57600080fd5b610dd4600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482611923565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e2360005482611923565b6000819055508173ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885826040518082815260200191505060405180910390a25050565b610e853382611039565b50565b610eb6336000357fffffffff00000000000000000000000000000000000000000000000000000000166115b4565b1515610ec157600080fd5b806007816000191690555050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600460149054906101000a900460ff1681565b610f59336000357fffffffff00000000000000000000000000000000000000000000000000000000166115b4565b1515610f6457600080fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f1abebea81bfa2637f28358c371278fb15ede7ea8dd28d2e03b112ff6d936ada460405160405180910390a250565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60055481565b611067336000357fffffffff00000000000000000000000000000000000000000000000000000000166115b4565b151561107257600080fd5b600460149054906101000a900460ff1615151561108e57600080fd5b3373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561116657507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b15611272576111f1600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482611907565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6112bb600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482611907565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061130a60005482611907565b6000819055508173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a25050565b61136c3382610d36565b50565b600061137c3384846109a6565b905092915050565b61138f3383836109a6565b505050565b61139f8383836109a6565b50505050565b6113d3336000357fffffffff00000000000000000000000000000000000000000000000000000000166115b4565b15156113de57600080fd5b60008060043591506024359050806000191682600019163373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163460003660405180848152602001806020018281038252848482818152602001925080828437820191505094505050505060405180910390a46000600460146101000a81548160ff0219169083151502179055505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600460149054906101000a900460ff161515156114ec57600080fd5b611516827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff611815565b9050919050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6115af8233836109a6565b505050565b60003073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156115f3576001905061180f565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611652576001905061180f565b600073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156116b2576000905061180f565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b70096138430856000604051602001526040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020019350505050602060405180830381600087803b15156117f157600080fd5b6102c65a03f1151561180257600080fd5b5050506040518051905090505b92915050565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000828284039150811115151561191d57600080fd5b92915050565b6000828284019150811015151561193957600080fd5b929150505600a165627a7a72305820310251b2c6d2735c8890ac55f0b00cbaa61f36e72e80928c01ce0ef6ee0a34010029", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/x/evm/embeds/artifacts/contracts/MKR.sol/DSTokenBase.json b/x/evm/embeds/artifacts/contracts/MKR.sol/DSTokenBase.json new file mode 100644 index 000000000..467679d35 --- /dev/null +++ b/x/evm/embeds/artifacts/contracts/MKR.sol/DSTokenBase.json @@ -0,0 +1,195 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "DSTokenBase", + "sourceName": "contracts/MKR.sol", + "abi": [ + { + "constant": false, + "inputs": [ + { + "name": "guy", + "type": "address" + }, + { + "name": "wad", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "src", + "type": "address" + }, + { + "name": "dst", + "type": "address" + }, + { + "name": "wad", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "src", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "dst", + "type": "address" + }, + { + "name": "wad", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "src", + "type": "address" + }, + { + "name": "guy", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "name": "supply", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "from", + "type": "address" + }, + { + "indexed": true, + "name": "to", + "type": "address" + }, + { + "indexed": false, + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + } + ], + "bytecode": "0x6060604052341561000f57600080fd5b60405160208061081c8339810160405280805190602001909190505080600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508060008190555050610796806100866000396000f300606060405260043610610078576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063095ea7b31461007d57806318160ddd146100d757806323b872dd1461010057806370a0823114610179578063a9059cbb146101c6578063dd62ed3e14610220575b600080fd5b341561008857600080fd5b6100bd600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061028c565b604051808215151515815260200191505060405180910390f35b34156100e257600080fd5b6100ea61037e565b6040518082815260200191505060405180910390f35b341561010b57600080fd5b61015f600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610387565b604051808215151515815260200191505060405180910390f35b341561018457600080fd5b6101b0600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061064d565b6040518082815260200191505060405180910390f35b34156101d157600080fd5b610206600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610696565b604051808215151515815260200191505060405180910390f35b341561022b57600080fd5b610276600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506106ab565b6040518082815260200191505060405180910390f35b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008054905090565b60003373ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415156104c557610444600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483610732565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b61050e600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483610732565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061059a600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361074e565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60006106a3338484610387565b905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000828284039150811115151561074857600080fd5b92915050565b6000828284019150811015151561076457600080fd5b929150505600a165627a7a72305820ae0b5dc9f8abfce1f3c6b41085e97c24e95534036623cb14dfb00097a8535d460029", + "deployedBytecode": "0x606060405260043610610078576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063095ea7b31461007d57806318160ddd146100d757806323b872dd1461010057806370a0823114610179578063a9059cbb146101c6578063dd62ed3e14610220575b600080fd5b341561008857600080fd5b6100bd600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061028c565b604051808215151515815260200191505060405180910390f35b34156100e257600080fd5b6100ea61037e565b6040518082815260200191505060405180910390f35b341561010b57600080fd5b61015f600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610387565b604051808215151515815260200191505060405180910390f35b341561018457600080fd5b6101b0600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061064d565b6040518082815260200191505060405180910390f35b34156101d157600080fd5b610206600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610696565b604051808215151515815260200191505060405180910390f35b341561022b57600080fd5b610276600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506106ab565b6040518082815260200191505060405180910390f35b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008054905090565b60003373ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415156104c557610444600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483610732565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b61050e600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483610732565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061059a600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361074e565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60006106a3338484610387565b905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000828284039150811115151561074857600080fd5b92915050565b6000828284019150811015151561076457600080fd5b929150505600a165627a7a72305820ae0b5dc9f8abfce1f3c6b41085e97c24e95534036623cb14dfb00097a8535d460029", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/x/evm/embeds/artifacts/contracts/MKR.sol/ERC20.json b/x/evm/embeds/artifacts/contracts/MKR.sol/ERC20.json new file mode 100644 index 000000000..3563a5c54 --- /dev/null +++ b/x/evm/embeds/artifacts/contracts/MKR.sol/ERC20.json @@ -0,0 +1,184 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "ERC20", + "sourceName": "contracts/MKR.sol", + "abi": [ + { + "constant": false, + "inputs": [ + { + "name": "spender", + "type": "address" + }, + { + "name": "value", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "name": "ok", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "name": "supply", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "from", + "type": "address" + }, + { + "name": "to", + "type": "address" + }, + { + "name": "value", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "name": "ok", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "who", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "name": "value", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "to", + "type": "address" + }, + { + "name": "value", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "name": "ok", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "owner", + "type": "address" + }, + { + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "name": "_allowance", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "from", + "type": "address" + }, + { + "indexed": true, + "name": "to", + "type": "address" + }, + { + "indexed": false, + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + } + ], + "bytecode": "0x", + "deployedBytecode": "0x", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/x/evm/embeds/contracts/MKR.sol b/x/evm/embeds/contracts/MKR.sol new file mode 100644 index 000000000..a7d11270e --- /dev/null +++ b/x/evm/embeds/contracts/MKR.sol @@ -0,0 +1,478 @@ +/** + *Submitted for verification at Etherscan.io on 2017-11-25 +*/ + +// MKR Token + +// hevm: flattened sources of src/mkr-499.sol +pragma solidity ^0.4.15; + +////// lib/ds-roles/lib/ds-auth/src/auth.sol +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +/* pragma solidity ^0.4.13; */ + +contract DSAuthority { + function canCall( + address src, address dst, bytes4 sig + ) public view returns (bool); +} + +contract DSAuthEvents { + event LogSetAuthority (address indexed authority); + event LogSetOwner (address indexed owner); +} + +contract DSAuth is DSAuthEvents { + DSAuthority public authority; + address public owner; + + function DSAuth() public { + owner = msg.sender; + LogSetOwner(msg.sender); + } + + function setOwner(address owner_) + public + auth + { + owner = owner_; + LogSetOwner(owner); + } + + function setAuthority(DSAuthority authority_) + public + auth + { + authority = authority_; + LogSetAuthority(authority); + } + + modifier auth { + require(isAuthorized(msg.sender, msg.sig)); + _; + } + + function isAuthorized(address src, bytes4 sig) internal view returns (bool) { + if (src == address(this)) { + return true; + } else if (src == owner) { + return true; + } else if (authority == DSAuthority(0)) { + return false; + } else { + return authority.canCall(src, this, sig); + } + } +} + +////// lib/ds-thing/lib/ds-math/src/math.sol +/// math.sol -- mixin for inline numerical wizardry + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +/* pragma solidity ^0.4.13; */ + +contract DSMath { + function add(uint x, uint y) internal pure returns (uint z) { + require((z = x + y) >= x); + } + function sub(uint x, uint y) internal pure returns (uint z) { + require((z = x - y) <= x); + } + function mul(uint x, uint y) internal pure returns (uint z) { + require(y == 0 || (z = x * y) / y == x); + } + + function min(uint x, uint y) internal pure returns (uint z) { + return x <= y ? x : y; + } + function max(uint x, uint y) internal pure returns (uint z) { + return x >= y ? x : y; + } + function imin(int x, int y) internal pure returns (int z) { + return x <= y ? x : y; + } + function imax(int x, int y) internal pure returns (int z) { + return x >= y ? x : y; + } + + uint constant WAD = 10 ** 18; + uint constant RAY = 10 ** 27; + + function wmul(uint x, uint y) internal pure returns (uint z) { + z = add(mul(x, y), WAD / 2) / WAD; + } + function rmul(uint x, uint y) internal pure returns (uint z) { + z = add(mul(x, y), RAY / 2) / RAY; + } + function wdiv(uint x, uint y) internal pure returns (uint z) { + z = add(mul(x, WAD), y / 2) / y; + } + function rdiv(uint x, uint y) internal pure returns (uint z) { + z = add(mul(x, RAY), y / 2) / y; + } + + // This famous algorithm is called "exponentiation by squaring" + // and calculates x^n with x as fixed-point and n as regular unsigned. + // + // It's O(log n), instead of O(n) for naive repeated multiplication. + // + // These facts are why it works: + // + // If n is even, then x^n = (x^2)^(n/2). + // If n is odd, then x^n = x * x^(n-1), + // and applying the equation for even x gives + // x^n = x * (x^2)^((n-1) / 2). + // + // Also, EVM division is flooring and + // floor[(n-1) / 2] = floor[n / 2]. + // + function rpow(uint x, uint n) internal pure returns (uint z) { + z = n % 2 != 0 ? x : RAY; + + for (n /= 2; n != 0; n /= 2) { + x = rmul(x, x); + + if (n % 2 != 0) { + z = rmul(z, x); + } + } + } +} + +////// lib/ds-thing/lib/ds-note/src/note.sol +/// note.sol -- the `note' modifier, for logging calls as events + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +/* pragma solidity ^0.4.13; */ + +contract DSNote { + event LogNote( + bytes4 indexed sig, + address indexed guy, + bytes32 indexed foo, + bytes32 indexed bar, + uint wad, + bytes fax + ) anonymous; + + modifier note { + bytes32 foo; + bytes32 bar; + + assembly { + foo := calldataload(4) + bar := calldataload(36) + } + + LogNote(msg.sig, msg.sender, foo, bar, msg.value, msg.data); + + _; + } +} + +////// lib/ds-thing/src/thing.sol +// thing.sol - `auth` with handy mixins. your things should be DSThings + +// Copyright (C) 2017 DappHub, LLC + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +/* pragma solidity ^0.4.13; */ + +/* import 'ds-auth/auth.sol'; */ +/* import 'ds-note/note.sol'; */ +/* import 'ds-math/math.sol'; */ + +contract DSThing is DSAuth, DSNote, DSMath { +} + +////// lib/ds-token/lib/ds-stop/src/stop.sol +/// stop.sol -- mixin for enable/disable functionality + +// Copyright (C) 2017 DappHub, LLC + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +/* pragma solidity ^0.4.13; */ + +/* import "ds-auth/auth.sol"; */ +/* import "ds-note/note.sol"; */ + +contract DSStop is DSNote, DSAuth { + + bool public stopped; + + modifier stoppable { + require(!stopped); + _; + } + function stop() public auth note { + stopped = true; + } + function start() public auth note { + stopped = false; + } + +} + +////// lib/ds-token/lib/erc20/src/erc20.sol +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +/* pragma solidity ^0.4.8; */ + +// Token standard API +// https://github.com/ethereum/EIPs/issues/20 + +contract ERC20 { + function totalSupply() public view returns (uint supply); + function balanceOf( address who ) public view returns (uint value); + function allowance( address owner, address spender ) public view returns (uint _allowance); + + function transfer( address to, uint value) public returns (bool ok); + function transferFrom( address from, address to, uint value) public returns (bool ok); + function approve( address spender, uint value ) public returns (bool ok); + + event Transfer( address indexed from, address indexed to, uint value); + event Approval( address indexed owner, address indexed spender, uint value); +} + +////// lib/ds-token/src/base.sol +/// base.sol -- basic ERC20 implementation + +// Copyright (C) 2015, 2016, 2017 DappHub, LLC + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +/* pragma solidity ^0.4.13; */ + +/* import "erc20/erc20.sol"; */ +/* import "ds-math/math.sol"; */ + +contract DSTokenBase is ERC20, DSMath { + uint256 _supply; + mapping (address => uint256) _balances; + mapping (address => mapping (address => uint256)) _approvals; + + function DSTokenBase(uint supply) public { + _balances[msg.sender] = supply; + _supply = supply; + } + + function totalSupply() public view returns (uint) { + return _supply; + } + function balanceOf(address src) public view returns (uint) { + return _balances[src]; + } + function allowance(address src, address guy) public view returns (uint) { + return _approvals[src][guy]; + } + + function transfer(address dst, uint wad) public returns (bool) { + return transferFrom(msg.sender, dst, wad); + } + + function transferFrom(address src, address dst, uint wad) + public + returns (bool) + { + if (src != msg.sender) { + _approvals[src][msg.sender] = sub(_approvals[src][msg.sender], wad); + } + + _balances[src] = sub(_balances[src], wad); + _balances[dst] = add(_balances[dst], wad); + + Transfer(src, dst, wad); + + return true; + } + + function approve(address guy, uint wad) public returns (bool) { + _approvals[msg.sender][guy] = wad; + + Approval(msg.sender, guy, wad); + + return true; + } +} + +////// lib/ds-token/src/token.sol +/// token.sol -- ERC20 implementation with minting and burning + +// Copyright (C) 2015, 2016, 2017 DappHub, LLC + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +/* pragma solidity ^0.4.13; */ + +/* import "ds-stop/stop.sol"; */ + +/* import "./base.sol"; */ + +contract DSToken is DSTokenBase(0), DSStop { + + bytes32 public symbol; + uint256 public decimals = 18; // standard token precision. override to customize + + function DSToken(bytes32 symbol_) public { + symbol = symbol_; + } + + event Mint(address indexed guy, uint wad); + event Burn(address indexed guy, uint wad); + + function approve(address guy) public stoppable returns (bool) { + return super.approve(guy, uint(-1)); + } + + function approve(address guy, uint wad) public stoppable returns (bool) { + return super.approve(guy, wad); + } + + function transferFrom(address src, address dst, uint wad) + public + stoppable + returns (bool) + { + if (src != msg.sender && _approvals[src][msg.sender] != uint(-1)) { + _approvals[src][msg.sender] = sub(_approvals[src][msg.sender], wad); + } + + _balances[src] = sub(_balances[src], wad); + _balances[dst] = add(_balances[dst], wad); + + Transfer(src, dst, wad); + + return true; + } + + function push(address dst, uint wad) public { + transferFrom(msg.sender, dst, wad); + } + function pull(address src, uint wad) public { + transferFrom(src, msg.sender, wad); + } + function move(address src, address dst, uint wad) public { + transferFrom(src, dst, wad); + } + + function mint(uint wad) public { + mint(msg.sender, wad); + } + function burn(uint wad) public { + burn(msg.sender, wad); + } + function mint(address guy, uint wad) public auth stoppable { + _balances[guy] = add(_balances[guy], wad); + _supply = add(_supply, wad); + Mint(guy, wad); + } + function burn(address guy, uint wad) public auth stoppable { + if (guy != msg.sender && _approvals[guy][msg.sender] != uint(-1)) { + _approvals[guy][msg.sender] = sub(_approvals[guy][msg.sender], wad); + } + + _balances[guy] = sub(_balances[guy], wad); + _supply = sub(_supply, wad); + Burn(guy, wad); + } + + // Optional token name + bytes32 public name = ""; + + function setName(bytes32 name_) public auth { + name = name_; + } +} \ No newline at end of file diff --git a/x/evm/embeds/embeds.go b/x/evm/embeds/embeds.go index 1514e0dcc..8bd093e34 100644 --- a/x/evm/embeds/embeds.go +++ b/x/evm/embeds/embeds.go @@ -43,6 +43,8 @@ var ( testERC20TransferWithFee []byte //go:embed artifacts/contracts/TestRandom.sol/TestRandom.json testRandom []byte + //go:embed artifacts/contracts/MKR.sol/DSToken.json + testMetadataBytes32 []byte ) var ( @@ -141,6 +143,11 @@ var ( Name: "TestRandom.sol", EmbedJSON: testRandom, } + // SmartContract_TestBytes32Metadata is a test contract which tests contract that have bytes32 as metadata + SmartContract_TestBytes32Metadata = CompiledEvmContract{ + Name: "MKR.sol", + EmbedJSON: testMetadataBytes32, + } ) func init() { @@ -158,6 +165,7 @@ func init() { SmartContract_TestInfiniteRecursionERC20.MustLoad() SmartContract_TestERC20TransferWithFee.MustLoad() SmartContract_TestRandom.MustLoad() + SmartContract_TestBytes32Metadata.MustLoad() } type CompiledEvmContract struct { diff --git a/x/evm/embeds/embeds_test.go b/x/evm/embeds/embeds_test.go index cf1f0177f..37039e124 100644 --- a/x/evm/embeds/embeds_test.go +++ b/x/evm/embeds/embeds_test.go @@ -22,5 +22,6 @@ func TestLoadContracts(t *testing.T) { embeds.SmartContract_TestInfiniteRecursionERC20.MustLoad() embeds.SmartContract_TestERC20TransferWithFee.MustLoad() embeds.SmartContract_TestRandom.MustLoad() + embeds.SmartContract_TestBytes32Metadata.MustLoad() }) } diff --git a/x/evm/embeds/hardhat.config.js b/x/evm/embeds/hardhat.config.js index 8ba99bc91..c0d1ee331 100644 --- a/x/evm/embeds/hardhat.config.js +++ b/x/evm/embeds/hardhat.config.js @@ -2,5 +2,10 @@ require("@nomicfoundation/hardhat-toolbox"); /** @type import('hardhat/config').HardhatUserConfig */ module.exports = { - solidity: "0.8.24", + solidity: { + compilers: [ + { version: "0.4.19" }, + { version: "0.8.24" }, + ], + }, }; diff --git a/x/evm/evmtest/tx.go b/x/evm/evmtest/tx.go index 440e83556..a5803a3f7 100644 --- a/x/evm/evmtest/tx.go +++ b/x/evm/evmtest/tx.go @@ -26,7 +26,7 @@ import ( ) // ExecuteNibiTransfer executes nibi transfer -func ExecuteNibiTransfer(deps *TestDeps, t *testing.T) *evm.MsgEthereumTx { +func ExecuteNibiTransfer(deps *TestDeps, t *testing.T) (*evm.MsgEthereumTx, *evm.MsgEthereumTxResponse) { nonce := deps.NewStateDB().GetNonce(deps.Sender.EthAddr) recipient := NewEthPrivAcc().EthAddr @@ -43,7 +43,7 @@ func ExecuteNibiTransfer(deps *TestDeps, t *testing.T) *evm.MsgEthereumTx { resp, err := deps.App.EvmKeeper.EthereumTx(sdk.WrapSDKContext(deps.Ctx), ethTxMsg) require.NoError(t, err) require.Empty(t, resp.VmError) - return ethTxMsg + return ethTxMsg, resp } type DeployContractResult struct { diff --git a/x/evm/keeper/call_contract.go b/x/evm/keeper/call_contract.go index e38bbd4a2..f9fdc2c8b 100644 --- a/x/evm/keeper/call_contract.go +++ b/x/evm/keeper/call_contract.go @@ -84,14 +84,11 @@ func (k Keeper) CallContractWithInput( // Success, update block gas used and bloom filter if commit { k.updateBlockBloom(ctx, evmResp, uint64(txConfig.LogIndex)) - // TODO: remove after migrating logs - //err = k.EmitLogEvents(ctx, evmResp) - //if err != nil { - // return nil, nil, errors.Wrap(err, "error emitting tx logs") - //} - // blockTxIdx := uint64(txConfig.TxIndex) + 1 - // k.EvmState.BlockTxIndex.Set(ctx, blockTxIdx) + err = k.EmitLogEvents(ctx, evmResp) + if err != nil { + return nil, errors.Wrap(err, "error emitting tx logs") + } } return evmResp, nil } diff --git a/x/evm/keeper/erc20.go b/x/evm/keeper/erc20.go index e91b3ef7f..f26bee952 100644 --- a/x/evm/keeper/erc20.go +++ b/x/evm/keeper/erc20.go @@ -2,6 +2,7 @@ package keeper import ( + "bytes" "fmt" "math" "math/big" @@ -209,13 +210,22 @@ func (e erc20Calls) loadERC20String( } erc20Val := new(ERC20String) - err = erc20Abi.UnpackIntoInterface( + if err := erc20Abi.UnpackIntoInterface( erc20Val, methodName, res.Ret, - ) - if err != nil { - return out, err + ); err == nil { + return erc20Val.Value, err } - return erc20Val.Value, err + + erc20Bytes32Val := new(ERC20Bytes32) + if err := erc20Abi.UnpackIntoInterface(erc20Bytes32Val, methodName, res.Ret); err == nil { + return bytes32ToString(erc20Bytes32Val.Value), nil + } + + return "", fmt.Errorf("failed to decode response for method %s; unable to unpack as string or bytes32", methodName) +} + +func bytes32ToString(b [32]byte) string { + return string(bytes.Trim(b[:], "\x00")) } func (e erc20Calls) loadERC20Uint8( @@ -243,13 +253,21 @@ func (e erc20Calls) loadERC20Uint8( } erc20Val := new(ERC20Uint8) - err = erc20Abi.UnpackIntoInterface( + if err := erc20Abi.UnpackIntoInterface( erc20Val, methodName, res.Ret, - ) - if err != nil { - return out, err + ); err == nil { + return erc20Val.Value, err } - return erc20Val.Value, err + + erc20Uint256Val := new(ERC20BigInt) + if err := erc20Abi.UnpackIntoInterface( + erc20Uint256Val, methodName, res.Ret, + ); err == nil { + // We can safely cast to uint8 because it's nonsense for decimals to be larger than 255 + return uint8(erc20Uint256Val.Value.Uint64()), err + } + + return 0, fmt.Errorf("failed to decode response for method %s; unable to unpack as uint8 or uint256", methodName) } func (e erc20Calls) LoadERC20BigInt( diff --git a/x/evm/keeper/funtoken_from_coin_test.go b/x/evm/keeper/funtoken_from_coin_test.go index f611fd438..a858c4589 100644 --- a/x/evm/keeper/funtoken_from_coin_test.go +++ b/x/evm/keeper/funtoken_from_coin_test.go @@ -29,6 +29,7 @@ func (s *FunTokenFromCoinSuite) TestCreateFunTokenFromCoin() { deps.Ctx, evmObj, crypto.CreateAddress(evm.EVM_MODULE_ADDRESS, deps.EvmKeeper.GetAccNonce(deps.Ctx, evm.EVM_MODULE_ADDRESS)), + nil, ) s.Require().Error(err) s.Require().Nil(metadata) @@ -114,7 +115,7 @@ func (s *FunTokenFromCoinSuite) TestCreateFunTokenFromCoin() { s.T().Log("Expect ERC20 metadata on contract") evmObj, _ := deps.NewEVM() - info, err := deps.EvmKeeper.FindERC20Metadata(deps.Ctx, evmObj, actualErc20Addr.Address) + info, err := deps.EvmKeeper.FindERC20Metadata(deps.Ctx, evmObj, actualErc20Addr.Address, nil) s.Require().NoError(err, info) s.Equal( keeper.ERC20Metadata{ diff --git a/x/evm/keeper/funtoken_from_erc20.go b/x/evm/keeper/funtoken_from_erc20.go index b393811f9..5eb55ce4a 100644 --- a/x/evm/keeper/funtoken_from_erc20.go +++ b/x/evm/keeper/funtoken_from_erc20.go @@ -8,6 +8,7 @@ import ( "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" bank "github.com/cosmos/cosmos-sdk/x/bank/types" + gethabi "github.com/ethereum/go-ethereum/accounts/abi" gethcommon "github.com/ethereum/go-ethereum/common" gethcore "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/vm" @@ -31,19 +32,25 @@ func (k Keeper) FindERC20Metadata( ctx sdk.Context, evmObj *vm.EVM, contract gethcommon.Address, + abi *gethabi.ABI, ) (info *ERC20Metadata, err error) { + effectiveAbi := embeds.SmartContract_ERC20Minter.ABI + + if abi != nil { + effectiveAbi = abi + } // Load name, symbol, decimals - name, err := k.ERC20().LoadERC20Name(ctx, evmObj, embeds.SmartContract_ERC20Minter.ABI, contract) + name, err := k.ERC20().LoadERC20Name(ctx, evmObj, effectiveAbi, contract) if err != nil { return nil, err } - symbol, err := k.ERC20().LoadERC20Symbol(ctx, evmObj, embeds.SmartContract_ERC20Minter.ABI, contract) + symbol, err := k.ERC20().LoadERC20Symbol(ctx, evmObj, effectiveAbi, contract) if err != nil { return nil, err } - decimals, err := k.ERC20().LoadERC20Decimals(ctx, evmObj, embeds.SmartContract_ERC20Minter.ABI, contract) + decimals, err := k.ERC20().LoadERC20Decimals(ctx, evmObj, effectiveAbi, contract) if err != nil { return nil, err } @@ -84,7 +91,8 @@ type ( ERC20Uint8 struct{ Value uint8 } ERC20Bool struct{ Value bool } // ERC20BigInt: Unpacking type for "uint256" from Solidity. - ERC20BigInt struct{ Value *big.Int } + ERC20BigInt struct{ Value *big.Int } + ERC20Bytes32 struct{ Value [32]byte } ) // createFunTokenFromERC20 creates a new FunToken mapping from an existing ERC20 token. @@ -138,7 +146,7 @@ func (k *Keeper) createFunTokenFromERC20( false, ) evmObj := k.NewEVM(ctx, evmMsg, k.GetEVMConfig(ctx), evm.NewNoOpTracer(), stateDB) - erc20Info, err := k.FindERC20Metadata(ctx, evmObj, erc20) + erc20Info, err := k.FindERC20Metadata(ctx, evmObj, erc20, nil) if err != nil { return nil, err } diff --git a/x/evm/keeper/funtoken_from_erc20_test.go b/x/evm/keeper/funtoken_from_erc20_test.go index 1a0c4cd1f..438b928ba 100644 --- a/x/evm/keeper/funtoken_from_erc20_test.go +++ b/x/evm/keeper/funtoken_from_erc20_test.go @@ -2,6 +2,7 @@ package keeper_test import ( + "encoding/hex" "fmt" "math/big" "testing" @@ -42,7 +43,7 @@ func (s *FunTokenFromErc20Suite) TestCreateFunTokenFromERC20() { evmObj, _ := deps.NewEVM() - actualMetadata, err := deps.EvmKeeper.FindERC20Metadata(deps.Ctx, evmObj, deployResp.ContractAddr) + actualMetadata, err := deps.EvmKeeper.FindERC20Metadata(deps.Ctx, evmObj, deployResp.ContractAddr, nil) s.Require().NoError(err) s.Require().Equal(metadata, *actualMetadata) @@ -533,6 +534,65 @@ func (s *FunTokenFromErc20Suite) TestSendERC20WithFee() { s.Require().True(deps.App.BankKeeper.GetBalance(deps.Ctx, evm.EVM_MODULE_ADDRESS_NIBI, bankDemon).Amount.Equal(sdk.NewInt(0))) } +type MkrMetadata struct { + Symbol [32]byte +} + +func (s *FunTokenFromErc20Suite) TestFindMKRMetadata() { + deps := evmtest.NewTestDeps() + + s.T().Log("Deploy MKR") + + byteSlice, err := hex.DecodeString("4d4b520000000000000000000000000000000000000000000000000000000000") + s.Require().NoError(err) + var byteArray [32]byte + copy(byteArray[:], byteSlice) + + metadata := MkrMetadata{ + Symbol: byteArray, + } + deployResp, err := evmtest.DeployContract( + &deps, embeds.SmartContract_TestBytes32Metadata, + metadata.Symbol, + ) + s.Require().NoError(err) + + s.T().Log("set name") + + byteSlice, err = hex.DecodeString("4d616b6572000000000000000000000000000000000000000000000000000000") + s.Require().NoError(err) + copy(byteArray[:], byteSlice) + + contractInput, err := embeds.SmartContract_TestBytes32Metadata.ABI.Pack( + "setName", + byteArray, + ) + s.Require().NoError(err) + + evmObj, _ := deps.NewEVM() + _, err = deps.EvmKeeper.CallContractWithInput( + deps.Ctx, + evmObj, + deps.Sender.EthAddr, + &deployResp.ContractAddr, + true, + contractInput, + evmtest.FunTokenGasLimitSendToEvm, + ) + + s.Require().NoError(err) + + info, err := deps.EvmKeeper.FindERC20Metadata(deps.Ctx, evmObj, deployResp.ContractAddr, embeds.SmartContract_TestBytes32Metadata.ABI) + s.Require().NoError(err) + + actualMetadata := keeper.ERC20Metadata{ + Name: "Maker", + Symbol: "MKR", + Decimals: 18, + } + s.Require().Equal(actualMetadata, *info) +} + type FunTokenFromErc20Suite struct { suite.Suite } diff --git a/x/evm/keeper/grpc_query_test.go b/x/evm/keeper/grpc_query_test.go index 28da63173..2b75914b2 100644 --- a/x/evm/keeper/grpc_query_test.go +++ b/x/evm/keeper/grpc_query_test.go @@ -767,7 +767,7 @@ func (s *Suite) TestTraceTx() { { name: "happy: simple nibi transfer tx", scenario: func(deps *evmtest.TestDeps) (req In, wantResp Out) { - txMsg := evmtest.ExecuteNibiTransfer(deps, s.T()) + txMsg, _ := evmtest.ExecuteNibiTransfer(deps, s.T()) req = &evm.QueryTraceTxRequest{ Msg: txMsg, } @@ -843,7 +843,7 @@ func (s *Suite) TestTraceBlock() { name: "happy: simple nibi transfer tx", setup: nil, scenario: func(deps *evmtest.TestDeps) (req In, wantResp Out) { - txMsg := evmtest.ExecuteNibiTransfer(deps, s.T()) + txMsg, _ := evmtest.ExecuteNibiTransfer(deps, s.T()) req = &evm.QueryTraceBlockRequest{ Txs: []*evm.MsgEthereumTx{ txMsg, diff --git a/x/oracle/keeper/app_test.go b/x/oracle/keeper/app_test.go index 197c73223..c8b5ebe33 100644 --- a/x/oracle/keeper/app_test.go +++ b/x/oracle/keeper/app_test.go @@ -117,7 +117,7 @@ func (s *TestSuite) sendPrevotes(prices []map[asset.Pair]sdk.Dec) []string { pricesStr, err := votes.ToString() s.Require().NoError(err) - _, err = s.network.BroadcastMsgs(val.Address, &types.MsgAggregateExchangeRatePrevote{ + _, err = s.network.BroadcastMsgs(val.Address, nil, &types.MsgAggregateExchangeRatePrevote{ Hash: types.GetAggregateVoteHash("1", pricesStr, val.ValAddress).String(), Feeder: val.Address.String(), Validator: val.ValAddress.String(), @@ -133,7 +133,7 @@ func (s *TestSuite) sendPrevotes(prices []map[asset.Pair]sdk.Dec) []string { func (s *TestSuite) sendVotes(rates []string) { for i, val := range s.network.Validators { - _, err := s.network.BroadcastMsgs(val.Address, &types.MsgAggregateExchangeRateVote{ + _, err := s.network.BroadcastMsgs(val.Address, nil, &types.MsgAggregateExchangeRateVote{ Salt: "1", ExchangeRates: rates[i], Feeder: val.Address.String(),