# Cannot deploy invalid contract

**URL:** <https://forum.flow.com/t/cannot-deploy-invalid-contract/2484>\
**Category:** 🏄🏻‍♀️ Cadence\
**Created:** [October 22, 2021, 7:57am UTC](https://forum.flow.com/t/cannot-deploy-invalid-contract/2484 "2021-10-22T07:57:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sarath](https://avatars.discourse-cdn.com/v4/letter/s/958977/32.png) [@Sarath](https://forum.flow.com/u/Sarath)\
**Post date:** [October 22, 2021, 7:57am UTC](https://forum.flow.com/t/cannot-deploy-invalid-contract/2484/1 "2021-10-22T07:57:50Z")

</div>

Hi,  
i try to deploy the bellow contract, but i am getting error

transaction() {  
prepare(admin: AuthAccount) {  
let code: [UInt8] = “f845b8404d171ee5ee7303d91db44363d39230cef2ed8f6f48e15a10756458ffda0b6bddb232d05eb1b6a5598be6818e53a4709daf4ca22722882bf6fb3a228a6ef49d7b030364”.decodeHex()  
let signer = AuthAccount(payer: admin)  
signer.contracts.add(  
name: “Test”,  
code: code  
)  
}  
}

 ![Screenshot 2021-10-22 at 11.32.14 AM](https://us1.discourse-cdn.com/flex022/uploads/flow/original/1X/23b6ed6b603341e20cca8e874c035639f5fdae1e.png)

---

<div class="post-metadata">

**Author:** ![bastian](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.flow.com/bastian/32/183_2.png) [@bastian](https://forum.flow.com/u/bastian)\
**Post date:** [October 22, 2021, 11:44am UTC](https://forum.flow.com/t/cannot-deploy-invalid-contract/2484/2 "2021-10-22T11:44:09Z")

</div>

You get this error because the code you provide is invalid, it looks like random data and not Cadence source code.

How did you generate the hex-encoded form of the code you provide?

```auto
f845b8404d171ee5ee7303d91db44363d39230cef2ed8f6f48e15a10756458ffda0b6bddb232d05eb1b6a5598be6818e53a4709daf4ca22722882bf6fb3a228a6ef49d7b030364

```

If I decode this, it looks like random data.
