Copy code from daodalus