Update contract.js

#582