DSProxyService
includes all the functionality necessary for interacting with both types of proxy contracts used in Maker products: profile proxies and forwarding proxies.execute()
method, which runs the provided code in the context of the profile proxy.DSProxyService
will only be relevant to power users
. All that is strictly required to automatically generate a function's calldata and find the correct profile proxy is the inclusion of { dsProxy: true }
in the options object for any transaction — provided the user has already deployed a profile proxy. If that's not certain, it may also be necessary to query the registry to determine if a user already owns a proxy, and to build
one if they do not.null
)currentAccount
(according the Web3Service
) has already deployed a DSProxy, currentProxy()
returns its address. If not, it returns null
. It will update automatically in the event that the active account is changed. This function should be used to check whether a user has a proxy before attempting to build one.TransactionObject
build
will deploy a copy of DSProxy owned by the current account. This transaction will revert if the current account already owns a profile proxy. By default, build()
returns after the transaction is mined.getProxyAddress
will query the proxy registry for the profile proxy address associated with a given account. If no address is provided as a parameter, the function will return the address of the proxy owned by the currentAccount
.getOwner
will query the proxy registry for the owner of a provided instance of DSProxy.TransactionObject
setOwner
can be used to give a profile proxy to a new owner. The address of the recipient account must be specified, but the DSProxy address will default to currentProxy
if the second parameter is excluded.