Skip to content

Instantly share code, notes, and snippets.

@kamescg
Last active December 17, 2020 03:52
Show Gist options
  • Save kamescg/05aba5af7acd3a1dcbb6b8bb75d1200e to your computer and use it in GitHub Desktop.
Save kamescg/05aba5af7acd3a1dcbb6b8bb75d1200e to your computer and use it in GitHub Desktop.
Encode Transaction and called MakerDAO DsProxyActions Contract
/* ------------------------ */
// Call Vault Manager (DsProxyActions.sol)
/* ------------------------ */
function callVaultManager (bytes memory _data) public payable {
IDSProxy proxy = IDSProxy(dss_proxy);
proxy.execute.value(msg.value)(vault_manager, _data);
}
function callVaultManager (uint256 _amount, bytes memory _data) public {
IDSProxy proxy = IDSProxy(dss_proxy);
proxy.execute.value(_amount)(vault_manager, _data);
}
// ETH Vault Functions
/* ------------------------ */
function openETHVault(
uint wadD,
bytes32 ilk
) public payable {
GenerateCallData proxy = GenerateCallData(data_generation);
bytes memory data = proxy.openLockETHAndDraw(
dai_manager,
dai_jug,
dai_ethJoin,
dai_daiJoin,
ilk,
wadD
);
callVaultManager(data);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment